summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-09-11 16:16:18 +0100
committerGitHub <noreply@github.com>2018-09-11 16:16:18 +0100
commit78af99c2566ef8fed443ce253e0de9323b9e5043 (patch)
treef158b3cdeaca370e40da0cac2d7acee0f4b7eae3
parent99e9417ef901824200040c6a2d3e84f2e0ff4b8e (diff)
parent44070d8a455bdea52cc235d8ed68c5945ec3ba4a (diff)
downloadale-78af99c2566ef8fed443ce253e0de9323b9e5043.zip
Merge pull request #1905 from ngavalas/tsserver-classname-fix
Fix tsserver `className` responses
-rw-r--r--autoload/ale/completion.vim2
-rw-r--r--test/completion/test_tsserver_completion_parsing.vader18
2 files changed, 19 insertions, 1 deletions
diff --git a/autoload/ale/completion.vim b/autoload/ale/completion.vim
index bded12b1..e96774c3 100644
--- a/autoload/ale/completion.vim
+++ b/autoload/ale/completion.vim
@@ -264,7 +264,7 @@ function! ale#completion#ParseTSServerCompletionEntryDetails(response) abort
call add(l:documentationParts, l:part.text)
endfor
- if l:suggestion.kind is# 'clasName'
+ if l:suggestion.kind is# 'className'
let l:kind = 'f'
elseif l:suggestion.kind is# 'parameterName'
let l:kind = 'f'
diff --git a/test/completion/test_tsserver_completion_parsing.vader b/test/completion/test_tsserver_completion_parsing.vader
index c8e2c993..dbc4f9e2 100644
--- a/test/completion/test_tsserver_completion_parsing.vader
+++ b/test/completion/test_tsserver_completion_parsing.vader
@@ -32,6 +32,13 @@ Execute(TypeScript completion details responses should be parsed correctly):
\ 'kind': 'f',
\ 'icase': 1,
\ },
+ \ {
+ \ 'word': 'ghi',
+ \ 'menu': '(class) Foo',
+ \ 'info': '',
+ \ 'kind': 'f',
+ \ 'icase': 1,
+ \ },
\ ],
\ ale#completion#ParseTSServerCompletionEntryDetails({
\ 'body': [
@@ -74,6 +81,17 @@ Execute(TypeScript completion details responses should be parsed correctly):
\ {'text': 'baz'},
\ ],
\ },
+ \ {
+ \ 'name': 'ghi',
+ \ 'kind': 'className',
+ \ 'displayParts': [
+ \ {'text': '('},
+ \ {'text': 'class'},
+ \ {'text': ')'},
+ \ {'text': ' '},
+ \ {'text': 'Foo'},
+ \ ],
+ \ },
\ ],
\})