neoclide/coc-tsserver

typescript.preferGoToSourceDefinition

preslavmihaylov opened this issue · 3 comments

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

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>

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!