Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>RTK Query NavigationNew to Visual Studio Code? Get it now.
RTK Query Navigation

RTK Query Navigation

codeandstuff

|
6 installs
| (1) | Free
Improved go to definition in RTK Query
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

RTK Query Navigation

When working with RTK Query it is slight annoying when you run "go to definition" on your useGetStuffQuery and you just find yourself at the export of the query, instead of the implementation. This extension fixes so the "go to definition" actually goes to the implementation of the API call.

The extension loads a typescript server plugin that actually patches the "go to definition" call. This should result in a performant and smooth experience.

The logic is quite simple: When "go to definition" is launched, check if target is a function that matches RKT naming. Then after the target is resolved, search the target file for a function without the use(lazy) and Query/Mutation part.

If the logic fails in some scenario, please create an issue and I'll have a look at it. PR:s are also welcome

Development

Getting the new version of the plugin into the extension is a mess. When building we must use a tarball as dependency, and then the hash of the file is saved in the lockfile and aggressively cached. We must use tarball since "normal" install ends up being a symlink that VSIX dont support. And currently npm10 have issues with not symlinking dependencies.

The whole build-process feels quite fragile, and I wonder if it will break if we include other dependencies. If so, make sure to dig into the .vscodeignore file.

I have now added a script "compile-and-load-plugin" that should always succeed in inserting the latest version of the plugin into the extension. Just run it and F5 in vscode to test it.

Another thing of note: You can add "console.log()" stuff in the plugin. But then you have to run "Open TS Server log" to actually see the log.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft