LSP doesn't provide completion for interfaces Lisette version: 0.2.11 IDE: VSCode and…
- User
LSP doesn't provide completion for interfaces Lisette version: 0.2.11 IDE: VSCode and Zed
The LSP isn't providing completions for interfaces from either stdlib or user-defined.
interface Example { fn example(self, name: string) -> string } fn example_call(ex: Example) -> string { ex. }Interface
No new interfaces are introduced.
- Assistant
Both pass. Let me verify these tests actually fail without the fix:
- Assistant
Fixed. All 471 LSP tests pass and clippy is clean.
Root cause
Interface methods are registered in the definition store with their
selfreceiver stripped (crates/semantics/src/checker/registration/methods.rs:334— the satisfaction checker requires both sides to omit the receiver). Butget_instance_completionsincrates/lsp/src/completion.rsdiscovered methods by scanning qualified names and filtering withis_instance_method(), which checks that the first parameter's type matches the receiver type. Since interface methods have no first parameter anymore, every interface method was filtered out — for both stdlib and user-defined interfaces.Fix
In
crates/lsp/src/completion.rs:get_instance_completionsnow recognizesDefinitionBody::Interfaceand collects completions from the interface definition's own map instead of the qualified-name scan.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.