-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
Telescope lsp_definitions clashing with go.nvim first time it's called #434
Comments
Same error on github.com/DNLHC/glance.nvim. |
Same error here, quite annoying. Happens for each external dependency once, when I do a
|
@icefed Thanks, that seems to do the trick! |
I suggest using the LSP setup from go.nvim. As it turned on features that may not enabled by other LSP setup/plugins. |
Hi!
and @icefed method works(Thank you!)
I'm using lsp-zero. How to use go.nvim and lsp-zero at the same time? @ray-x |
I am not familar with lsp-zero require('go.lsp').config() And passing it to lsp-zero config require('lspconfig').gopls.setup(require('go.lsp').config()) |
Hello! I faced the same issue. I found that Line 52 in d748e79
Every time we open a new dependency, we open a new gopls instance.
seems like we have this call failing because we use wrong gopls. |
In my case problem was solved by this fix: #445 |
@i-vrnv How did you actually fix the issue? For me it still shows that error (but codeLens initially works, without errors), but then after using glance.nvim, ctrl-q to move the results to quickfix, and then browsing the result from quickfix, things start to break. It's interesting that |
I do not think default gopls setup from other plugins will enable all required gopls features of go.nvim. |
Right, I'm doing that, and everything actually works fine, but doing
I wonder if maybe there's an issue (in my config probably) in reattaching the LSP after opening a buffer without any LSP attached to it? |
I have the same issue as gcollura. I launch neovim, run Here's my config: require('mason-lspconfig').setup({
ensure_installed = {
'tsserver',
'eslint',
'rust_analyzer',
'gopls',
'tailwindcss',
'html',
'htmx',
'clangd',
'cssls',
'templ',
},
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({})
end,
gopls = function ()
require('lspconfig').gopls.setup(require('go.lsp').config())
end,
tailwindcss = function ()
require('lspconfig').tailwindcss.setup({
filetypes = { "templ", "javascript", "typescript", "react" },
init_options = { userLanguages = { templ = "html" } },
})
end,
},
}) edit: Also, it doesn't matter from where the quickfix was launched. I can grep into a quickfix buffer and the same error starts popping up. The behavior persists even after the quickfix window is closed. The codelens error persists until neovim is restarted. |
When opened file in quickfix, did gopls attach to the file just opened? You can check it with LspInfo |
It looks like it attached; though I know how to run LspInfo until after I dismiss the errors. |
If check the bufnr gopls and copilot attached. seems 1 and 51 were not attached. Not sure those are go files though. |
1 was the makefile, and 51 was the quickfix buffer. Here it is again. I opened neovim fresh, and ran
|
It works as expected when go.nvim is not installed or loaded (lazy.vim) however hen go.nvim is installed and loaded the first
telescope lsp_definitions
outside buffer yields the error under Actual Behaviour.Since the error complained about codelens I tried setting lsp_codelens to false and got this error instead
method textDocument/inlayHint is not supported by any of the servers registered for the current buffer
I'm relatively new to the world of neovim and custom configurations so something might be wrong with my configurations, however I thought it would still be worthwhile creating a new issue since there's a chance that might not be the case.
Expected behaviour
no error
Actual Behaviour
This is my
lsp_config.lua
if it's relevantThe text was updated successfully, but these errors were encountered: