80a48d01be
* Fix texlab GetProjectRoot * Fix indents in texlab#GetProjectRoot * Prevent texlab from starting on every tex file * Update texlab Vader tests * Fix GetProjectRoot to return parent of .git Previously, the function returned `../.git/`. We want the function to return the parent directory above that as the project root. This should help pass Vader tests.
30 lines
844 B
Text
30 lines
844 B
Text
Before:
|
|
call ale#assert#SetUpLinterTest('tex', 'texlab')
|
|
|
|
Save &filetype
|
|
let &filetype = 'tex'
|
|
|
|
After:
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
Execute(The language string should be correct):
|
|
AssertLSPLanguage 'tex'
|
|
|
|
Execute(The default executable path should be correct):
|
|
AssertLinter 'texlab', ale#Escape('texlab')
|
|
|
|
Execute(The project root should be detected correctly):
|
|
call ale#test#SetFilename('tex_paths/sample1.tex')
|
|
silent! call mkdir('tex_paths/.git')
|
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/tex_paths')
|
|
|
|
Execute(The executable should be configurable):
|
|
let b:ale_tex_texlab_executable = 'foobar'
|
|
|
|
AssertLinter 'foobar', ale#Escape('foobar')
|
|
|
|
Execute(The options should be configurable):
|
|
let b:ale_tex_texlab_options = '-v'
|
|
|
|
AssertLinter 'texlab', ale#Escape('texlab') . ' ' . b:ale_tex_texlab_options
|