A project's packages, and diagnostics at their column

A file in a project is checked against the packages bjo fetched for it:
the server installs the project's .bjo/roots, .bjo/frameworks and
.bjo/nuget/root before its first check, through the compiler's
ProjectInputs, so imports from packages check and definition, hover and
completion reach them. A server serves one project, the first file's; a
warning on a file's first line says when it cannot serve one as bjo
would: packages not fetched, the roots changed since it started, or
another project.

The server no longer has the old Microsoft.Extensions.DependencyInjection
.Abstractions next to it. The compiler excludes it, the exclusion does
not pass through a project reference, and with it there every ASP.NET
type failed to load, so bjoweb did not check.

A diagnostic marks the form at the line and column the compiler names
now: an atom or a string whole, a bracketed form to its closing bracket,
and one over several lines as far as its head.

The build no longer asks git for Source Link, which fails on this
repository's SHA-256 objects.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
This commit is contained in:
Linus Björnstam 2026-10-20 19:30:50 +02:00
parent 77b8a92e03
commit cc62a8a360
6 changed files with 362 additions and 15 deletions

View file

@ -52,6 +52,19 @@ let private publish (uri: string) =
let buffers =
texts |> Seq.map (fun kv -> IO.Path.GetFullPath(uriToPath kv.Key), kv.Value) |> Map.ofSeq
// Before the check: the first file asked about decides which project's
// packages are installed, and they have to be before anything resolves.
let note: Check.Found list =
match Project.prepare (uriToPath uri) with
| Some message ->
[ { Line = 0
Column = 0
EndLine = 1
EndColumn = 0
IsError = false
Message = message } ]
| None -> []
let found =
try
Check.file buffers (uriToPath uri)
@ -59,7 +72,7 @@ let private publish (uri: string) =
Rpc.log $"check of %s{uri} failed: %O{ex}"
[]
Rpc.notify "textDocument/publishDiagnostics" (Check.publishParams uri found)
Rpc.notify "textDocument/publishDiagnostics" (Check.publishParams uri (note @ found))
/// When each changed file is next to be checked. A check waits for typing to
/// pause, as one per keystroke would queue up behind each other.