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
Now let me apply this using the edit command properly with heredoc syntax as documented:
Assistant
Now let's add the
collect_interface_method_completionshelper function. Let's place it right afterget_instance_completions.Assistant
Good, that confirms
.get(type_id)with&strworks via Borrow. Now let's insert the helper function.Assistant
Need blank line before
pub(crate) fn get_type_completions. Let me fix that.Assistant
Build succeeds. Now let's check how
get_instance_completionsis invoked, and thedetect_dot_contextfunction to ensure interfaces work end to end. Let's look at whereget_instance_completionsis used inlib.rs.Assistant
Let's check the existing lsp test file to understand test patterns and possibly add a manual reproduction test.
Assistant
Let's create a temp test module file to reproduce the issue, run it, then remove it.
Assistant
The fix works. Now let's remove the temporary test and run the full existing test suite to make sure nothing broke.
Assistant
Good, temp test removed and file restored to original state (verify with git diff).
Assistant
Now let's run the full lsp test suite to ensure nothing broke.
Assistant
All 469 tests pass. Now let's also run the full test suite (suite + e2e_suite) to be thorough, and check other crates for warnings/errors.
Assistant
Confirmed these failures are pre-existing and unrelated to our change (likely missing Go toolchain in this environment). Let's restore our changes.
Assistant
These pre-existing failures are unrelated (snapshot mismatches, likely due to environment/versions), confirmed by the baseline having identical failures. Let's clean up the generated
.snap.newfiles since we shouldn't leave stray artifacts.Assistant
Now let's specifically run the semantics and lsp test suites (the ones relevant to our change) to make sure they pass cleanly.
Assistant
All relevant tests pass. Now let's review the final diff.
Assistant
Stdlib interface completion also works now. Let's clean up the temp test and restore lsp.rs.
Assistant
Now let's also test interface embedding (parent interfaces) to make sure inherited methods show up.
Assistant
Now I understand the syntax. Let's fix my test.
Assistant
Excellent! Interface embedding (parent interfaces) also works correctly. Now let's clean up and restore the test file.
Assistant
Let's do a final full review of the diff and run the lsp test suite one more time to be safe.
Assistant
The fix is complete, minimal, and verified. Let me clean up any stray artifacts before finalizing.
Assistant
Clean. Now let me go through the checklist.
Checklist Review
-
[x] If an error was reported in the issue description, I have successfully reproduced it. I traced through the code and confirmed that only looked at fields and at definitions matching the heuristic (first param type == receiver type). Interface methods are stored differently: inside as with the receiver already stripped (and a separate definition is registered under purely for go_hints lookup, whose type also has stripped, so never matched it). I verified this by writing a temporary test reproducing the exact snippet from the issue () and confirmed it failed to list before my fix.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.