Nimblesite / Nimblesite/SharpLsp
F#: completion auto-`open` insertion (FSAC parity) needs an unopened-symbol entity index
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 132
- Forks
- 5
- Avg merge
- 6h 24m
- Merged PRs (30d)
- 27
Description
Gap
Ionide/FSAC offer auto-`open` on completion: accepting a completion for a type/value in a not-yet-opened namespace inserts the corresponding `open` directive (via `completionItem/resolve` → `additionalTextEdits`). SharpLsp's F# `completionItem/resolve` currently returns no edits.
This is tracked as item 11 in docs/plans/FSHARP-FSAC-PARITY-PLAN.md and as the `[FS-COMPLETION-RESOLVE]` follow-up in docs/plans/FSHARP-FEATURES-PLAN.md.
Why it's not a one-liner
The blocker is upstream of resolve: FSharpCompletion.getCompletions calls
checkResults.GetDeclarationListInfo(..., getAllEntities = fun () -> []) with an empty entity provider. With no entities, FCS never surfaces completion items for symbols in unopened namespaces, so DeclarationListItem.NamespaceToOpen is always None and there is nothing to auto-open.
Real auto-open requires:
- An assembly-content / entity index (FSAC's
AssemblyContentProvider) built from the project's referenced assemblies + the current file's symbols, fed intogetAllEntitiesso unopened-namespace items appear in the list with a populatedNamespaceToOpen. - A per-file resolve cache mapping the completion item index → the
open-insertionTextEdit, computed at completion time withParsedInput.FindNearestPointToInsertOpenDeclaration+ParsedInput.AdjustInsertionPoint. The Rust host'scompletionItem/resolvealready mapsAdditionalEdits→additionalTextEdits(src/semantic.rs), so once the sidecar returns edits it just works end-to-end.
Scope
Self-contained but non-trivial (entity index has its own caching/perf characteristics). Wire contract (CompletionResolveResultWire.AdditionalEdits) already exists.
Related parity work just landed: remove-unused-open / simplify-name code fixes ([FS-CODEFIX-*]) and F# workspace/symbol ([FS-WORKSPACE-SYMBOL]).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with FSharpCompletion.getCompletions and its getAllEntities provider, then inspect the AdditionalEdits mapping in src/semantic.rs and the referenced parity plans. Build the entity index and per-file resolve cache described in the issue, and verify that completionItem/resolve returns the open-insertion edit for symbols from unopened namespaces.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp, rust
- Domain
- developer-experience, devtools, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100