After:
unlet! b:ale_tsserver_completion_names
Execute(TypeScript completions responses should be parsed correctly):
AssertEqual [],
\ ale#completion#ParseTSServerCompletions({
\ 'body': [],
\})
AssertEqual ['foo', 'bar', 'baz'],
\ 'body': [
\ {'name': 'foo'},
\ {'name': 'bar'},
\ {'name': 'baz'},
\ ],
Execute(TypeScript completion details responses should be parsed correctly):
AssertEqual
\ [
\ {
\ 'word': 'abc',
\ 'menu': '(property) Foo.abc: number',
\ 'info': '',
\ 'kind': 'f',
\ 'icase': 1,
\ },
\ 'word': 'def',
\ 'menu': '(property) Foo.def: number',
\ 'info': 'foo bar baz',
\ ale#completion#ParseTSServerCompletionEntryDetails({
\ 'name': 'abc',
\ 'kind': 'parameterName',
\ 'displayParts': [
\ {'text': '('},
\ {'text': 'property'},
\ {'text': ')'},
\ {'text': ' '},
\ {'text': 'Foo'},
\ {'text': '.'},
\ {'text': 'abc'},
\ {'text': ':'},
\ {'text': 'number'},
\ 'name': 'def',
\ {'text': 'def'},
\ 'documentation': [
\ {'text': 'foo'},
\ {'text': 'bar'},
\ {'text': 'baz'},
Execute(Entries without details should be included in the responses):
let b:ale_tsserver_completion_names = ['xyz']
\ 'word': 'xyz',
\ 'menu': '',
\ 'kind': 'v',