ISSUE DESCRIPTION LSP doesn't provide completion for interfaces Lisette version: 0.2.11…
- User
ISSUE DESCRIPTION
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.
interface Example { fn example(self, name: string) -> string } fn example_call(ex: Example) -> string { ex. }ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /lisette, current file: none) bash-$
- Assistant
I’ll first map the repository and locate the LSP completion/type-resolution code and relevant tests. Then I’ll reproduce the missing interface completion, trace the concrete/interface handling difference, make the smallest general fix, and run focused plus broader tests.
- Assistant
This is a Rust workspace with an integration LSP harness. I’ll now identify completion handlers and existing member-completion fixtures so the reproduction follows established conventions rather than inventing a separate path.
- Assistant
ripgrepis unavailable, so I’ll use recursivegrep. The likely implementation is isolated incrates/lsp/src/completion.rs; I’ll inspect it alongside completion tests and semantic type facts. - Assistant
The completion module already classifies interface definitions globally, so the failure is specifically member lookup. I’ll inspect
resolve_variable_type, instance member collection, snapshot indexes, and the request dispatch around dot contexts to see where interface method definitions are excluded. - Assistant
get_instance_completionsonly discovers methods encoded as qualifiedValuedefinitions (Type.method). Interface methods are likely stored insideDefinitionBody::Interface, not as separate values, explaining both user and stdlib failures. I’ll verify the program representation and how hover/goto-definition traverse interface members, then reproduce with a temporary focused integration test (without modifying repository tests). - Assistant
The representation confirms an interface owns a
methods: HashMap<name, Type>, and member completion never reads it. Before editing, I need account for inherited interface methods (parents) and visibility semantics, since a robust fix should expose the full interface contract rather than only direct declarations. I’ll inspect the definition and store APIs plus registration logic that merges inherited methods. - Assistant
Interfaces are deliberately excluded from
is_type_definition, but that only affectsInterfaceName.static completion. Forex., the inferred nominal type should still producemain.Example; the missing branch in instance collection is sufficient to explain the report. I’ll still run an end-to-end reproduction through the public LSP server by creating a disposable crate under/tmpthat reuses the repository’s test harness, avoiding any test-file changes. - Assistant
The public harness can drive the exact request. I’ll build the disposable crate with one executable that opens the issue’s source and prints completion labels at the cursor after
ex.. This establishes the pre-fix behavior independently of internal assumptions. - Assistant
The exact issue reproduces as an empty label list. The fix should add interface-owned method signatures before scanning concrete impl methods. Since interface method maps include inherited methods only indirectly via
parents, I’ll implement cycle-safe recursive collection (matching semantic inheritance behavior), deduplicate names, and preserve type details. Interface methods do not have per-method visibility; access is governed by whether the interface type itself is available, and the request already resolved that type. - Assistant
A key detail emerges: direct interface signatures are also registered as qualified
Valueentries, but the existing scan rejects them viais_instance_method. I’ll inspect their registered type transformation. If interface signatures intentionally omit/transform the receiver, readingInterface.methodsis the correct source and avoids weakening concrete static-vs-instance filtering. - Assistant
Registration strips the bare
selfreceiver from interface method types so interface satisfaction compares callable signatures; thereforeis_instance_methodcorrectly rejects these entries. I’ll add a dedicated interface-contract collector that handles direct and embedded parent methods, guards cycles, and deduplicates overridden names. Concrete method behavior remains unchanged. - Assistant
The issue source now returns
["example"]. I’ll exercise two edge cases through the same disposable end-to-end client: inherited interface methods (including override deduplication), and a Go stdlib interface parameter. Then I’ll run the focused LSP integration suite and workspace checks. - Assistant
Interface embedding uses
impl Parentinside the interface body. I’ll update only the/tmpreproduction executable to make three sequential LSP sessions and assert exact required labels; import syntax will be taken from existing LSP tests. - Assistant
The stdlib confirms another reason the old receiver heuristic cannot work: Go typedef interface methods omit
selfentirely. I’ll validate a local embedded interface andgo:io.Readercompletion now. - Assistant
All three end-to-end cases pass, including stdlib and inherited methods with override deduplication. I’ll now run the complete LSP integration test target; this is the most affected suite and catches regressions in struct, enum, slice, and cross-module completion behavior.
- Assistant
All 469 LSP integration tests pass. I’ll perform formatting verification, compile the full workspace, and run Clippy on the changed crate. I’ll also inspect the final diff/status to ensure only the intended source file is submitted and no temporary reproduction artifacts entered the repository.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →