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.
This commit is contained in:
Linus Björnstam 2026-11-03 14:45:55 +01:00
parent 29977ca301
commit 78d18c9854
6 changed files with 166 additions and 11 deletions

View file

@ -36,8 +36,12 @@ their own below; besides those, it does these:
`field` line. A builtin, which the compiler defines rather than a module,
shows its type and its doc from the prelude's docs. A local name shows
its binding as written, a typed parameter with its type, and what binds
it. A hover also shows the types the compiler inferred (see "Inferred
types").
it; when its type is a record, a struct or a union this file sees, the
type's definition and doc follow. A field read, the `.x` of `(.x r)`,
shows the field's type there, the field as its type declares it with its
doc line, and whose field it is. A hover also shows the types the
compiler inferred (see "Inferred types"), the file's own types by the
names it writes rather than module-qualified.
- Completion (`textDocument/completion`): the local names in scope, then
the top-level names of the file and of every module it sees, the
builtins, and the special forms, each name once and the nearest first. An