finch lsp: the language server, written in Finch

Hover, go to definition, completion (after a dot too: fields, methods, a module's names, an enum's variants,
array/text/map methods), signature help, the outline and errors while typing -- everything the C++ one did,
and the same tests/lsp_test.py passes against it.

It doesn't type-check by itself: for every change it runs  finch index  on the editor's text (--overlay says
which file the text stands in for) and reads what the compiler learned about every name, which is also what
the compiler's own error messages are made of. Half-typed code keeps using the last version that compiled.
src/docs.fch is the one description of the built-ins that hover and completion share.

tests/run.sh runs the LSP test too. 107 passed.
This commit is contained in:
Nexoniarz 2026-10-25 21:48:11 +01:00
commit 636eaefe59
9 changed files with 64467 additions and 48172 deletions

View file

@ -108,6 +108,7 @@ struct Node {
int line
int col
int file
int endLine // block, fn: the line of the closing }
}
struct Program {