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 let me confirm the bug with a test. First check how interface embedding syntax looks:
- Assistant
Now I'll add failing tests, then implement the fix:
- Assistant
The embedded test had a wrong line number (dot is on line 12, not 11):
- Assistant
Now implement the fix. First check
get_qualified_id/get_qualified_nameonType: - Assistant
The
errorinterface's method isError(Go-style), noterror. Let me verify in the prelude: - Assistant
The prelude
errorinterface's method isError() -> string— the completion["Error"]is correct. Fix the test's expectation: - Assistant
All 473 LSP tests pass. Run clippy and fmt:
- Assistant
Fixed. Interface completions were missing because
get_instance_completionsonly knew two method sources, and interfaces fit neither:Root cause (
crates/lsp/src/completion.rs): instance completions came from struct fields plus a scan forTypeId.methoddefinitions whose first parameter is the receiver type. Interface methods are registered with theselfreceiver stripped (the satisfaction checker compares receiver-less signatures — seepopulate_interfaceincrates/semantics/src/checker/registration/methods.rs:327), sois_instance_methodrejected every one of them and the completion list came back empty.Fix:
get_instance_completionsnow recognizesDefinitionBody::Interfaceand collects methods from theInterfacedefinition itself via a newcollect_interface_method_completionshelper (), which also:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.