diff options
| author | Ruixi-rebirth <ruixirebirth@gmail.com> | 2023-06-10 06:30:37 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-10 20:30:37 +0800 |
| commit | 05eb2cf078f1d2a0f83490f2a751981ce8b41b43 (patch) | |
| tree | 334b030c97d7d7313ab349b4a3c5a51a8f2a063c | |
| parent | feat(gopls): attach previous lsp instance for GOMODCACHE (#2661) (diff) | |
| download | nvim-lspconfig-05eb2cf078f1d2a0f83490f2a751981ce8b41b43.tar nvim-lspconfig-05eb2cf078f1d2a0f83490f2a751981ce8b41b43.tar.gz nvim-lspconfig-05eb2cf078f1d2a0f83490f2a751981ce8b41b43.tar.bz2 nvim-lspconfig-05eb2cf078f1d2a0f83490f2a751981ce8b41b43.tar.lz nvim-lspconfig-05eb2cf078f1d2a0f83490f2a751981ce8b41b43.tar.xz nvim-lspconfig-05eb2cf078f1d2a0f83490f2a751981ce8b41b43.tar.zst nvim-lspconfig-05eb2cf078f1d2a0f83490f2a751981ce8b41b43.zip | |
fix(nixd): add nixd.json as root_dir pattern (#2665)
| -rw-r--r-- | lua/lspconfig/server_configurations/nixd.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/lspconfig/server_configurations/nixd.lua b/lua/lspconfig/server_configurations/nixd.lua index 36c84815..31848c4e 100644 --- a/lua/lspconfig/server_configurations/nixd.lua +++ b/lua/lspconfig/server_configurations/nixd.lua @@ -5,7 +5,9 @@ return { cmd = { 'nixd' }, filetypes = { 'nix' }, single_file_support = true, - root_dir = util.root_pattern('flake.nix', '.git'), + root_dir = function(fname) + return util.root_pattern(unpack { 'nixd.json', 'flake.nix' })(fname) or util.find_git_ancestor(fname) + end, }, docs = { description = [[ @@ -17,7 +19,7 @@ If you are using Nix with Flakes support, run `nix profile install github:nix-co Check the repository README for more information. ]], default_config = { - root_dir = [[root_pattern("flake.nix", ".git")]], + root_dir = [[root_pattern(".nixd.json", "flake.nix",".git")]], }, }, } |
