ale/test/command_callback/test_golangserver_command_callback.vader

68 lines
1.9 KiB
Plaintext
Raw Normal View History

2018-08-29 22:39:03 -04:00
Before:
Save $GOPATH
2018-09-06 12:05:05 -04:00
Save g:ale_completion_enabled
let g:ale_completion_enabled = 0
let g:sep = has('win32') ? ';' : ':'
call ale#assert#SetUpLinterTest('go', 'langserver')
let $GOPATH = ale#path#Simplify(g:dir . '/go_paths/go1')
\ . g:sep
\ . ale#path#Simplify(g:dir . '/go_paths/go2')
2018-08-29 22:39:03 -04:00
After:
Restore
2018-09-06 12:05:05 -04:00
unlet! b:ale_completion_enabled
unlet! g:sep
2018-08-29 22:39:03 -04:00
call ale#assert#TearDownLinterTest()
Execute(should set correct defaults):
AssertLinter 'go-langserver', ale#Escape('go-langserver')
Execute(should configure go-langserver callback executable):
let b:ale_go_langserver_executable = 'boo'
2018-09-06 12:05:05 -04:00
2018-08-29 22:39:03 -04:00
AssertLinter 'boo', ale#Escape('boo')
Execute(should set go-langserver options):
call ale#test#SetFilename('go_paths/go1/prj1/file.go')
let b:ale_completion_enabled = 1
let b:ale_go_langserver_options = ''
2018-09-06 12:05:05 -04:00
AssertLinter 'go-langserver',
\ ale#Escape('go-langserver') . ' -gocodecompletion'
2018-08-29 22:39:03 -04:00
let b:ale_go_langserver_options = '-trace'
2018-09-06 12:05:05 -04:00
AssertLinter 'go-langserver',
\ ale#Escape('go-langserver') . ' -gocodecompletion -trace'
2018-08-29 22:39:03 -04:00
Execute(should ignore go-langserver -gocodecompletion option):
call ale#test#SetFilename('go_paths/go1/prj1/file.go')
let b:ale_go_langserver_options = '-trace -gocodecompletion'
let b:ale_completion_enabled = 1
2018-09-06 12:05:05 -04:00
AssertLinter 'go-langserver',
\ ale#Escape('go-langserver') . ' -gocodecompletion -trace'
2018-08-29 22:39:03 -04:00
let b:ale_completion_enabled = 0
2018-09-06 12:05:05 -04:00
AssertLinter 'go-langserver', ale#Escape('go-langserver') . ' -trace'
2018-08-29 22:39:03 -04:00
Execute(should set go-langserver for go app1):
call ale#test#SetFilename('go_paths/go1/prj1/file.go')
2018-09-06 12:05:05 -04:00
2018-08-29 22:39:03 -04:00
AssertLSPLanguage 'go'
AssertLSPOptions {}
AssertLSPProject ale#path#Simplify(g:dir . '/go_paths/go1')
Execute(should set go-langserver for go app2):
call ale#test#SetFilename('go_paths/go2/prj1/file.go')
2018-09-06 12:05:05 -04:00
2018-08-29 22:39:03 -04:00
AssertLSPLanguage 'go'
AssertLSPOptions {}
AssertLSPProject ale#path#Simplify(g:dir . '/go_paths/go2')