yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
473 stars 57 forks source link

pyright not working #490

Closed ydzhou closed 6 months ago

ydzhou commented 6 months ago

pyright is not working for my project... no autocompletion and LSP command not working but lspShowAllServers says my pyright is running

var lspServers = [
    {
        name: 'golang',
        filetype: ['go', 'gomod'],
        path: 'gopls',
        args: ['serve'],
        syncInit: true
    },
    {
        name: 'python',
        filetype: 'python',
        path: 'pyright-langserver',
        args: ['--stdio'],
    },
]
ydzhou commented 6 months ago

Found the issue. User error.

yegappan commented 6 months ago

Can you describe how you fixed the problem, so that it will be useful for others? Thanks.

ydzhou commented 6 months ago

You need to have pythonPath set.

sevehub commented 1 month ago

Could you indicate which version of Pyright you are using? I have tried version 1.1.378 without success. Additionally, it would be helpful to know whether you installed the npm or pip version of Pyright.

I am also curious about the role of the python.pythonPath in the initialization options. I don't see how adding it would make a difference in this context.

If you could share more details about how you resolved this issue, it would be useful for both me and the project.