Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript.preferGoToSourceDefinition #449

Closed
preslavmihaylov opened this issue Jan 24, 2024 · 4 comments · Fixed by #450
Closed

typescript.preferGoToSourceDefinition #449

preslavmihaylov opened this issue Jan 24, 2024 · 4 comments · Fixed by #450

Comments

@preslavmihaylov
Copy link

Is there a setting in coc-tsserver which acts the same way vscode's typescript.preferTGoToSourceDefinition does?

Without this, working in a monorepo which relies on typechecking via declaration files vs implementation breaks the functionality for going into a func implementation
https://twitter.com/kamilogorek/status/1735947897986769136

@fannheyward
Copy link
Member

fannheyward commented Jan 25, 2024

coc-tsserver already supports tsserver.goToSourceDefinition command #384.

You can add custom mapping for TS file only:

autocmd FileType typescript nnoremap <buffer><silent> gd :CocCommand tsserver.goToSourceDefinition<CR>

@fannheyward
Copy link
Member

This feature has been released in coc-tsserver-dev, try :CocUninstall coc-tsserver and :CocInstall coc-tsserver-dev.

Note: coc-tsserver-dev is only used for unmerged PRs, and after PR merged into coc-tsserver, you should use coc-tsserver instead.

@preslavmihaylov
Copy link
Author

Nice, thank you!

@fabOnReact
Copy link
Contributor

fabOnReact commented Jul 31, 2024

go to the definition does not work with libraries like React.js

microsoft/TypeScript#37777 (comment)

Screen.Recording.2024-07-31.at.1.41.18.PM.mov

for example, I can not navigate the source code implementation of useRef. It is minified.
#384
microsoft/TypeScript#37777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants