prabirshrestha / vim-lsp

async language server protocol plugin for vim and neovim
MIT License
3.13k stars 305 forks source link

pyright doesn't finish starting up #1472

Closed LachlanGray closed 1 year ago

LachlanGray commented 1 year ago

I have pyright set up to my liking, but LspStatus gives pyright: starting indefinitely. If I run pyright in watch mode in the command line with pyright -w file.py it reports quickly. I've configured pyright in vim-lsp to diagnose open files only, so it should be in the same ballpark. I'm wondering if there's something else I'm missing or if the behaviour is wrong.

here's how I'm registering it:

if executable('pyright')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pyright',
        \ 'cmd': {server_info->['pyright', '-w']},
        \ 'allowlist': ['python'],
        \ 'root_uri':{server_info->lsp#utils#path_to_uri(
        \  lsp#utils#find_nearest_parent_file_directory(
        \    lsp#utils#get_buffer_path(),
        \    ['setup.py', 'pyrightconfig.json', '.git/']
        \  ))},
        \ 'config': {
        \     'python': {
        \         'analysis': {
        \             'typeCheckingMode': 'basic',
        \             'diagnosticsMode': 'openFilesOnly',
        \             'diagnosticSeverityOverrides': {
        \                 'reportGeneralTypeIssues': 'warning',
        \                 'analyzeUnannotatedFunctions': 'warning',
        \                 'strictParameterNoneValue': 'warning',
        \                 'reportOptionalSubscript': 'warning',
        \                 'reportOptionalMemberAccess': 'warning',
        \                 'reportOptionalCall': 'warning',
        \                 'reportOptionalIterable': 'warning',
        \                 'reportOptionalContextManager': 'warning',
        \                 'reportOptionalOperand': 'warning',
        \                 'reportDeprecated': 'warning',
        \             },
        \         }
        \     }
        \ },
  \ })
endif

Is there something I forgot? Thanks!

LachlanGray commented 1 year ago

Ahah, I was running the wrong command. I had to use 'cmd': {server_info->['pyright-langserver', '--stdio']} instead