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.
codeinterface Example { fn example(self, name: string) -> string } fn example_call(ex: Example) -> string { ex. }Interface
No new interfaces are introduced.
- Assistant
Now add the helper function:
- Assistant
Compiles. Now add tests mirroring the reported repro:
- Assistant
Fixed. All 472 LSP tests pass, clippy is clean.
Root cause
get_instance_completionsincrates/lsp/src/completion.rsonly knew two sources of members:- Struct fields — matched via
DefinitionBody::Struct, so interfaces got nothing here. - Methods — scanned qualified
Type.methoddefinitions, gated byis_instance_method, which checks whether the method's first parameter is the receiver type. But interface method signatures have theirselfreceiver stripped at registration (crates/semantics/src/checker/registration/methods.rs:327-352— required so satisfaction checking lines up with on impl side). So every interface method failed the receiver check and was filtered out, for both stdlib and user-defined interfaces.
- Struct fields — matched via
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.