val-town / codemirror-ts

lint, hover, and autocomplete extensions for CodeMirror + TypeScript
https://val-town.github.io/codemirror-ts/
ISC License
137 stars 12 forks source link

Go to definition #8

Open tmcw opened 10 months ago

tmcw commented 10 months ago

CleanShot 2023-11-17 at 17 13 06@2x

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.

curran commented 9 months ago

Yes!

I'm also working on / interested in this

Related:

curran commented 5 months ago

Found the API for it

https://github.com/typescript-language-server/typescript-language-server/tree/b224b878652438bcdd639137a6b1d1a6630129e4?tab=readme-ov-file#go-to-source-definition

curran commented 5 months ago

The interaction in VSCode:

tmcw commented 5 months ago

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.