Skip to content

LSP: generate stdlib completion + hover from lib/ signature comments #590

Description

@InauguralPhysicist

Follow-on from the STDLIB discoverability audit (docs/STDLIB.md coverage pass, 2026-07-13).

Why. handle_completion/handle_hover in src/eigenlsp.c advertise the compiled-in builtin_docs[] table and document-local symbols, but the ~75-module pure-EigenScript lib/ layer (808 public functions) is invisible to completion and hover. A user typing stats. gets nothing, so the language server does not help avoid the exact hand-roll failures the docs pass is fighting: DeslanStudio re-implemented _pr_median/_pr_mean while lib/stats.eigs shipped both; hex4/pad2 were hand-rolled twice.

What. A build-time (or first-run) generator that scrapes lib/*.eigs for public (define name(params)) definitions plus their # name of args -> type signature comment, emitting a table the LSP can serve as import-aware completion items (kind 3, Function) and hover detail. The signature-comment convention (docs/STDLIB.md "Writing Library Functions" rule 2) is the natural source; the same audit surfaced ~200 public functions whose signature comment is missing — those should be back-filled so the generated hover is accurate (tracked in the STDLIB.md "Signature-comment coverage" note).

Scope note. Ideally completion is scoped to what the file has imported (a stats. prefix offers stats.*), reusing the existing import-symbol tracking.

Acceptance. Typing a module prefix after an import offers that module’s public functions with their signature as detail; hover over a lib/ call shows its signature comment. Grounded in the repeated downstream hand-roll evidence.

Source: 2026-07-13 stdlib discoverability audit (DX/docs).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions