Commit Graph

7 Commits

Author SHA1 Message Date
agra
8775ffa778 lsp: whole-program diagnostics from the real compiler on save
Reuse the compiler's lowering pass instead of re-implementing its checks
in sema. A module can't be lowered standalone — lowering only type-checks
functions reachable from a root — so the open file alone misses errors
like a *Move passed into a by-value method parameter. Drive the workspace
entry (main.sx) through parse → resolveImports → lowerToIR, then attribute
each diagnostic back to its file via source_file and publish per file
(clearing files whose errors are gone).

Runs on didOpen/didSave (disk-based); sema stays the live per-keystroke
layer. Advertise textDocumentSync.save so the editor sends didSave.

collectProjectDiagnostics is split out (transport-free) and covered by a
hermetic temp-project test.
2026-05-31 15:10:59 +03:00
agra
28e02a8372 lsp: implement textDocument/references (find references)
cmd-clicking a definition (or any use) now lists all references. Same-file matches are precise (by symbol index); cross-file matches a top-level name across loaded documents. Advertises referencesProvider. Verified: references to a free function resolve across files (rules.sx def + internal calls + main.sx caller).
2026-05-31 11:51:06 +03:00
agra
170e236764 vtables, protocol 2026-02-24 06:20:38 +02:00
agra
1cc67f9b5a optionals 2026-02-22 22:16:30 +02:00
agra
2f95810f9d ... 2026-02-20 18:22:42 +02:00
agra
7bb4fe0c5f ufcs 2026-02-11 02:22:00 +02:00
agra
55fc5790e4 so... jai :D 2026-02-09 18:07:41 +02:00