From 05eb2cf078f1d2a0f83490f2a751981ce8b41b43 Mon Sep 17 00:00:00 2001 From: Ruixi-rebirth Date: Sat, 10 Jun 2023 06:30:37 -0600 Subject: fix(nixd): add nixd.json as root_dir pattern (#2665) --- lua/lspconfig/server_configurations/nixd.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lua') 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")]], }, }, } -- cgit v1.2.3-70-g09d2