Commit graph

11 commits

Author SHA256 Message Date
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
d421ec9363 Diagnostics at the compiler's ranges, and a link to one in another file
- A diagnostic is marked from where the compiler's range of it starts to
  where it ends (Diagnostics.rangeOf, in the compiler). A quoted list, an
  array literal and an interpolated string were marked as one character.
  A location with no range behind it is read from the message, as before.
- A diagnostic in an included or an imported file has its place there as
  related information.
- The README and the smoke test name bin/Release/net11.0, where the build
  is since the compiler's target changed.
- smoke: the prelude's definitions are in prelude/core.bjo.

Needs the compiler at its commit "Diagnostics.rangeOf".

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-25 07:30:13 +01:00
9a365b260b Local names and top-level names as the compiler binds them
- Scope: a run of body defs and defuns is one recursive group; pattern
  parameters; a let of plain names; with-open in sequence; :as; a named
  loop's name; def*, begin and :leave arms. A :view's step, a loop's =>
  call and a comprehension's head are not binders.
- Symbols: a pattern def or def* gives what it binds; :alias; a
  def/grammar's productions and cases; unit forms as constants.
- Completion: the special forms as the compiler has them now.

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

Co-Authored-By: eca-agent <git@eca.dev>
2026-11-09 15:02:46 +01:00
78d18c9854 Hover on fields, and on locals of record types
A field read shows the field's type and its declaration; a local of a
record, struct or union type shows the type. Structs and opaque types get
their symbols, and the file's own types drop their module qualifier.
2026-11-03 14:45:55 +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
853b7c3163 Rename, and a hover that leads with the type
textDocument/rename and prepareRename rename a local binding, or a
top-level def or defun the module does not export, with its signature,
doc and the files the module includes; a parameter's (arg ...) in its
function's doc goes with it. A rename that could change what the program
means is refused with the reason: a capture, a keyword parameter, an
exported or foreign name, a name that is not one. The renamed text is
checked first, and one with an error the text before did not have is
refused with it.

A hover's first line, which is what the status bar shows, is the type: a
nameless (: Type) above a definition is found and shown with the name, and
a definition with no signature in the file being edited shows the type the
compiler inferred.

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

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-22 16:36:22 +02:00
bcfcc5500b A name a body form defines is bound where it is written
A def, a pattern def and a defun in a body made their names visible to the
forms after them only, so at the name itself nothing bound it: no inlay
hint, and no local hover. A position on such a name is now that name's
binding.

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

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-22 14:03:56 +02:00
471b49d9e4 Inferred types: in hovers, and as inlay hints
A check keeps what the compiler inferred, through Inference.observe, as
each use of a name with its type there and each binding with the type it
binds. A hover shows (: name type) for a local, and a generic function's
type at the use hovered. Inlay hints show the type after each local name
where it is bound and no type is written.

Hints before the first change since the last check are sent; the ones after
it wait for the check, which then asks the client to ask again. A hover runs
a check that is due first.

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

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-22 12:58:19 +02:00
cc62a8a360 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>
2026-10-20 19:30:50 +02:00
77b8a92e03 Debugging with dape and netcoredbg, and the compiler's new options
emacs/bjolang-dape.el adds a dape configuration that builds the current
file with -d and runs it under netcoredbg, launching dotnet with the
program, which is a managed assembly rather than a native host. The
README says what a debugger shows today.

The check builds its options from Build.dependencyOptions, now that the
compiler's options have grown the dump flags.

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

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-16 09:35:25 +02:00
c6f357c6f8 A language server for Bjolang
Runs the compiler in-process against the Bjolang checkout beside it, and
answers diagnostics, an outline, go to definition, hover and completion,
plus a request of its own for macro expansion.

Diagnostics come from the compiler's own check of the editor's text,
saved or not: on open, on save, and 400 ms after typing pauses. The
outline, definitions, hovers and completions read only as far as the
reader, with no type checking, so they answer on every request: the
top-level names of the file, its imports and the prelude, local names
from the binding forms the parser knows, the declarations and docs as
written, and the builtins with their types. emacs/bjolang-lsp.el shows a
macro call's expansion, one step or all of it, in a buffer.

test/smoke.py drives the server as an editor would.

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

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-15 22:38:22 +02:00