From 0224e037270fa449da5dad42a8cbd57af412657d Mon Sep 17 00:00:00 2001 From: Hiiragi Date: Sat, 26 Nov 2022 09:03:38 +0900 Subject: [PATCH] add snippets for control blocks --- CHANGELOG.md | 4 +++ language-configuration.json | 7 ++++- package.json | 2 +- snippets/codev.json | 52 +++++++++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a16b22..9e75741 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the "vscode-codev" extension will be documented in this file. +## [0.5.3] +- Add snippets for control blocks +- Add indentation rules + ## [0.5.2] - Some of the snippets were simplified. - The file "sample.seq" was removed. diff --git a/language-configuration.json b/language-configuration.json index 8ec417c..e1e24e3 100644 --- a/language-configuration.json +++ b/language-configuration.json @@ -18,5 +18,10 @@ ["(", ")"], ["\"", "\""], ["'", "'"] - ] + ], + + "indentationRules": { + "increaseIndentPattern": "^\\s*\\b(fct|if|els|els if|for|whi|unt)\\b", + "decreaseIndentPattern": "^\\s*\\b(end\\w*|els|els if)\\b" + } } \ No newline at end of file diff --git a/package.json b/package.json index 6005e40..0712882 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "name": "Hiiragi", "email": "heterophyllus.work@gmail.com" }, - "version": "0.5.2", + "version": "0.5.3", "engines": { "vscode": "^1.41.0" }, diff --git a/snippets/codev.json b/snippets/codev.json index eefda35..58cb67d 100644 --- a/snippets/codev.json +++ b/snippets/codev.json @@ -1,4 +1,56 @@ { + "for":{ + "prefix": "for", + "body":[ + "for ${1:var} ${2:expr1} ${3:expr2}", + "\t$0", + "end for" + ], + "description": "for loop" + }, + + "whi":{ + "prefix":"whi", + "body": [ + "whi ${1:expr}", + "\t$0", + "end whi" + ], + "description":"while loop" + }, + + "unt":{ + "prefix":"unt", + "body":[ + "unt", + "\t$0", + "end unt ${1:expr}" + ], + "description":"until loop" + }, + + "if":{ + "prefix":"if", + "body":[ + "if ${1:expr}", + "\t$0", + "end if" + ], + "description":"if...end" + }, + + "if_elseif":{ + "prefix":"if", + "body":[ + "if ${1:expr}", + "\t$0", + "els if ${2:expr}", + "\t$0", + "end if" + ], + "description":"if...elseif...end" + }, + "ABSF":{ "prefix": "ABSF", "body": "ABSF($1)",