mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-16 13:35:06 +08:00
7b5b854fc4
CI / Build (push) Waiting to run
CI / Lint (push) Blocked by required conditions
CI / Lua (push) Blocked by required conditions
CI / Neovim 0.10 Linux (push) Blocked by required conditions
CI / Neovim 0.12 Linux (push) Blocked by required conditions
CI / Vim 8.2 Linux (push) Blocked by required conditions
CI / Vim 9.2 Linux (push) Blocked by required conditions
CI / Neovim 0.10 Windows (push) Waiting to run
CI / Neovim 0.12 Windows (push) Waiting to run
CI / Vim 8.2 Windows (push) Waiting to run
CI / Vim 9.2 Windows (push) Waiting to run
84 lines
2.7 KiB
Plaintext
84 lines
2.7 KiB
Plaintext
" Author: rymdbar <https://rymdbar.x20.se/>
|
|
|
|
Before:
|
|
call ale#assert#SetUpLinterTest('perl', 'languageserver')
|
|
|
|
After:
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
Execute(The default Perl command callback should be correct):
|
|
AssertLinter 'perl',
|
|
\ ale#Escape('perl') . ' -MPerl::LanguageServer -ePerl::LanguageServer::run'
|
|
|
|
Execute(Overriding the executable should work):
|
|
let b:ale_perl_perl_executable = 'plls'
|
|
|
|
AssertLinter 'plls', ale#Escape('plls') .
|
|
\ ' -MPerl::LanguageServer -ePerl::LanguageServer::run'
|
|
unlet b:ale_perl_perl_executable
|
|
|
|
Execute(The project root should be detected correctly in from build files):
|
|
for mod in ['extutils-makemaker', 'module-build', 'dist-zilla']
|
|
call ale#test#SetFilename('../test-files/perl/' . mod . '/subdir/empty.pl')
|
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/perl/' . mod)
|
|
endfor
|
|
|
|
Execute(The project root should be globally configurable):
|
|
for mod in ['extutils-makemaker', 'module-build', 'dist-zilla']
|
|
call ale#test#SetFilename('../test-files/perl/'. mod . '/subdir/empty.pl')
|
|
" Configuring g:ale_root using a Dictionary works.
|
|
let g:ale_root.languageserver =
|
|
\ ale#path#Simplify(g:dir . '/../test-files/perl')
|
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/perl')
|
|
unlet g:ale_root.languageserver
|
|
|
|
" Configuring g:ale_root using a String works.
|
|
let g:ale_root = ale#path#Simplify(g:dir . '/../test-files/perl')
|
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/perl')
|
|
let g:ale_root = {}
|
|
endfor
|
|
|
|
Execute(The project root should be per buffer configurable):
|
|
for mod in ['extutils-makemaker', 'module-build', 'dist-zilla']
|
|
call ale#test#SetFilename('../test-files/perl/'. mod . '/subdir/empty.pl')
|
|
" Configuring b:ale_root using a String works.
|
|
let b:ale_root = ale#path#Simplify(g:dir . '/../test-files/perl')
|
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/perl')
|
|
unlet b:ale_root
|
|
|
|
" Configuring b:ale_root using a Dictionary works.
|
|
let b:ale_root = {
|
|
\ 'languageserver': ale#path#Simplify(g:dir . '/../test-files/perl')
|
|
\ }
|
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/perl')
|
|
unlet b:ale_root.languageserver
|
|
endfor
|
|
|
|
Execute(The LSP values should be set correctly):
|
|
|
|
AssertLSPLanguage 'perl'
|
|
|
|
AssertLSPOptions {}
|
|
|
|
AssertLSPConfig {'perl': {'enable': 1}}
|
|
|
|
Execute(Should accept configuration settings):
|
|
let b:ale_perl_languageserver_config = {
|
|
\ 'perl': {
|
|
\ 'perlInc': ['/usr/share/perl5/', '/usr/local/share/perl5/' ],
|
|
\ 'fileFilter': [''],
|
|
\ },
|
|
\ }
|
|
|
|
AssertLSPConfig {
|
|
\ 'perl': {
|
|
\ 'perlInc': ['/usr/share/perl5/', '/usr/local/share/perl5/' ],
|
|
\ 'fileFilter': [''],
|
|
\ },
|
|
\ }
|