Closed JamesTiberiusKirk closed 11 months ago
What did you do just to cause unknown directive: toolchain
to show up?
What is the value of the go
directive in the relevant go.mod
file?
@bhcleek
This is the relavant line:
toolchain go1.21.0
But as I said, in vscoded for example this does not kick up a fuss at all.
Running the tests in the project is no issue either.
I'm not sure what operation caused this error. I'll need to know that to help you more. I'll also need the output of :messages
after the error appears.
What do you mean by operation? I just opened the nvim in the root directory of the project, and opening any go (and related) file gets the lsp going and it complains about this error.
this is the output of :messages
(the error itself is displayed by trouble.nvim)
vim-go: initializing gopls
vim-go: initialized gopls
vim-go: Finished loading packages.
"~/path/to/go.mod" 122L, 6001B
"go.mod" 124L, 6021B
sorry if this is not vim-go related but this is the only place i could figure to ask because ive seen similar questions being asked.
Can you add let g:go_debug=['lsp']
to your vimrc, duplicate the error (you'll likely have to restart Vim), and paste the contents of the __GOLSP_LOG__
window here?
trouble.nvim
seems to be about Neovim's LSP, and not about vim-go or its use of gopls
. I suspect you may have two versions of gopls
installed. Vim-go and Neovim's LSP may be using different binaries, and the one used by Neovim's LSP is old if that's the case.
Can you please search your system to see how many instances of gopls
are on it?
Also, given that it appears this may not be vim-go related, we can be certain by alternately using only one of Neovim's LSP or vim-go. Can you modify your vimrc accordingly so we can know where the problem lies?
omfg im an idiot lol
$ where gopls
/Users/redacted/go/bin/gopls
/Users/redacted/.local/share/nvim/mason/bin/gopls
/Users/redacted/go/bin/gopls
/Users/redacted/go/bin/gopls
/Users/redacted/go/bin/gopls
/Users/redacted/go/bin/gopls
I've updated the mason gopls and it works fine now. i really need to start another config from scratch without bloat ive accumulated from Lazy.vim.
Thanks a lot for helping even though it was not vim-go related. This issue can be closed now of course.
P.S.
Im curious, how would I look at the __GOLSP_LOG__
logs?
The logs in the __GOLSP_LOG__
window should display in a window (usually at the bottom of your terminal) when g:go_debug
contains lsp
.
What did you do? (required: The issue will be closed when not provided)
What did you expect to happen?
I've seen the other issue opened suggesting to do a GoUpdateBinary. That did not seem to work for me. Also this all seems to work fine in vscode. So i suppose its not gopls or go itslef?
What happened instead?
Configuration (MUST fill this out):
vim-go version:
commit 1401b57
vimrc
you used to reproduce:vimrc
```vim ```Vim version (first three lines from
:version
):NVIM v0.9.4 Build type: Release LuaJIT 2.1.1697887905
Go version (
go version
):go version go1.21.3 darwin/arm64
Go environment
go env
Output:gopls version
gopls version
Output:vim-go configuration:
vim-go configuration
filetype detection configuration:
filetype detection