#1162 Add unfinished experimental code for supporting LSP completion, clean up the tests, and make the completion cancelling better

This commit is contained in:
w0rp
2017-11-26 12:24:18 +00:00
parent 2e50aadd56
commit b1a6abdda6
9 changed files with 677 additions and 384 deletions

View File

@@ -101,6 +101,35 @@ Execute(ale#lsp#message#DidClose() should return correct messages):
\ ],
\ ale#lsp#message#DidClose(bufnr(''))
Execute(ale#lsp#message#Completion() should return correct messages):
AssertEqual
\ [
\ 0,
\ 'textDocument/completion',
\ {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
\ },
\ 'position': {'line': 11, 'character': 33},
\ }
\ ],
\ ale#lsp#message#Completion(bufnr(''), 12, 34, '')
Execute(ale#lsp#message#Completion() should return correct messages with a trigger charaacter):
AssertEqual
\ [
\ 0,
\ 'textDocument/completion',
\ {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
\ },
\ 'position': {'line': 11, 'character': 33},
\ 'context': {'triggerKind': 2, 'triggerCharacter': '.'},
\ }
\ ],
\ ale#lsp#message#Completion(bufnr(''), 12, 34, '.')
Execute(ale#lsp#tsserver_message#Open() should return correct messages):
AssertEqual
\ [