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
Builds. Now let me check the prelude for a stdlib interface to test against, and add tests:
- Assistant
Now I'll add tests. Inserting after
completion_enum_dot_shows_tuple_variants: - Assistant
Done. All 472 LSP tests pass (including the 3 new ones), and clippy is clean.
Root cause
Interface methods are registered in the definitions store with the
selfreceiver stripped from their function type (crates/semantics/src/checker/registration/methods.rs:327-355— both sides of the satisfaction check omit the receiver). The LSP'sget_instance_completionsonly recognized methods viais_instance_method, which checks that the first parameter's type matches the receiver type — so interface methods never matched and were silently filtered out. Struct fields and structimplmethods worked; interfaces returned nothing.Fix
crates/lsp/src/completion.rs:get_instance_completionsnow handlesDefinitionBody::Interface: methods are collected from the interface definition body itself (), where their signatures live.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.