summaryrefslogtreecommitdiff
path: root/test/lsp
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-08-20 16:59:21 +0100
committerGitHub <noreply@github.com>2018-08-20 16:59:21 +0100
commita366d325a7c69fa20a3ab69ff8359bcd37d1487a (patch)
treedfca1aa7964cba0c2cf2555228546827d034279d /test/lsp
parent61a071683752b2824a222c484aa0243c05aa85b2 (diff)
parent4923d48d53a2ca64d2a125ff5ea4e4c9aa744f48 (diff)
downloadale-a366d325a7c69fa20a3ab69ff8359bcd37d1487a.zip
Merge pull request #1815 from fredemmott/lsp-related-information
If present, use new-ish LSP 'relatedInformation' field for :ALEDetail
Diffstat (limited to 'test/lsp')
-rw-r--r--test/lsp/test_read_lsp_diagnostics.vader29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/lsp/test_read_lsp_diagnostics.vader b/test/lsp/test_read_lsp_diagnostics.vader
index df187a24..be50fbe8 100644
--- a/test/lsp/test_read_lsp_diagnostics.vader
+++ b/test/lsp/test_read_lsp_diagnostics.vader
@@ -140,6 +140,35 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle multiple messages):
\ },
\ ]}})
+Execute(ale#lsp#response#ReadDiagnostics() should use relatedInformation for detail):
+ AssertEqual [
+ \ {
+ \ 'type': 'E',
+ \ 'text': 'Something went wrong!',
+ \ 'lnum': 1,
+ \ 'col': 3,
+ \ 'end_lnum': 1,
+ \ 'end_col': 3,
+ \ 'detail': "Something went wrong!\n/tmp/someotherfile.txt:43:80:\n\tmight be this"
+ \ }
+ \ ],
+ \ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
+ \ {
+ \ 'range': Range(0, 2, 0, 2),
+ \ 'message': 'Something went wrong!',
+ \ 'relatedInformation': [{
+ \ 'message': 'might be this',
+ \ 'location': {
+ \ 'uri': 'file:///tmp/someotherfile.txt',
+ \ 'range': {
+ \ 'start': { 'line': 42, 'character': 79 },
+ \ 'end': { 'line': 142, 'character': 179},
+ \ }
+ \ }
+ \ }]
+ \ }
+ \ ]}})
+
Execute(ale#lsp#response#ReadTSServerDiagnostics() should handle tsserver responses):
AssertEqual
\ [