diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-09-06 14:50:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-06 14:50:00 +0100 |
commit | f1d5bcbf988d2fff1ce396537534e55611c8b8d6 (patch) | |
tree | 3f47a5fcb577c2adc221426f3959dcc4343fb18a /test/command_callback | |
parent | f8beaa9e3e5e6a723ce33deba8b71acb2c9dd1a1 (diff) | |
parent | a9333c2866ad604ef5b8523af7fb1fce10057833 (diff) | |
download | ale-f1d5bcbf988d2fff1ce396537534e55611c8b8d6.zip |
Merge pull request #1870 from hsanson/1822-add-go-langserver-support
Fix #1822 - support go-langserver lsp.
Diffstat (limited to 'test/command_callback')
-rw-r--r-- | test/command_callback/go_paths/go1/prj1/file.go | 0 | ||||
-rw-r--r-- | test/command_callback/go_paths/go2/prj2/file.go | 0 | ||||
-rw-r--r-- | test/command_callback/test_golangserver_command_callback.vader | 50 |
3 files changed, 50 insertions, 0 deletions
diff --git a/test/command_callback/go_paths/go1/prj1/file.go b/test/command_callback/go_paths/go1/prj1/file.go new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/command_callback/go_paths/go1/prj1/file.go diff --git a/test/command_callback/go_paths/go2/prj2/file.go b/test/command_callback/go_paths/go2/prj2/file.go new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/command_callback/go_paths/go2/prj2/file.go diff --git a/test/command_callback/test_golangserver_command_callback.vader b/test/command_callback/test_golangserver_command_callback.vader new file mode 100644 index 00000000..a5893cee --- /dev/null +++ b/test/command_callback/test_golangserver_command_callback.vader @@ -0,0 +1,50 @@ +Before: + Save $GOPATH + call ale#assert#SetUpLinterTest('go', 'golangserver') + let sep = has('win32') ? ';' : ':' + let $GOPATH=ale#path#Simplify(g:dir . '/go_paths/go1') + \ . sep + \ . ale#path#Simplify(g:dir . '/go_paths/go2') + +After: + Restore + 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' + AssertLinter 'boo', ale#Escape('boo') + unlet b:ale_go_langserver_executable + +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 = '' + AssertEqual ale_linters#go#golangserver#GetCommand(bufnr('%')), ale#Escape('go-langserver') . ' -gocodecompletion' + + let b:ale_go_langserver_options = '-trace' + AssertEqual ale_linters#go#golangserver#GetCommand(bufnr('%')), ale#Escape('go-langserver') . ' -gocodecompletion -trace' + +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 + AssertEqual ale_linters#go#golangserver#GetCommand(bufnr('%')), ale#Escape('go-langserver') . ' -gocodecompletion -trace' + + let b:ale_completion_enabled = 0 + AssertEqual ale_linters#go#golangserver#GetCommand(bufnr('%')), ale#Escape('go-langserver') . ' -trace' + +Execute(should set go-langserver for go app1): + call ale#test#SetFilename('go_paths/go1/prj1/file.go') + 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') + AssertLSPLanguage 'go' + AssertLSPOptions {} + AssertLSPProject ale#path#Simplify(g:dir . '/go_paths/go2') |