natebosch / vim-lsc

A vim plugin for communicating with a language server
BSD 3-Clause "New" or "Revised" License
693 stars 79 forks source link

pyright and Viewing Source Code Definition #430

Open ossie-git opened 3 years ago

ossie-git commented 3 years ago

Hi,

I'm currently trying to set up vim-lsc to use pyright. It works out of the box by simply:

installing it (it requires Node.js 12+):

npm install -g pyright

and then adding the following:

let g:lsc_server_commands = { 'python' : 'pyright-langserver --stdio'}

However, a problem I've run into is that instead of taking me to the corresponding source code when I ask to Go-to-Definition, it takes me to the typeshed definition (pyi). This behavior is mentioned here - and elsewhere but from the link, it says that VSCode shows both hits and you can select which one you want. Is there any option to configure this in vim-lsc and have it provide me with an option to select one of them (or to always prefer one)? Thanks

smekkley commented 2 years ago

jedi-language-server works better. I never got pyright work correctly and vscode uses pylance and it's closed source, you never know what kind of patches are in there.