#1520 - Add an :ALEDocumentation for tsserver

This commit is contained in:
w0rp
2018-12-10 20:08:28 +00:00
parent 9226e13b31
commit 39c892eff4
5 changed files with 87 additions and 4 deletions

View File

@@ -149,3 +149,23 @@ Execute(LSP hover response with lists of strings and marked strings should be ha
AssertEqual ["foo\nbar\n"], g:echo_list
AssertEqual {}, ale#hover#GetMap()
Execute(tsserver responses for documentation requests should be handled):
call ale#hover#SetMap({3: {'show_documentation': 1}})
call ale#hover#HandleTSServerResponse(
\ 1,
\ {
\ 'command': 'quickinfo',
\ 'request_seq': 3,
\ 'success': v:true,
\ 'body': {
\ 'documentation': 'foo is a very good method',
\ 'displayString': 'foo bar',
\ },
\ }
\)
" The preview window should show the text.
AssertEqual ['foo is a very good method'], ale#test#GetPreviewWindowText()
silent! pclose