codemirror-ts
codemirror-ts copied to clipboard
Go to definition
Should already be possible given the data in the hint extension, but if people want to replicate this experience we should make that possible as well.
Yes!
I'm also working on / interested in this
Related:
- https://github.com/vizhub-core/vzcode/issues/201
- https://github.com/vizhub-core/vzcode/issues/177
Found the API for it
https://github.com/typescript-language-server/typescript-language-server/tree/b224b878652438bcdd639137a6b1d1a6630129e4?tab=readme-ov-file#go-to-source-definition
The interaction in VSCode:
- Hold CTRL
- Hover on a variable, it underlines if you can jump to its definition
- CTRL+Click to jump to definition
That's in the typescript-language-server project, which is a 3rd party adapter from the TypeScript interface to the LSP interface, because TypeScript doesn't actually implement LSP (which is a thing I rant about all the time, Microsoft get your act together, etc). This module currently uses TypeScript, but not the extra language server. It'd probably use the language server if this adopted more of a client-server architecture, or maybe it should in general, but for now, it's integrating with TypeScript, and we'll need to figure out what's under the hood of the LSP adapter's implementation.