Skip to content
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

Gopls local property is not set when CWD doesn't contain go.mod #512

Open
ffoebel opened this issue Oct 10, 2024 · 1 comment
Open

Gopls local property is not set when CWD doesn't contain go.mod #512

ffoebel opened this issue Oct 10, 2024 · 1 comment

Comments

@ffoebel
Copy link

ffoebel commented Oct 10, 2024

There's no upward search here:
https://github.com/ray-x/go.nvim/blob/master/lua/go/gopls.lua#L288

I'm pretty sure go.mod discovery works fine in other cases, maybe there's a function to reuse?

For big repositories it's quite common (at least for me) to open nvim in a subdirectory to limit e.g. file search.

@ray-x
Copy link
Owner

ray-x commented Oct 11, 2024

You can re-write the function and pass the result to gopls config

lsp_cfg = {settings={gopls={['local'] = 'your_local_module_path', gofumpt = true }}}

But what does your preferred method look like? As I always set root-dir to either go.mod, go.work etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants