Add support for nimlsp (#2815)

* Add support for nimlsp.vim
* Add test and docs for nimlsp
* Add nimlsp to supported-tools.md
* Add nimlsp to doc/ale-supported-languages-and-tools.txt
This commit is contained in:
Jerko Steiner
2019-10-18 01:32:31 +09:00
committed by w0rp
parent f4070f6c43
commit e5a4c82917
8 changed files with 94 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
Before:
call ale#assert#SetUpLinterTest('nim', 'nimlsp')
After:
call ale#assert#TearDownLinterTest()
Execute(It does not set nim sources by default):
AssertLinter 'nimlsp', ale#Escape('nimlsp')
Execute(Sets nimlsp and escapes sources from g:ale_nim_nimlsp_nim_sources):
let g:ale_nim_nimlsp_nim_sources = '/path/to /Nim'
AssertLinter 'nimlsp', ale#Escape('nimlsp') . ' ' . ale#Escape('/path/to /Nim')

View File

@@ -0,0 +1,19 @@
Before:
runtime ale_linters/nim/nimlsp.vim
call ale#test#SetDirectory('/testplugin/test')
After:
if isdirectory(g:dir . '/.git')
call delete(g:dir . '/.git', 'd')
endif
call ale#test#RestoreDirectory()
call ale#linter#Reset()
Execute(Detect root of nim project with .git/ correctly):
call ale#test#SetFilename('nim-test-files/with-git/src/source.nim')
call mkdir(g:dir . '/.git')
AssertEqual
\ ale#path#Simplify(g:dir),
\ ale_linters#nim#nimlsp#GetProjectRoot(bufnr(''))