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.
codeinterface 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's add the
collect_interface_methodshelper function afterget_instance_completions.Assistant
Need a blank line before
pub(crate) fn get_type_completions. Let's fix that.Assistant
Now let's check where
type_nameis imported in this file and build.Assistant
Build succeeds. Now let's check
detect_dot_contexthandles interface instance too - whenex.where ex is param of type Example (interface), doesexpression.get_type()return Nominal type properly resolving toExample? Let's write a small test/reproduce script using existing lsp test infra.Assistant
Let's look at the test module to understand testing infra and possibly write a manual test similar to existing ones for completion.
Assistant
Let's look at some interface completion tests to see expected behavior, e.g. line 5530 and 6337, 7841.
Assistant
Let's add a temporary test to tests/lsp.rs to reproduce (will remove after), or better write standalone script using cargo test with a filter. Let's create a temp test file appended, run it, then remove.
Assistant
I'll append a temporary test at the end of the file to reproduce the issue, run it, then remove before submitting.
Assistant
The fix works. Let's verify it fails without the fix (sanity check) by stashing changes temporarily.
Assistant
Confirmed the bug reproduces without the fix, and the fix resolves it. Now let's remove the temporary test and run the full lsp test suite to make sure nothing else breaks.
Assistant
Good, the temp test is removed. Now let's run the full lsp test suite plus the whole workspace tests.
Assistant
All 469 tests pass. Now let's run the full workspace test suite to be thorough.
Assistant
Good, these failures are pre-existing and unrelated to my change (likely missing
gotoolchain or something environment-specific). Let's clean up the generated.snap.newfiles that got created as untracked noise.Assistant
Good, only my intended change remains. Let's view the final diff for review.
Assistant
Let's find an example of interface embedding syntax in existing tests to get correct syntax.
Assistant
Now I understand the syntax:
interface I { impl A; }. Let's fix my test.Assistant
Both the direct interface method and inherited parent interface method completions work correctly. Now let's remove the temporary tests before submitting.
Assistant
Now let's also check
get_type_completionsdoesn't need similar treatment for interface static/type-level access (unlikely relevant, but let's check if interfaces support static methods - probably not, since interfaces only have instance methods). Let's verify the full test suite for lsp passes once more, and rebuild.Assistant
All 469 tests pass. Let's also run
cargo clippyon the lsp crate to catch any style issues (matching repo standards).Assistant
No clippy warnings. Let's do a final review of the diff and clean up any leftover build artifacts / snapshot noise.
Assistant
The diff is clean, containing only the source fix. Let's do a final full diff review.
Assistant
This looks complete and clean. Let's go through the checklist explicitly.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.