Commit graph

4 commits

Author SHA256 Message Date
5e4ac7d9aa Checks run on a thread of their own
A check held up every request, because the compiler could run one
compilation at a time. It can now run each in a context of its own.

- A check runs on a checking thread, in Compilation.inNew. The thread
  reports a check to the thread that serves requests, which writes to the
  client.
- The outline, definitions, references, completion, signature help and
  formatting are answered while a check runs.
- A hover, a code action and bjolang/expandMacro are answered when the
  check of their file ends, with the results of the text as it stands.
  Other requests are served meanwhile.
- A file that changes again before its check starts is checked once.
- The tables that a check writes are concurrent dictionaries.
- Standard output is the protocol's; the console's output goes to standard
  error.
- smoke: with a check of 1.6 s running, an outline is answered in 0.1 s.

Needs the compiler at its commit "Diagnostics.captured collects the output
of its own context".

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-25 09:32:15 +01:00
c5acafd5dd The compiler's values of a compilation are written as .Value
The compiler keeps the state of a compilation in a context
(Compilation.fs, on its branch compilation-context), and a value that was a
module-level mutable is a Per. The server sets Diagnostics.verbose,
Paths.sourceOverrides, Paths.compilerAssembly and the five observers, each
now as x.Value <- ...

No change to what the server does: every check still runs in the one root
context.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-25 08:39:42 +01:00
ce426b94df Signature help, formatting, and a fix that writes a missing signature
- textDocument/signatureHelp: the function whose call the cursor is in,
  with the parameter that is being written marked. A definition shows its
  head as written; an import, a trait's method and a builtin show their
  type. It reads tokens as far as the cursor, so a call that is not closed
  has help.
- textDocument/formatting: the whole text as bjo fmt lays it out. The
  server runs bjo -q fmt - on the buffer's text.
- A quick fix at a function with no signature writes the one its body
  gives it, on a line above the definition
  (CheckDecl.observeMissingSignature, in the compiler).
- The server says version 0.8.0.

Needs the compiler at its commit "CheckDecl.observeMissingSignature".

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-25 08:01:34 +01:00
23b6a0e55c References, and code actions that add a match's clauses and fill holes
textDocument/references and documentHighlight give the uses of the name
at point in its module, found as go to definition finds a binding: a
local, a top-level definition, a type or a constructor, or an imported
name where the module uses it. Uses.fs holds the search, which Rename
now shares.

textDocument/codeAction offers what the compiler worked out while it
checked (Exhaustiveness.observe, Holes.observe, kept by Fixes.fs): at an
incomplete match, the clauses it lacks, lined up after its last clause
with holes as bodies; at a typed hole, a binding in scope that fits, a
constructor of its type with holes for what it takes, or a fun.

Version 0.7.0.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-22 20:34:41 +02:00