Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Lsp server terminated immediately after launch #145

Open
hek14 opened this issue Oct 22, 2024 · 1 comment
Open

[BUG] Lsp server terminated immediately after launch #145

hek14 opened this issue Oct 22, 2024 · 1 comment

Comments

@hek14
Copy link

hek14 commented Oct 22, 2024

I am tyring to use distant.nvim for remote work. It is a really nice plugin. But there is an issue in my setup: after I DistantOpen /path/to/server/file.py, I can see some diagnostic show up but the server is terminated quickly, I check the distant.log, which says that ".../nvim-data/lazy/distant.nvim/lua/distant-core/client.lua:195: Client terminated: "INVALID_SERVER_JSON"".

commands that I use:

  • DistantLaunch ssh://USER@SERVER_IP:PORT
  • DistantOpen /path/to/server/file.py

Related:

  • platform: I have tried on windows/mac as local machine, and linux as remote machine. Both has the same issue.
  • distant version: 0.20.0, I also tried 0.20.0-alpha.10, the same issue.
  • distant.nvim version: v0.3
  • lsp server: pyright/clangd (both of them failed with the same problem)
  • distant.nvim config:
            require('distant'):setup(
              {
                  servers = {
                      ['SERVER_IP'] = {
                          lsp = {
                              ['/home/project'] = {
                                  -- cmd = {'/usr/bin/pyright-langserver', '--stdio'}, -- I have tried both of the two "cmd"
                                  cmd = '/usr/bin/pyright-langserver --stdio',
                                  root_dir = '/home/project/',
                                  settings = {
                                      {
                                          python = {
                                              analysis = {
                                                  autoSearchPaths = true,
                                                  diagnosticMode = "openFilesOnly",
                                                  useLibraryCodeForTypes = true
                                              }
                                          }
                                      }
                                  },
                                  single_file_support = true,
                                  file_types = {'python'},
                                  on_exit = function(code, signal, client_id)
                                      local prefix = '[Client ' .. tostring(client_id) .. ']'
                                      print(prefix .. ' LSP exited with code ' .. tostring(code))

                                      -- Signal can be nil
                                      if signal ~= nil then
                                          print(prefix .. ' Signal ' .. tostring(signal))
                                      end
                                  end,
                              }
                          }
                      }
                  }
              } 
             )
@GeordyJ
Copy link

GeordyJ commented Oct 25, 2024

I also have the same issue for python as well, I also tried the "fix/AddCheckForFailingToStartLspClient" which results in no LSP client being attached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants