Finch 2.5.0: docs (EN, PL), Kate and VS Code for the new features

- cheat sheets, technicians' and engineers' guides: "\(x)", test blocks, finch fmt, finch.toml,
  the build cache, the chain of calls, threads and atomics, C++/Rust/Android, struct #defines,
  passing structs, why there is no warning for big copies
- Kate (version 4) and VS Code: code inside text, test, min/max/abs/clamp/assert/atomic_...
- finch.toml's name is used only for its entry; other files of the project keep their own name

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016GzNP6r8dg6WDxUVZy8wjL
This commit is contained in:
Nexoniarz 2026-10-29 11:34:41 +01:00
commit bb9702aeba
16 changed files with 778 additions and 60 deletions

View file

@ -1,5 +1,11 @@
# Changelog
## 2.5.0
- Highlighting for code inside text (`"hp \(hp)"`), `test "…" { }` blocks, `const`, `"""` text, `1e9`.
- Built-ins `min`, `max`, `abs`, `clamp`, `assert` and `atomic_…` highlighted and described on hover.
- Format Document (the language server runs `finch fmt` on the open file).
## 2.4.0
- Highlighting for methods (`fn Point.move`), maps (`map[K]V`), `or`, `try`, `self` and `error(...)`.

View file

@ -2,7 +2,7 @@
"name": "finch-lang",
"displayName": "Finch",
"description": "The Finch programming language: highlighting, errors as you type, completion, hover, go to definition, and a Run button.",
"version": "2.4.0",
"version": "2.5.0",
"publisher": "nexoniarz",
"license": "Apache-2.0",
"icon": "images/icon.png",

View file

@ -103,6 +103,10 @@
},
"statements": {
"patterns": [
{
"name": "keyword.other.test.finch",
"match": "\\btest(?=\\s*\")"
},
{
"include": "#comments"
},
@ -147,7 +151,7 @@
"match": "\\b(int|float|bool|char|str|ptr|map|i8|i16|i32|i64|u8|u16|u32|u64|f32|f64)\\b"
},
{
"match": "\\b(print|input|read_file|write_file|file_exists|delete_file|shell|exit|addr|new|free|error)\\s*(?=\\()",
"match": "\\b(print|input|read_file|write_file|file_exists|delete_file|shell|exit|addr|new|free|error|min|max|abs|clamp|assert|atomic_add|atomic_sub|atomic_load|atomic_store|atomic_swap|atomic_cas)\\s*(?=\\()",
"captures": {
"1": {
"name": "support.function.builtin.finch"
@ -217,6 +221,9 @@
"begin": "\"",
"end": "\"|$",
"patterns": [
{
"include": "#interpolation"
},
{
"name": "constant.character.escape.finch",
"match": "\\\\[ntr0\\\\\"']"
@ -259,11 +266,49 @@
"begin": "\"\"\"",
"end": "\"\"\"",
"patterns": [
{
"include": "#interpolation"
},
{
"name": "constant.character.escape.finch",
"match": "\\\\[ntr0\\\\\"']"
}
]
},
"interpolation": {
"name": "meta.embedded.line.finch",
"begin": "\\\\\\(",
"end": "\\)",
"beginCaptures": {
"0": {
"name": "punctuation.section.embedded.begin.finch"
}
},
"endCaptures": {
"0": {
"name": "punctuation.section.embedded.end.finch"
}
},
"patterns": [
{
"include": "#interpolation-parens"
},
{
"include": "$self"
}
]
},
"interpolation-parens": {
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#interpolation-parens"
},
{
"include": "$self"
}
]
}
}
}

View file

@ -26,6 +26,9 @@ const code = [
' self.x += dx',
' return error("no")',
'}',
'test "lives \\(hp + f(1)) left" {',
' assert(clamp(x, 0, 9) == 3)',
'}',
];
const expect = [ // [line, token text, scope that must be present]
[0, 'import', 'keyword.control.import'], [0, '"stdio.h"', 'string.quoted.double'],
@ -43,6 +46,9 @@ const expect = [ // [line, token text, scope that must be present]
[13, 'try', 'keyword.control'], [13, 'or', 'keyword.control'],
[14, 'self', 'variable.language.self'],
[15, 'error', 'support.function.builtin'],
[17, 'test', 'keyword.other.test'], [17, '\\(', 'punctuation.section.embedded.begin'], [17, 'hp', 'meta.embedded.line'],
[17, 'f', 'meta.embedded.line'], [17, 'left', 'string.quoted.double'],
[18, 'assert', 'support.function.builtin'], [18, 'clamp', 'support.function.builtin'],
];
registry.loadGrammar('source.finch').then((g) => {
let state = vsctm.INITIAL, toks = [];