Repository navigation
Closed
Description
Background
ephapax-lsp::collect_decl_symbols (or equivalent — src/ephapax-lsp/src/main.rs around lines 540–550) returns None for two Decl variants when building the symbol list:
Decl::Extern { .. } => None— TODO comment references the now-closed Implement v2 grammar (module/import/extern/data/match/let!) in Rust + Idris2 parsers #43 phase 2B work, but extern items are otherwise wired up: the typechecker registers their signatures, the wasm backend emits(import ...)directives, and tests cover both. Only the LSP symbol path is missing.Decl::Data { .. } => None— TODO comment references a "v2 grammar follow-up: promote data decls to Decl::Data variant #60 follow-up" but no successor issue exists. Surface-pipeline data decls reach the LSP via the desugar registry, but the core-parser path that constructsDecl::Datadirectly is not indexed.
Both gaps mean hover, go-to-definition, and outline don't surface extern functions or data-type constructors in editors using the compiler-integrated LSP.
What's needed
- Add LSP symbols for every
ExternItem::Fn { name, params, ret, .. }inDecl::Extern { abi, items }. Symbol kindFunction, withsignatureshowing the declaredparams → ret, plus theabias part of the documentation/detail. - Add an LSP symbol for
Decl::Data { name, type_params, constructors }(kind:ClassorEnum), and one nested symbol perConstructorDef(kind:EnumMember). - Update the surrounding
DeclKindenum (or whatever drives the symbol kind dispatch) to carry these.
Acceptance
gh code-search-equivalent: hovering overSomein a test file shows theOption(a)data type + ctor signature.- Go-to-definition on a call to an
extern fnjumps to theexternblock declaration site. - Document outline (
textDocument/documentSymbol) lists every extern fn and data ctor.
Notes
- The standalone heuristic LSP at
tools/ephapax-lsp/has its own TODOs for hover/definition/symbols — those are intentional stubs (documented in the module header) and out of scope here. - Also clean up the stale
TODO(ephapax#43 phase 2B)comments at the same time. The wasm/typing comments are already obsolete (the work landed in feat(wasm): emit extern fn imports + direct calls (clean v2 — replaces #56) #58); just update or delete them as part of this PR.
Metadata
Metadata
Assignees
Labels
No labels
Activity
lsp: extern + data symbols; clear stale TODOs (#75) (#76)