[lsp-server] 🐞 definitions jump to the wrong project workspace
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
When using the "go-to" definition shortcut the LSP may direct to the incorrect workspace folder for definitions.
Expected Behavior
When using the "go-to" definition shortcut the LSP may should direct to definitions in the same workspace unless the schema directs somewhere else.
Steps To Reproduce
1. add two folders supporting separate `graphqlrc` definitions
2. create a scalar on the first folder schema definition
3. use the scalar in a Query on the second folder schema definition
4. use "go-to" on the second folder schema for the scalar
5. the "go-to" will result in jumping to the file in the first folder
Environment
- LSP Server Version: latest
- OS: Mac OS Ventura 13.4.1 (22F82)
- LSP Client: vscode
Anything else?
https://github.com/karloluis/gql_lsp-goto-workspace_bug
there are duplicates of this somewhere.
we are undergoing a rewrite where, amongst other things, the type caches will no longer overlap across projects
@karloluis are you using multi-root workspaces in vscode? because that will also be addressed in the rewrite
I had a lot of trouble finding an existing ticket and I've known about it for some time now. Feel free to close it with a reference to where we can track progress, even if its the full rewrite project as I'd be curious to test fixes on a early build.
@acao Any chance you can link the re-write project/issue?
the PR that fixes this will be merged this weekend hopefully! I now have a high level integration suite to prove it!
#3521
there will be a blog post soon about preparations for the rewrite, as you can see are well under way! luckily your bugfix wont have to wait for the rewrite. I'm pretty sure this is a one line bug, but there may have been multiple bugs at play here, but as you can see I've added a test case for this to that PR! I also check autocomplete because users have reported cross project bugs there as well