diff options
| author | Peter Lithammer <peter.lithammer@gmail.com> | 2025-05-10 21:15:45 +0200 |
|---|---|---|
| committer | Peter Lithammer <peter.lithammer@gmail.com> | 2025-05-14 16:50:57 +0200 |
| commit | ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57 (patch) | |
| tree | e094cc07e357cb76bc130be4bc3582050d685d6b | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57.tar nvim-lspconfig-ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57.tar.gz nvim-lspconfig-ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57.tar.bz2 nvim-lspconfig-ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57.tar.lz nvim-lspconfig-ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57.tar.xz nvim-lspconfig-ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57.tar.zst nvim-lspconfig-ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57.zip | |
fix(gopls): prioritise `go.work` over `go.mod`
The purpose of a `go.work` file is to handle multi-module workspaces. A
common such scenario is a monorepo.
This is also how the legacy config works because it's using
`lsponfig.util.root_pattern()` which has similar semantics as
`root_markers`.
| -rw-r--r-- | lsp/gopls.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lsp/gopls.lua b/lsp/gopls.lua index c1b16fbb..8a4635f0 100644 --- a/lsp/gopls.lua +++ b/lsp/gopls.lua @@ -15,7 +15,7 @@ local function get_root(fname) return clients[#clients].config.root_dir end end - return vim.fs.root(fname, { 'go.work', 'go.mod', '.git' }) + return vim.fs.root(fname, 'go.work') or vim.fs.root(fname, 'go.mod') or vim.fs.root(fname, '.git') end return { |
