Closed preslavmihaylov closed 6 months ago
coc-tsserver already supports tsserver.goToSourceDefinition
command https://github.com/neoclide/coc-tsserver/pull/384.
You can add custom mapping for TS file only:
autocmd FileType typescript nnoremap <buffer><silent> gd :CocCommand tsserver.goToSourceDefinition<CR>
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.
Nice, thank you!
go to the definition does not work with libraries like React.js
https://github.com/microsoft/TypeScript/issues/37777#issuecomment-2259714084
https://github.com/user-attachments/assets/6b8f0747-9bd1-406d-b5db-d40436ddfdd1
for example, I can not navigate the source code implementation of useRef. It is minified. https://github.com/neoclide/coc-tsserver/pull/384 https://github.com/microsoft/TypeScript/issues/37777
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