From 484a70f0c0c9109ab6825fa67e481d862237207c Mon Sep 17 00:00:00 2001 From: Fred Emmott Date: Wed, 15 Aug 2018 14:19:32 -0700 Subject: Use new-ish LSP 'relatedInformation' field for :ALEDetail --- test/lsp/test_read_lsp_diagnostics.vader | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'test') diff --git a/test/lsp/test_read_lsp_diagnostics.vader b/test/lsp/test_read_lsp_diagnostics.vader index df187a24..c1df55f0 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, + \ 'relatedInformation': [{ + \ 'message': 'might be this', + \ 'location': { + \ 'uri': 'file:///tmp/someotherfile.txt', + \ 'range': { + \ 'start': { 'line': 42, 'character': 79 }, + \ 'end': { 'line': 43, 'character': 80 }, + \ } + \ } + \ }] + \ } + \ ], + \ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [ + \ { + \ 'range': Range(0, 2, 0, 2), + \ 'message': 'Something went wrong!', + \ 'detail': 'file:///tmp/someotherfile.txt:42:79: might be this' + \ } + \ ]}}) + Execute(ale#lsp#response#ReadTSServerDiagnostics() should handle tsserver responses): AssertEqual \ [ -- cgit v1.2.3