syntax & autocomplete refactor

This commit is contained in:
Bartek Zbytniewski
2025-04-18 20:43:44 +02:00
parent 3c4fd20d70
commit 3ca10fc85a
2 changed files with 6 additions and 18 deletions

View File

@@ -4,25 +4,25 @@
// Keywords // Keywords
{ {
"trigger": "if", "trigger": "if",
"contents": "if (${1:condition}) { ${2:block} }", "contents": "if (${1:condition}) {\n\t${2:// Your start code here}\n}",
"details": "if (condition) { block }", "details": "if (condition) { block }",
"kind": "keyword" "kind": "keyword"
}, },
{ {
"trigger": "else", "trigger": "else",
"contents": "else { ${1:block} }", "contents": "else {\n\t${1:// Your start code here}\n}",
"details": "else { block }", "details": "else { block }",
"kind": "keyword" "kind": "keyword"
}, },
{ {
"trigger": "loop", "trigger": "loop",
"contents": "loop ${1:label} { ${2:block} }", "contents": "loop ${1:label} {\n\t${2:// Your start code here}\n}",
"details": "loop label { block }", "details": "loop label { block }",
"kind": "keyword" "kind": "keyword"
}, },
{ {
"trigger": "fn", "trigger": "fn",
"contents": "fn ${1:name}(${2:params}) ${3:-> ${4:return_type}} { ${5:block} }", "contents": "fn ${1:name}(${2:params}) {\n\t${3:// Your start code here}\n}",
"details": "fn name(params) [-> return_type] { block }", "details": "fn name(params) [-> return_type] { block }",
"kind": "keyword" "kind": "keyword"
}, },
@@ -74,12 +74,6 @@
"details": "return [expression]", "details": "return [expression]",
"kind": "keyword" "kind": "keyword"
}, },
{
"trigger": "block",
"contents": "block ${1:label} { ${2:block} }",
"details": "block label { block }",
"kind": "keyword"
},
{ {
"trigger": "branch", "trigger": "branch",
"contents": "branch ${1:label};", "contents": "branch ${1:label};",
@@ -88,7 +82,7 @@
}, },
{ {
"trigger": "data", "trigger": "data",
"contents": "data ${1:address} { ${2:content} }", "contents": "data ${1:address} {\n\t${2:content}\n}",
"details": "data address { content }", "details": "data address { content }",
"kind": "keyword" "kind": "keyword"
}, },
@@ -110,12 +104,6 @@
"details": "Inline variable modifier", "details": "Inline variable modifier",
"kind": "storage.modifier" "kind": "storage.modifier"
}, },
{
"trigger": "break",
"contents": "break;",
"details": "Break from block or loop",
"kind": "keyword"
},
// Operators // Operators
{ {

View File

@@ -38,7 +38,7 @@ contexts:
scope: storage.modifier.curlywasm scope: storage.modifier.curlywasm
# Control flow # Control flow
- match: \b(return|if|else|loop|block|branch|branch_if|break)\b - match: \b(return|if|else|loop|branch|branch_if)\b
scope: keyword.control.flow.curlywasm scope: keyword.control.flow.curlywasm
# Type conversion # Type conversion