lite-xl-lsp icon indicating copy to clipboard operation
lite-xl-lsp copied to clipboard

Error on gopls start

Open yznts opened this issue 2 years ago • 7 comments

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 avatar Dec 28 '22 10:12 yznts

Updated config with absolute gopls path, now getting this:

image

yznts avatar Dec 29 '22 08:12 yznts

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.

jgmdev avatar Jan 01 '23 16:01 jgmdev

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

image

yznts avatar Jan 02 '23 11:01 yznts

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.

jgmdev avatar Jan 02 '23 20:01 jgmdev

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

yznts avatar Jan 04 '23 09:01 yznts

pylsp and pyright meets the same error

lin-calvin avatar Jan 22 '23 13:01 lin-calvin

Is this still an issue?

Guldoman avatar Mar 21 '24 10:03 Guldoman