diff options
| author | willparsons <williamparsons62@gmail.com> | 2024-01-29 01:17:05 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-28 17:17:05 -0800 |
| commit | e2897f24a550f6c09b9cb46c77008fa929b208bd (patch) | |
| tree | f406ade8bdecca174509d1bc44e674bac75613f7 /lua | |
| parent | fix(lua-language-server): update root directory search (#2842) (diff) | |
| download | nvim-lspconfig-e2897f24a550f6c09b9cb46c77008fa929b208bd.tar nvim-lspconfig-e2897f24a550f6c09b9cb46c77008fa929b208bd.tar.gz nvim-lspconfig-e2897f24a550f6c09b9cb46c77008fa929b208bd.tar.bz2 nvim-lspconfig-e2897f24a550f6c09b9cb46c77008fa929b208bd.tar.lz nvim-lspconfig-e2897f24a550f6c09b9cb46c77008fa929b208bd.tar.xz nvim-lspconfig-e2897f24a550f6c09b9cb46c77008fa929b208bd.tar.zst nvim-lspconfig-e2897f24a550f6c09b9cb46c77008fa929b208bd.zip | |
fix(biome)!: make biome only run in projects with biome.json file (#2984)
Closes #2980
This PR adjusts the configuration for the biome LSP to only attach if there is an existing biome.json found.
This helps prevent conflicts in ESLint projects since biome would attach and start providing diagnostics and would format files which could conflict with the ESLint/Prettier rules that are defined.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/biome.lua | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lua/lspconfig/server_configurations/biome.lua b/lua/lspconfig/server_configurations/biome.lua index d8f144e6..dc1d1ab5 100644 --- a/lua/lspconfig/server_configurations/biome.lua +++ b/lua/lspconfig/server_configurations/biome.lua @@ -12,12 +12,8 @@ return { 'typescript.tsx', 'typescriptreact', }, - root_dir = function(fname) - return util.find_package_json_ancestor(fname) - or util.find_node_modules_ancestor(fname) - or util.find_git_ancestor(fname) - end, - single_file_support = true, + root_dir = util.root_pattern 'biome.json', + single_file_support = false, }, docs = { description = [[ @@ -30,7 +26,7 @@ npm install [-g] @biomejs/biome ``` ]], default_config = { - root_dir = [[root_pattern('package.json', 'node_modules', '.git', 'biome.json')]], + root_dir = [[root_pattern('biome.json')]], }, }, } |
