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 function Range(start_line, start_char, end_line, end_char) abort
4 \ 'start': {'line': a:start_line, 'character': a:start_char},
5 \ 'end': {'line': a:end_line, 'character': a:end_char},
12 Execute(ale#lsp#response#ReadDiagnostics() should handle errors):
16 \ 'text': 'Something went wrong!',
21 \ 'code': 'some-error',
24 \ ale#lsp#response#ReadDiagnostics([
27 \ 'range': Range(2, 10, 4, 15),
28 \ 'code': 'some-error',
29 \ 'message': 'Something went wrong!',
33 Execute(ale#lsp#response#ReadDiagnostics() should handle warnings):
37 \ 'text': 'Something went wrong!',
42 \ 'code': 'some-warning',
45 \ ale#lsp#response#ReadDiagnostics([
48 \ 'range': Range(1, 3, 1, 3),
49 \ 'code': 'some-warning',
50 \ 'message': 'Something went wrong!',
54 Execute(ale#lsp#response#ReadDiagnostics() should treat messages with missing severity as errors):
58 \ 'text': 'Something went wrong!',
63 \ 'code': 'some-error',
66 \ ale#lsp#response#ReadDiagnostics([
68 \ 'range': Range(2, 10, 4, 15),
69 \ 'code': 'some-error',
70 \ 'message': 'Something went wrong!',
74 Execute(ale#lsp#response#ReadDiagnostics() should handle messages without codes):
78 \ 'text': 'Something went wrong!',
85 \ ale#lsp#response#ReadDiagnostics([
87 \ 'range': Range(2, 10, 4, 15),
88 \ 'message': 'Something went wrong!',
92 Execute(ale#lsp#response#ReadDiagnostics() should include sources in detail):
96 \ 'text': 'Something went wrong!',
97 \ 'detail': '[tslint] Something went wrong!',
104 \ ale#lsp#response#ReadDiagnostics([
106 \ 'range': Range(9, 14, 11, 22),
107 \ 'message': 'Something went wrong!',
108 \ 'source': 'tslint',
112 Execute(ale#lsp#response#ReadDiagnostics() should keep detail with line breaks but replace with spaces in text):
116 \ 'text': 'cannot borrow `cap` as mutable more than once at a time mutable borrow starts here in previous iteration of loop',
117 \ 'detail': "[rustc] cannot borrow `cap` as mutable\r\nmore than once at a time\n\nmutable borrow starts here\rin previous iteration of loop",
124 \ ale#lsp#response#ReadDiagnostics([
126 \ 'range': Range(9, 14, 11, 22),
127 \ 'message': "cannot borrow `cap` as mutable\r\nmore than once at a time\n\nmutable borrow starts here\rin previous iteration of loop",
132 Execute(ale#lsp#response#ReadDiagnostics() should consider -1 to be a meaningless code):
136 \ 'text': 'Something went wrong!',
143 \ ale#lsp#response#ReadDiagnostics([
145 \ 'range': Range(2, 10, 4, 15),
146 \ 'message': 'Something went wrong!',
151 Execute(ale#lsp#response#ReadDiagnostics() should handle multiple messages):
155 \ 'text': 'Something went wrong!',
163 \ 'text': 'A warning',
170 \ ale#lsp#response#ReadDiagnostics([
172 \ 'range': Range(0, 2, 0, 2),
173 \ 'message': 'Something went wrong!',
177 \ 'range': Range(1, 4, 1, 4),
178 \ 'message': 'A warning',
182 Execute(ale#lsp#response#ReadDiagnostics() should use relatedInformation for detail):
186 \ 'text': 'Something went wrong!',
191 \ 'detail': "Something went wrong!\n/tmp/someotherfile.txt:43:80:\n\tmight be this"
194 \ ale#lsp#response#ReadDiagnostics([
196 \ 'range': Range(0, 2, 0, 2),
197 \ 'message': 'Something went wrong!',
198 \ 'relatedInformation': [{
199 \ 'message': 'might be this',
201 \ 'uri': 'file:///tmp/someotherfile.txt',
203 \ 'start': { 'line': 42, 'character': 79 },
204 \ 'end': { 'line': 142, 'character': 179},
211 Execute(ale#lsp#response#ReadTSServerDiagnostics() should handle tsserver responses):
218 \ 'text': 'Operator ''''+'''' cannot be applied to types ''''3'''' and ''''{}''''.',
225 \ ale#lsp#response#ReadTSServerDiagnostics({"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/bar/foo.ts","diagnostics":[{"start":{"line":1,"offset":11},"end":{"line":1,"offset":17},"text":"Operator ''+'' cannot be applied to types ''3'' and ''{}''.","code":2365}]}})
227 Execute(ale#lsp#response#ReadTSServerDiagnostics() should handle warnings from tsserver):
238 \ 'text': 'Calls to ''console.log'' are not allowed. (no-console)',
241 \ ale#lsp#response#ReadTSServerDiagnostics({"seq":0,"type":"event","event":"semanticDiag","body":{"file":"<removed>","diagnostics":[{"start":{"line":27,"offset":3},"end":{"line":27,"offset":14},"text":"Calls to 'console.log' are not allowed. (no-console)","code":2515,"category":"warning","source":"tslint"}]}})
243 Execute(ale#lsp#response#ReadTSServerDiagnostics() should handle suggestions from tsserver):
254 \ 'text': 'Some info',
257 \ ale#lsp#response#ReadTSServerDiagnostics({"seq":0,"type":"event","event":"semanticDiag","body":{"file":"<removed>","diagnostics":[{"start":{"line":27,"offset":3},"end":{"line":27,"offset":14},"text":"Some info","code":2515,"category":"suggestion","source":"tslint"}]}})