mirror of
https://github.com/Nexoniarz/Finch.git
synced 2026-11-03 00:44:27 +00:00
VS Code extension (highlighting, snippets, language client, Run/Build); LF line endings; LNK1181
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5972d805aa
commit
eaacf70e42
19 changed files with 4821 additions and 3 deletions
16
editors/vscode/snippets/finch.json
Normal file
16
editors/vscode/snippets/finch.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"main": { "prefix": "main", "body": ["fn main() {", "\t$0", "}"], "description": "The program's start" },
|
||||
"main with arguments": { "prefix": "mainargs", "body": ["fn main([]str args) {", "\t$0", "}"], "description": "main that gets the command-line arguments" },
|
||||
"function": { "prefix": "fn", "body": ["fn ${1:name}(${2}) {", "\t$0", "}"], "description": "A function" },
|
||||
"function with result": { "prefix": "fnr", "body": ["fn ${1:name}(${2}) -> ${3:int} {", "\t$0", "}"], "description": "A function that returns a value" },
|
||||
"struct": { "prefix": "struct", "body": ["struct ${1:Name} {", "\t${2:int} ${3:field}", "}"], "description": "A struct" },
|
||||
"if": { "prefix": "if", "body": ["if ${1:condition} {", "\t$0", "}"] },
|
||||
"if else": { "prefix": "ife", "body": ["if ${1:condition} {", "\t$2", "} else {", "\t$0", "}"] },
|
||||
"for range": { "prefix": "for", "body": ["for ${1:i} in ${2:0}..${3:n} {", "\t$0", "}"], "description": "Count from start to end-1" },
|
||||
"for each": { "prefix": "foreach", "body": ["for ${1:item} in ${2:list} {", "\t$0", "}"], "description": "Every element of an array or str" },
|
||||
"while": { "prefix": "while", "body": ["while ${1:condition} {", "\t$0", "}"] },
|
||||
"print": { "prefix": "print", "body": ["print(${1})"] },
|
||||
"input": { "prefix": "input", "body": ["${1:answer} := input(\"${2:Question? }\")"] },
|
||||
"import C header": { "prefix": "importc", "body": ["import \"${1:stdio.h}\""] },
|
||||
"defer": { "prefix": "defer", "body": ["defer ${1}"], "description": "Run this when the block ends" }
|
||||
}
|
||||
Loading…
Reference in a new issue