2018-08-30 02:39:03 +00:00
|
|
|
Before:
|
|
|
|
Save $GOPATH
|
2018-09-06 16:05:05 +00: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-30 02:39:03 +00:00
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
2018-09-06 16:05:05 +00:00
|
|
|
|
|
|
|
unlet! b:ale_completion_enabled
|
|
|
|
unlet! g:sep
|
|
|
|
|
2018-08-30 02:39:03 +00: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 16:05:05 +00:00
|
|
|
|
2018-08-30 02:39:03 +00: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 16:05:05 +00:00
|
|
|
|
|
|
|
AssertLinter 'go-langserver',
|
|
|
|
\ ale#Escape('go-langserver') . ' -gocodecompletion'
|
2018-08-30 02:39:03 +00:00
|
|
|
|
|
|
|
let b:ale_go_langserver_options = '-trace'
|
2018-09-06 16:05:05 +00:00
|
|
|
|
|
|
|
AssertLinter 'go-langserver',
|
|
|
|
\ ale#Escape('go-langserver') . ' -gocodecompletion -trace'
|
2018-08-30 02:39:03 +00: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 16:05:05 +00:00
|
|
|
|
|
|
|
AssertLinter 'go-langserver',
|
|
|
|
\ ale#Escape('go-langserver') . ' -gocodecompletion -trace'
|
2018-08-30 02:39:03 +00:00
|
|
|
|
|
|
|
let b:ale_completion_enabled = 0
|
2018-09-06 16:05:05 +00:00
|
|
|
|
|
|
|
AssertLinter 'go-langserver', ale#Escape('go-langserver') . ' -trace'
|
2018-08-30 02:39:03 +00:00
|
|
|
|
|
|
|
Execute(should set go-langserver for go app1):
|
|
|
|
call ale#test#SetFilename('go_paths/go1/prj1/file.go')
|
2018-09-06 16:05:05 +00:00
|
|
|
|
2018-08-30 02:39:03 +00:00
|
|
|
AssertLSPLanguage 'go'
|
2018-10-30 15:54:40 +00:00
|
|
|
AssertLSPConfig {}
|
2018-08-30 02:39:03 +00:00
|
|
|
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 16:05:05 +00:00
|
|
|
|
2018-08-30 02:39:03 +00:00
|
|
|
AssertLSPLanguage 'go'
|
|
|
|
AssertLSPOptions {}
|
2018-10-30 15:54:40 +00:00
|
|
|
AssertLSPConfig {}
|
2018-08-30 02:39:03 +00:00
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/go_paths/go2')
|