From 286abd12d3adf3fdb3ed90a71b9dd8e8af4bf841 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 22 Apr 2018 19:49:24 +0100 Subject: Add support for finding references using LSP servers or tsserver --- test/lsp/test_lsp_client_messages.vader | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test/lsp/test_lsp_client_messages.vader') diff --git a/test/lsp/test_lsp_client_messages.vader b/test/lsp/test_lsp_client_messages.vader index 053da803..b0f0ed2b 100644 --- a/test/lsp/test_lsp_client_messages.vader +++ b/test/lsp/test_lsp_client_messages.vader @@ -144,6 +144,21 @@ Execute(ale#lsp#message#Definition() should return correct messages): \ ], \ ale#lsp#message#Definition(bufnr(''), 12, 34) +Execute(ale#lsp#message#References() should return correct messages): + AssertEqual + \ [ + \ 0, + \ 'textDocument/references', + \ { + \ 'textDocument': { + \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'), + \ }, + \ 'position': {'line': 11, 'character': 34}, + \ 'context': {'includeDeclaration': v:false}, + \ } + \ ], + \ ale#lsp#message#References(bufnr(''), 12, 34) + Execute(ale#lsp#tsserver_message#Open() should return correct messages): AssertEqual \ [ @@ -233,3 +248,16 @@ Execute(ale#lsp#tsserver_message#Definition() should return correct messages): \ } \ ], \ ale#lsp#tsserver_message#Definition(bufnr(''), 347, 12) + +Execute(ale#lsp#tsserver_message#References() should return correct messages): + AssertEqual + \ [ + \ 0, + \ 'ts@references', + \ { + \ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'), + \ 'line': 347, + \ 'offset': 12, + \ } + \ ], + \ ale#lsp#tsserver_message#References(bufnr(''), 347, 12) -- cgit v1.2.3