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. }Interface
No new interfaces are introduced.
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
Let me start by exploring the repository structure to understand what we're working with.
Assistant
This is a Rust project. Let me explore the structure further.
Assistant
Let me look at how definitions and interfaces are structured.
Assistant
Now I understand the structure. The
Interfacedefinition has amethodsfield. Let me understand how interface methods are stored. Let me look at how interfaces are resolved - whether the methods are stored as separate definitions or in theInterfacestruct.Let me look at how
get_instance_completionsworks for interfaces. When we have a variable of an interface type, we want to complete with the interface's methods.Let me first check how the type is named for an interface. Let me look at
type_name.Assistant
Let me look at how interface methods are stored in definitions - are they separate definitions or only in the
Interface.methodsHashMap?Assistant
Let me look at how interface methods are stored. Let me search for where Interface definitions are built and where interface methods are added to definitions.
Assistant
Let me look at the store to understand how interfaces and their methods are accessed.
Assistant
Let me look at the satisfaction checker to see how it gathers all interface methods including parents.
Assistant
Let me look at
get_all_methods.Assistant
Let me look at
with_receiver_placeholderand the rest of get_all_methods.Assistant
Let me look at the snapshot to understand what's available in the LSP.
Assistant
Let me look at how completion is invoked from lib.rs.
Assistant
Let me look at the traversal.rs to understand
find_expression_at.Assistant
Let me check for existing completion tests.
Assistant
Let me build the project first.
Assistant
Now let me write a test to reproduce the issue.
Assistant
Now let me write a reproduction test to confirm the issue.
Assistant
The tests are in a separate package. Let me check the tests/Cargo.toml.
Assistant
Let me temporarily append the test to lsp.rs to run it.
Assistant
I've reproduced the issue. Now let me understand how parent interface types are represented and how to get their qualified names.
Assistant
I've reproduced the issue. Now let me look at the
Symboltype and how definitions are keyed.Assistant
Now I understand the issue. Let me implement the fix in
completion.rs. I'll modifyget_instance_completionsto handle interface types and add a helper to gather interface methods (including inherited from parents).Assistant
Let me check the Symbol type's Borrow implementation to understand how definitions are looked up.
Assistant
Now let me implement the fix. I'll modify
get_instance_completionsto handle interface types and add a helper for recursive method gathering.Assistant
Now let me build and run the reproduction test.
Assistant
The basic case works. Now let me test edge cases. Let me find stdlib interfaces to test with.
Assistant
Let me look at a simple stdlib interface to understand how they're defined and whether they have parents.
Assistant
Let me check how interface parents (embedding) are declared in Lisette.
Assistant
Let me find an interface that embeds parent interfaces to understand the syntax.
Assistant
Let me find the syntax for embedding parent interfaces in user code.
Assistant
The syntax for embedding parent interfaces is
impl ParentInterface. Let me write a comprehensive test covering inherited methods and shadowing.Assistant
Let me check the actual line numbers in the test file to verify positions.
Assistant
Let me rewrite the edge tests to compute cursor positions dynamically from the source string, eliminating guesswork.
Assistant
All edge cases pass. Now let me verify the stdlib interface case mentioned in the issue. Let me check how existing tests handle go: types.
Assistant
Let me check how go: stdlib interfaces are stored - whether they go through the same
Interfacebody.Assistant
Let me check how go: typedefs are embedded and whether they're available without a Go toolchain.
Assistant
Let me write a test for a stdlib go: interface to confirm the stdlib case from the issue.
Assistant
The stdlib case works. Let me also verify parent gathering for a go: interface that embeds parents. Let me find one.
Assistant
These go: interfaces don't seem to use
implembedding; they redeclare methods. Let me check thebufioorregexpones that hadimplinside. Actually thoseimpllines were probably impl blocks (struct methods), not interface parent embedding. Let me checkregexp.d.lis.Assistant
The parent-gathering is covered by my user-defined test. Now let me run the full existing LSP test suite to make sure nothing broke.
Assistant
All 474 tests pass. Let me run the broader test suite to be safe.
Assistant
Let me check whether these suite failures are pre-existing (unrelated to my change) by examining the failure type.
Assistant
These are
spec::buildtests that likely require a Go toolchain. Let me confirm they're pre-existing by stashing my changes.Assistant
The
spec::build/spec::emitfailures are pre-existing snapshot mismatches (they fail even with my changes stashed) — they're environment/Go-toolchain related and unrelated to my LSP-only change. Let me verify with one diff and clean up the generated artifacts.Assistant
These are pre-existing snapshot failures (Go-emission output depends on the Go toolchain) — they fail even with my changes stashed, confirming they're unrelated to my LSP-only change. Now let me clean up: revert
tests/lsp.rs, remove the stray repro test file and generated.snap.newartifacts.Assistant
Now the only change is
crates/lsp/src/completion.rs. Let me review the final diff.Assistant
The diff is clean. Let me rebuild and re-run the existing LSP test suite to confirm everything still passes, then do a final reproduction check.
Assistant
All 469 existing LSP tests pass. Let me do a final reproduction check with the exact example from the issue, plus the stdlib case.
Assistant
Both reproduction tests pass. Let me confirm the final repository state is clean.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.