mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Detect the Lua project root using .luarc.json
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
" Find project root for a Lua language server.
|
" Find project root for a Lua language server.
|
||||||
function! ale#lua#FindProjectRoot(buffer) abort
|
function! ale#lua#FindProjectRoot(buffer) abort
|
||||||
let l:possible_project_roots = [
|
let l:possible_project_roots = [
|
||||||
|
\ '.luarc.json',
|
||||||
\ '.git',
|
\ '.git',
|
||||||
\ bufname(a:buffer),
|
\ bufname(a:buffer),
|
||||||
\]
|
\]
|
||||||
|
|||||||
@@ -14,3 +14,8 @@ Execute(lua-language-server should be configurable):
|
|||||||
|
|
||||||
AssertLinter 'billy', ale#Escape('billy')
|
AssertLinter 'billy', ale#Escape('billy')
|
||||||
AssertLSPConfig {'x': 'y'}
|
AssertLSPConfig {'x': 'y'}
|
||||||
|
|
||||||
|
Execute(lua-language-server should detect the project root using .luarc.json):
|
||||||
|
call ale#test#SetFilename('../lua/dummy.lua')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../lua')
|
||||||
|
|||||||
19
test/lua/.luarc.json
Normal file
19
test/lua/.luarc.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
|
||||||
|
"diagnostics.globals": [
|
||||||
|
"vim",
|
||||||
|
"describe",
|
||||||
|
"it",
|
||||||
|
"before_each",
|
||||||
|
"after_each",
|
||||||
|
"setup",
|
||||||
|
"teardown",
|
||||||
|
"pending",
|
||||||
|
"assert"
|
||||||
|
],
|
||||||
|
"workspace.library": [
|
||||||
|
"../../lua"
|
||||||
|
],
|
||||||
|
"runtime.version": "LuaJIT",
|
||||||
|
"hint.enable": false
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user