mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
fix(biome): find root when using biome.jsonc (#4774)
Since biome supports either `biome.json` or `biome.jsonc` config files, we need to look for both when searching for the LSP project root. We can also look for a package.json or .git folder to use. This uses mostly the same logic as deno.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
Before:
|
||||
Save g:ale_biome_options
|
||||
Save g:ale_biome_lsp_project_root
|
||||
|
||||
let g:ale_biome_options = ''
|
||||
let g:ale_biome_lsp_project_root = ''
|
||||
|
||||
call ale#assert#SetUpLinterTest('typescript', 'biome')
|
||||
call ale#test#SetFilename('test.ts')
|
||||
@@ -33,3 +35,20 @@ Execute(Uses the filetype as the language):
|
||||
call ale#test#SetFilename('test.jsx')
|
||||
set filetype=javascriptreact
|
||||
AssertLSPLanguage 'javascriptreact'
|
||||
|
||||
Execute(Should find project root containing biome.json):
|
||||
call ale#test#SetFilename('../test-files/biome/json/src/test.ts')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/biome/json')
|
||||
|
||||
Execute(Should find project root containing biome.jsonc):
|
||||
call ale#test#SetFilename('../test-files/biome/jsonc/src/test.ts')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/biome/jsonc')
|
||||
|
||||
Execute(Should use user-specified project root):
|
||||
let g:ale_biome_lsp_project_root = '/'
|
||||
|
||||
call ale#test#SetFilename('../test-files/biome/jsonc/src/test.ts')
|
||||
|
||||
AssertLSPProject '/'
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
Before:
|
||||
Save g:ale_deno_import_map
|
||||
Save g:ale_deno_importMap
|
||||
Save g:ale_deno_unstable
|
||||
Save g:ale_deno_executable
|
||||
Save g:ale_deno_lsp_project_root
|
||||
|
||||
let g:ale_deno_import_map = 'import_map.json'
|
||||
let g:ale_deno_importMap = ''
|
||||
let g:ale_deno_unstable = 0
|
||||
let g:ale_deno_executable = 'deno'
|
||||
let g:ale_deno_lsp_project_root = ''
|
||||
|
||||
0
test/test-files/biome/json/biome.json
Normal file
0
test/test-files/biome/json/biome.json
Normal file
0
test/test-files/biome/json/src/test.ts
Normal file
0
test/test-files/biome/json/src/test.ts
Normal file
0
test/test-files/biome/jsonc/biome.jsonc
Normal file
0
test/test-files/biome/jsonc/biome.jsonc
Normal file
0
test/test-files/biome/jsonc/src/test.ts
Normal file
0
test/test-files/biome/jsonc/src/test.ts
Normal file
Reference in New Issue
Block a user