2

"Go to definition" is working fine in normal code base, but it's just not working in tests. Here's the error message:

Error when executing textDocument/Definition : no package metadata for file file://.....

I'm using vim-lspconfig and mason.nvim.

Any pointers?

4
  • Could you give us some details about how your configuration is set up? What language server is throwing this error? Commented Apr 23, 2024 at 2:24
  • @Cogwizzle I basically use lazyVim's starter template here without much changes: github.com/LazyVim/starter I enabled the lang.go in LazyExtras like this "lazyvim.plugins.extras.lang.go" lazyvim.org/extras/lang/go is the documentation for go. Commented Apr 23, 2024 at 16:05
  • Do you by chance see any language server when you run :LspInfo in one of the test buffers that you're having trouble with? Commented Apr 24, 2024 at 14:12
  • @Cogwizzle Thanks. :LspInfo gives me three clients: null-ls, copilot, gopls. so it's the gopls for Go. and the cmd location is under mason: cmd: ~/.local/share/nvim/mason/bin/gopls Commented Apr 24, 2024 at 15:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.