graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

[lsp-server] 🐞 definitions jump to the wrong project workspace

Open karloluis opened this issue 2 years ago • 7 comments

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

karloluis avatar Jul 03 '23 12:07 karloluis

there are duplicates of this somewhere.

we are undergoing a rewrite where, amongst other things, the type caches will no longer overlap across projects

acao avatar Jul 05 '23 16:07 acao

@karloluis are you using multi-root workspaces in vscode? because that will also be addressed in the rewrite

acao avatar Jul 05 '23 16:07 acao

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.

karloluis avatar Jul 06 '23 13:07 karloluis

@acao Any chance you can link the re-write project/issue?

karloluis avatar Mar 01 '24 00:03 karloluis

the PR that fixes this will be merged this weekend hopefully! I now have a high level integration suite to prove it!

acao avatar Mar 01 '24 08:03 acao

#3521

acao avatar Mar 01 '24 08:03 acao

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

acao avatar Mar 01 '24 08:03 acao