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
Good,
rustc_hashis available. Now add the helper function: - Assistant
Now let me check how interface types are represented —
type_namerecurses intounderlying_tyforNominaltypes, so I need to verify an interface'sNominaltype hasunderlying_ty: None: - Assistant
Embedding uses
impl Parentinside the interface body. Now add the tests: - Assistant
All three pass. Now run the full LSP test suite to check for regressions:
- Assistant
All 472 tests pass. Let me also verify the exact mid-typing scenario from the issue report (incomplete
ex.with nothing after the dot): - Assistant
Clean. Done — here's a summary of the fix:
Root cause
Interface method types are registered with the
selfreceiver stripped from their function signature (crates/semantics/src/checker/registration/methods.rs:327-355) — this is required so the interface-satisfaction checker can compare them against impl methods, which also have their receiver removed.However,
get_instance_completionsincrates/lsp/src/completion.rsdiscovered methods by scanning qualified names (Type.method) and checkingis_instance_method, which requires the first parameter's type to match the receiver type. Since interface methods have no receiver parameter, they never matched — soex.on an interface-typed value produced zero completions.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.