-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
attemp to compare string with nil #81
Comments
If you are using lsp-installer you need to export the PATH |
another error: "E730: using List as a String"
echo $PATH
/Users/xxx/.local/share/nvim/lsp_servers/go:
/Users/xxx/.cargo/bin:
/usr/local/Caskroom/miniconda/base/envs/py39/bin:
/usr/local/Caskroom/miniconda/base/condabin:
/Users/xxx/.nvm/versions/node/v16.13.2/bin:
/Users/xxx/.jenv/shims:
/Users/xxx/.jenv/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/Users/xxx/go/bin gopls version
golang.org/x/tools/gopls v0.7.5
golang.org/x/tools/gopls@v0.7.5 h1:8Az52YwcFXTWPvrRomns1C0N+zlgTyyPKWvRazO9GG8= -- copy from https://github.com/ray-x/go.nvim#integrate-with-nvim-lsp-installer
local path = require 'nvim-lsp-installer.path'
local install_root_dir = path.concat { vim.fn.stdpath 'data', 'lsp_servers' }
require('go').setup {
gopls_cmd = { install_root_dir .. '/go/gopls' },
filstruct = 'gopls',
dap_debug = true,
dap_debug_gui = true,
} -- lsp-installer setup
...
elseif server.name == "gopls" then
-- require'go.lsp'
local go_lsp_opts = require'go.lsp'.config() -- config() return the go.nvim gopls setup
go_lsp_opts = vim.tbl_deep_extend("force", go_lsp_opts, opts)
server:setup(go_lsp_opts)
... git log --oneline
f599a5e (HEAD -> master, origin/master, origin/HEAD) gopls cmd fallback
ce29866 lsp installer path setup for version check
180e44a (grafted) handle nil |
I pushed another version to fix this issue. |
It looks ok now
structure# ~/.config/nvim/
.
├── ...
├── init.lua
├── lua
│ ├── ...
│ ├── go-setup.lua
│ ├── lsp-setup.lua
│ └── ...
└── ...
Aversion
problem
gopls(py39) xxx@xxx: ~ $ echo $PATH
/Users/xxx/.cargo/bin:
/usr/local/Caskroom/miniconda/base/envs/py39/bin:
/usr/local/Caskroom/miniconda/base/condabin:
/Users/xxx/.nvm/versions/node/v16.13.2/bin:
/Users/xxx/.jenv/shims:
/Users/xxx/.jenv/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/Users/xxx/go/bin (gopls) (py39) xxx@xxx: ~ $ gopls version
golang.org/x/tools/gopls master 👈 (that time : master??? not v0.7.5)
golang.org/x/tools/gopls@v0.7.5 h1:8Az52YwcFXTWPvrRomns1C0N+zlgTyyPKWvRazO9GG8= local v = vim.fn.system("gopls version"):match("%s+v([%d%.]+)%s+")
print(v) -- nil structureinit.luarequire 'go-setup'
require 'lsp-setup' go-setup.luarequire('go').setup({
goimport = 'gopls', -- if set to 'gopls' will use golsp format
gofmt = 'gopls', -- if set to gopls will use golsp format
max_line_len = 120,
tag_transform = false,
test_dir = '',
comment_placeholder = ' ',
lsp_cfg = false, -- false: use your own lspconfig
lsp_gofumpt = true, -- true: set default gofmt in gopls format to gofumpt
lsp_on_attach = true, -- use on_attach from go.nvim
dap_debug = true,
}) lsp-setup.lualocal lsp_installer = require 'nvim-lsp-installer'
lsp_installer.on_server_ready(function(server)
local opts = {
on_attach = on_attach,
capabilities = capabilities,
}
if language_servers[server.name] then
if server.name == ... then
-- config
-- ...
server:attach_buffers()
elseif server.name == "gopls" then
local go_lsp_opts = require'go.lsp'.config() -- config() return the go.nvim gopls setup
go_lsp_opts = vim.tbl_deep_extend("force", go_lsp_opts, opts)
server:setup(go_lsp_opts)
else
-- config
-- ...
server:setup(opts)
end
end
end) Bversionproblem
gopls(py39) xxx@xxx: ~ $ echo $PATH
/Users/xxx/.local/share/nvim/lsp_servers/go: (gopls)
/Users/xxx/.cargo/bin:
/usr/local/Caskroom/miniconda/base/envs/py39/bin:
/usr/local/Caskroom/miniconda/base/condabin:
/Users/xxx/.nvm/versions/node/v16.13.2/bin:
/Users/xxx/.jenv/shims:
/Users/xxx/.jenv/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/Users/xxx/go/bin (gopls) (py39) xxx@xxx: ~ $ gopls version
golang.org/x/tools/gopls v0.7.5
golang.org/x/tools/gopls@v0.7.5 h1:8Az52YwcFXTWPvrRomns1C0N+zlgTyyPKWvRazO9GG8= structureinit.luarequire 'go-setup'
require 'lsp-setup' go-setup.lualocal path = require 'nvim-lsp-installer.path'
local install_root_dir = path.concat { vim.fn.stdpath 'data', 'lsp_servers' }
require('go').setup {
gopls_cmd = { install_root_dir .. '/go/gopls' },
filstruct = 'gopls',
dap_debug = true,
dap_debug_gui = true,
} lsp-setup.lualocal lsp_installer = require 'nvim-lsp-installer'
lsp_installer.on_server_ready(function(server)
local opts = {
on_attach = on_attach,
capabilities = capabilities,
}
if language_servers[server.name] then
if server.name == ... then
-- config
-- ...
server:attach_buffers()
elseif server.name == "gopls" then
local go_lsp_opts = require'go.lsp'.config() -- config() return the go.nvim gopls setup
go_lsp_opts = vim.tbl_deep_extend("force", go_lsp_opts, opts)
server:setup(go_lsp_opts)
else
-- config
-- ...
server:setup(opts)
end
end
end) |
The text was updated successfully, but these errors were encountered: