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-member completion through the project’s existing test harness or a temporary script, implement the narrowest general fix, and run affected plus broader tests.
- Assistant
The LSP has dedicated completion helpers and an integration test harness. I’ll inspect those helpers alongside the semantic definition model and current completion tests to determine whether interfaces are absent from the stored definitions or merely filtered during member lookup.
- Assistant
get_instance_completionscurrently only adds struct fields and separately registered value definitions whose first argument is the receiver type. Interface declarations instead retain method signatures insideDefinitionBody::Interface, so they never enter either branch. I’ll verify the interface representation (including inherited methods, visibility, and generic substitution expectations) and inspect all existing completion assertions before changing the helper. - Assistant
The registration code confirms why interface methods are missed even though they also have qualified value entries: their stored function signatures deliberately omit
self, sois_instance_methodrejects them. The interface body has its ownmethodsplus parent interface types. I’ll examine type structures and interface-satisfaction traversal so completion can mirror language semantics, including inherited and generic parent methods without duplicate labels or recursion loops. - Assistant
Interface types are intentionally excluded from type-level completion (
is_type_definition), but instance completion still receives the nominal interface ID from the typed expression. A robust fix belongs inget_instance_completions: collect interface body methods recursively through parents, use the method signature as detail, and prevent duplicate/cyclic inherited entries. Before editing, I’ll reproduce the exact report with the integration client and inspect the nearby dot-completion tests/harness conventions. - Assistant
The semantic store already defines the desired behavior in
get_all_methods: substitute generic arguments, add receiver placeholders, and recurse into parents. The LSP snapshot exposes only definitions rather thanStore, so I’ll implement the equivalent read-only traversal locally. First I’ll launch the actual LSP over stdio with a temporary Python JSON-RPC client (outside the repository) to capture the pre-fix completion result for the reported source. - Assistant
Compilation is ready. The test harness embeds the server rather than exposing a standalone test utility, while the CLI provides a standard stdio LSP binary. I’ll build that binary and use a short
/tmpclient to initialize, open the exact interface source, request completion atex., and print labels; no repository test files will be changed. - Assistant
The CLI package name is
lisette(not its directory name), so the chained command stopped before creating the client. I’ll rerun with the correct package selector. - Assistant
The reproduction returns an empty completion array exactly as reported. I’ll now add interface-method collection to the instance helper. The traversal will:
- include methods declared directly on the interface,
- recurse through embedded parent interfaces,
- deduplicate method labels,
- guard against cycles defensively,
- preserve existing struct-field and concrete-method behavior.
Method visibility needs no per-method filter because Lisette interface methods inherit the interface’s visibility, as documented in registration; once an interface value is in scope, all of its required methods are callable.
- Assistant
The implementation compiles cleanly. I’ll rebuild the executable and rerun the exact same client to confirm the reported case. Then I’ll extend only the temporary reproduction source to exercise inheritance and duplicate suppression, and run the existing LSP suite.
- Assistant
The exact reproduction now returns
exampleas a method with its function signature, and all 48 completion-related integration tests pass. I’ll inspect parser fixtures for interface embedding syntax, then use the temporary client for own + inherited methods. I’ll also check stdlib interface definitions and test one representative stdlib interface through the same LSP path, since the report explicitly mentions both sources. - Assistant
Embedding uses
impl Parentinside the interface. For stdlib,net.Addris a clear public interface; I’ll inspect its signatures and import examples, then parameterize the temporary script for two extra requests: an inherited user interface and a stdlib interface parameter. - Assistant
Project sources do not show a direct
netimport example, but Lisette’s stdlib module syntax isimport "net"while raw Go namespaces usego:. I’ll run both temporary cases and inspect returned labels. - Assistant
The inherited request accidentally targeted the function declaration line (hence top-level suggestions); I’ll correct it to the dot line. The standalone server initialized without a workspace did parse
net.Addrbut returned no labels; that could indicate either unresolved stdlib loading in this setup or a qualified-name mismatch, so I’ll first validate inheritance and then inspect snapshot/module qualification behavior for external typedefs before drawing a conclusion. - Assistant
Inherited completion works, returning exactly
ownandinherited. The typedef modules are Go modules, and the existing test demonstrates they must be imported asgo:...; my temporary stdlib case used the wrong import form. I’ll correct it togo:net, rerun, then execute the full LSP integration suite and lint/format checks. - Assistant
The corrected stdlib reproduction returns
NetworkandString, confirming the fix covers both user-defined and stdlib interfaces. The full 469-test LSP suite passes, as does Clippy with warnings denied. I’ll do a final review of the diff, run formatting verification, and inspect status to ensure only the intended source file is changed and no temporary 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 →
- gpt-5.6-solCompare side by side →