neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.05k stars 68 forks source link

goToSourceDefinition: skip preview if only one definition #417

Closed rsslldnphy closed 1 year ago

rsslldnphy commented 1 year ago

Hi - opening this as a half PR/half question, as I haven't figured out yet how to test this myself.

Is it possible to change the goToSourceDefinition command to go directly to the definition if only one is found, rather than showing a list (of one) to choose from? There's some commented out code in the file which suggests there is, but I'm not sure why it was commented out.

This PR comments it back in - however as I've said I haven't figured out how to test it. If you could tell me what I need to put in my init.vim to point to my branch then I will test it and report back. Currently I have Plug 'neoclide/coc.nvim', {'branch': 'release'} in my init.vim but nothing as far as I can see that points explicitly at coc-tsserver.

Thanks!

chemzqm commented 1 year ago

vscode.open not work as expected for file uri, I will fix it.