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
I'll investigate how the Lisette LSP handles completions for interfaces and trace why they're missing for both stdlib and user-defined types.
- Assistant
Running a quick test to confirm the bug, then implementing the fix.
- Assistant
The bug was in
get_instance_completions: it only handled struct fields and impl methods, not interface methods.Interface methods are stored on the
Interfacedefinition itself, and their registered function types omit theselfreceiver. The existingis_instance_methodcheck looks for a first parameter matching the type, so it never matched interface methods.Fix
In
crates/lsp/src/completion.rs, addedcollect_interface_methodsthat:- Reads methods from the
Interfacedefinition - Recursively includes methods from embedded parent interfaces
192:248:crates/lsp/src/completion.rs - Reads methods from the
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.