All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 Save g:ale_completion_autoimport
3 Save g:ale_completion_tsserver_remove_warnings
5 let g:ale_completion_autoimport = v:true
6 let g:ale_completion_tsserver_remove_warnings = v:false
11 unlet! b:ale_tsserver_completion_names
13 Execute(TypeScript completions responses should be parsed correctly):
15 \ ale#completion#ParseTSServerCompletions({
22 \ 'source': '/path/to/foo.ts',
33 \ ale#completion#ParseTSServerCompletions({
35 \ {'name': 'foo', 'source': '/path/to/foo.ts'},
41 Execute(TypeScript completions responses should include warnings):
46 \ 'source': '/path/to/foo.ts',
57 \ ale#completion#ParseTSServerCompletions({
59 \ {'name': 'foo', 'source': '/path/to/foo.ts'},
60 \ {'name': 'bar', 'kind': 'warning'},
65 Execute(TypeScript completions responses should not include warnings if excluded):
66 let g:ale_completion_tsserver_remove_warnings = 1
71 \ 'source': '/path/to/foo.ts',
78 \ ale#completion#ParseTSServerCompletions({
80 \ {'name': 'foo', 'source': '/path/to/foo.ts'},
81 \ {'name': 'bar', 'kind': 'warning'},
86 Execute(TypeScript completion details responses should be parsed correctly):
91 \ 'menu': '(property) Foo.abc: number',
95 \ 'user_data': json_encode({'_ale_completion_item': 1}),
96 \ 'dup': g:ale_completion_autoimport + 0,
100 \ 'menu': '(property) Foo.def: number',
101 \ 'info': 'foo bar baz',
104 \ 'user_data': json_encode({'_ale_completion_item': 1}),
105 \ 'dup': g:ale_completion_autoimport + 0,
109 \ 'menu': '(class) Foo',
113 \ 'user_data': json_encode({'_ale_completion_item': 1}),
114 \ 'dup': g:ale_completion_autoimport + 0,
117 \ ale#completion#ParseTSServerCompletionEntryDetails({
121 \ 'kind': 'parameterName',
124 \ {'text': 'property'},
132 \ {'text': 'number'},
137 \ 'kind': 'parameterName',
140 \ {'text': 'property'},
148 \ {'text': 'number'},
160 \ 'kind': 'className',
172 Execute(Entries without details should be included in the responses):
173 let b:ale_tsserver_completion_names = [{
175 \ 'source': '/path/to/xyz.ts',
182 \ 'menu': 'import { def } from "./Foo"; (property) Foo.abc: number',
186 \ 'user_data': json_encode({
187 \ '_ale_completion_item': 1,
189 \ 'description': 'import { def } from "./Foo";',
193 \ 'dup': g:ale_completion_autoimport + 0,
197 \ 'menu': '(property) Foo.def: number',
198 \ 'info': 'foo bar baz',
201 \ 'user_data': json_encode({'_ale_completion_item': 1}),
202 \ 'dup': g:ale_completion_autoimport + 0,
209 \ 'user_data': json_encode({'_ale_completion_item': 1}),
213 \ ale#completion#ParseTSServerCompletionEntryDetails({
217 \ 'kind': 'parameterName',
220 \ {'text': 'property'},
228 \ {'text': 'number'},
231 \ 'description': 'import { def } from "./Foo";',
237 \ 'kind': 'parameterName',
240 \ {'text': 'property'},
248 \ {'text': 'number'},
261 Execute(Default imports should be handled correctly):
266 \ 'menu': 'Import default ''abcd'' from module "./foo" (alias) const abcd: 3',
270 \ 'user_data': json_encode({
271 \ '_ale_completion_item': 1,
273 \ 'description': 'Import default ''abcd'' from module "./foo"',
277 \ 'dup': g:ale_completion_autoimport + 0,
280 \ ale#completion#ParseTSServerCompletionEntryDetails({
286 \ {'kind': 'punctuation', 'text': '('},
287 \ {'kind': 'text', 'text': 'alias'},
288 \ {'kind': 'punctuation', 'text': ')'},
289 \ {'kind': 'space', 'text': ' '},
290 \ {'kind': 'keyword', 'text': 'const'},
291 \ {'kind': 'space', 'text': ' '},
292 \ {'kind': 'localName', 'text': 'abcd'},
293 \ {'kind': 'punctuation', 'text': ':'},
294 \ {'kind': 'space', 'text': ' '},
295 \ {'kind': 'stringLiteral', 'text': '3'},
296 \ {'kind': 'lineBreak', 'text': '^@'},
297 \ {'kind': 'keyword', 'text': 'export'},
298 \ {'kind': 'space', 'text': ' '},
299 \ {'kind': 'keyword', 'text': 'default'},
300 \ {'kind': 'space', 'text': ' '},
301 \ {'kind': 'aliasName', 'text': 'abcd'}
305 \ 'description': 'Import default ''abcd'' from module "./foo"',