lite-xl / lite-xl-lsp

LSP Plugin for Lite XL editor
MIT License
158 stars 21 forks source link

Error on gopls start #43

Open yznts opened 1 year ago

yznts commented 1 year ago

LSP config:

local lspconfig = require "plugins.lsp.config"

...

lspconfig.gopls.setup {
  command = {
    "gopls"
  },
  settings = {
    Lua = {
      diagnostics = {
        enable = false
      }
    }
  },
  verbose = true
}
Screenshot 2022-12-28 at 11 31 06
yznts commented 1 year ago

Updated config with absolute gopls path, now getting this:

image
jgmdev commented 1 year ago

I think the issue is you are adding settings that are specifically for the lua language server:

lspconfig.gopls.setup {
  command = {
    "gopls"
  },
  -- settings = { -- these settings are for the lua language server not gopls
  --  Lua = {
  --    diagnostics = {
  --      enable = false
  --    }
  --  }
  -- },
  verbose = true
}

A simple setup call lspconfig.gopls.setup() should be enough to enable the go language server.

yznts commented 1 year ago

With a generic lspconfig.gopls.setup() I have this issue, that's why I've ended up with explicit args.

image
jgmdev commented 1 year ago

Could be that your gopls is not the direct binary but a bash/shell script that points to it which makes the lsp not properly detect the real process id of running lsp server. Try from terminal with which gopls to see the path of invoked gopls binary and then confirm it is the real gopls binary and not a shell script invoking it.

yznts commented 1 year ago

Right, it was a soft linked into /usr/local/bin/gopls as far as binary located in ~/go/bin and can't be located by editor.

Also, tried this approach:

lspconfig.gopls.setup {
  command = {
    "/Users/yuriizinets/go/bin/gopls"
  }
}

Getting this error

image
lin-calvin commented 1 year ago

pylsp and pyright meets the same error

Guldoman commented 6 months ago

Is this still an issue?