mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-30 22:55:30 +08:00
Adding Roc language linters and fixers. (#4966)
* `roc_language_server` * `roc format` * `roc format annotate`
This commit is contained in:
20
test/fixers/test_roc_annotate_fixer_callback.vader
Normal file
20
test/fixers/test_roc_annotate_fixer_callback.vader
Normal file
@@ -0,0 +1,20 @@
|
||||
Before:
|
||||
call ale#assert#SetUpFixerTest('roc', 'roc_annotate')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownFixerTest()
|
||||
|
||||
Execute(The roc annotate callback should return the correct default values):
|
||||
AssertFixer {
|
||||
\ 'command': 'roc format annotate %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
Execute(The roc annotate callback should allow a custom executable):
|
||||
let g:ale_roc_roc_annotate_executable = 'foo/bar'
|
||||
|
||||
AssertFixer {
|
||||
\ 'command': 'foo/bar format annotate %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
20
test/fixers/test_roc_format_fixer_callback.vader
Normal file
20
test/fixers/test_roc_format_fixer_callback.vader
Normal file
@@ -0,0 +1,20 @@
|
||||
Before:
|
||||
call ale#assert#SetUpFixerTest('roc', 'roc_format')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownFixerTest()
|
||||
|
||||
Execute(The roc format callback should return the correct default values):
|
||||
AssertFixer {
|
||||
\ 'command': 'roc format %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
Execute(The roc format callback should allow a custom executable):
|
||||
let g:ale_roc_roc_format_executable = 'foo/bar'
|
||||
|
||||
AssertFixer {
|
||||
\ 'command': 'foo/bar format %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
23
test/linter/test_roc_roc_language_server.vader
Normal file
23
test/linter/test_roc_roc_language_server.vader
Normal file
@@ -0,0 +1,23 @@
|
||||
Before:
|
||||
call ale#assert#SetUpLinterTest('roc', 'roc_language_server')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The default executable path should be correct):
|
||||
AssertLinter 'roc_language_server', ale#Escape('roc_language_server')
|
||||
|
||||
Execute(The project root should be detected correctly in empty directory):
|
||||
AssertLSPProject '.'
|
||||
|
||||
Execute(The project root should be detected correctly with main.roc):
|
||||
call ale#test#SetFilename('../test-files/roc/main.roc')
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/roc')
|
||||
|
||||
Execute(The LSP values should be set correctly):
|
||||
call ale#test#SetFilename('../test-files/roc/main.roc')
|
||||
|
||||
AssertLSPLanguage 'roc'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPConfig {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/roc')
|
||||
0
test/test-files/roc/main.roc
Normal file
0
test/test-files/roc/main.roc
Normal file
Reference in New Issue
Block a user