summaryrefslogtreecommitdiff
path: root/test/lsp
diff options
context:
space:
mode:
authoryoshi1123 <65735241+yoshi1123@users.noreply.github.com>2022-03-04 14:03:27 -0500
committerGitHub <noreply@github.com>2022-03-04 19:03:27 +0000
commite490e87a60af7c5c630434aa7d980d01b4d03ecc (patch)
treee7629ff7c46a20fd802e935c6a79cbbe1e6965ff /test/lsp
parentb42153eb1786fbff1c926e60c23ba82b0108f0cc (diff)
downloadale-e490e87a60af7c5c630434aa7d980d01b4d03ecc.zip
Add eclipselsp jdt:// support for textDocument/definition (#4030)
This patch adds support for opening jdt:// links on "go to definition" requests returned by Java language servers. Co-authored-by: w0rp <devw0rp@gmail.com>
Diffstat (limited to 'test/lsp')
-rw-r--r--test/lsp/test_closing_documents.vader20
-rw-r--r--test/lsp/test_did_save_event.vader8
-rw-r--r--test/lsp/test_engine_lsp_response_handling.vader4
-rw-r--r--test/lsp/test_lsp_client_messages.vader22
-rw-r--r--test/lsp/test_lsp_startup.vader4
5 files changed, 29 insertions, 29 deletions
diff --git a/test/lsp/test_closing_documents.vader b/test/lsp/test_closing_documents.vader
index e6e11415..b9f2f824 100644
--- a/test/lsp/test_closing_documents.vader
+++ b/test/lsp/test_closing_documents.vader
@@ -63,7 +63,7 @@ Execute(A message should be sent if the document was opened):
\ [
\ ['command:/foo', 1, 'textDocument/didOpen', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ 'version': g:ale_lsp_next_version_id - 1,
\ 'languageId': 'lang',
\ 'text': "\n",
@@ -71,7 +71,7 @@ Execute(A message should be sent if the document was opened):
\ }],
\ ['command:/foo', 1, 'textDocument/didClose', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ },
\ }],
\ ],
@@ -106,7 +106,7 @@ Execute(Re-opening and closing the documents should work):
\ [
\ ['command:/foo', 1, 'textDocument/didOpen', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ 'version': g:ale_lsp_next_version_id - 2,
\ 'languageId': 'lang',
\ 'text': "\n",
@@ -114,12 +114,12 @@ Execute(Re-opening and closing the documents should work):
\ }],
\ ['command:/foo', 1, 'textDocument/didClose', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ },
\ }],
\ ['command:/foo', 1, 'textDocument/didOpen', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ 'version': g:ale_lsp_next_version_id - 1,
\ 'languageId': 'lang',
\ 'text': "\n",
@@ -127,7 +127,7 @@ Execute(Re-opening and closing the documents should work):
\ }],
\ ['command:/foo', 1, 'textDocument/didClose', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ },
\ }],
\ ],
@@ -148,7 +148,7 @@ Execute(Messages for closing documents should be sent to each server):
\ [
\ ['command:/foo', 1, 'textDocument/didOpen', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ 'version': g:ale_lsp_next_version_id - 2,
\ 'languageId': 'lang',
\ 'text': "\n",
@@ -156,7 +156,7 @@ Execute(Messages for closing documents should be sent to each server):
\ }],
\ ['command:/bar', 1, 'textDocument/didOpen', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ 'version': g:ale_lsp_next_version_id - 1,
\ 'languageId': 'lang',
\ 'text': "\n",
@@ -164,12 +164,12 @@ Execute(Messages for closing documents should be sent to each server):
\ }],
\ ['command:/bar', 1, 'textDocument/didClose', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ },
\ }],
\ ['command:/foo', 1, 'textDocument/didClose', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ },
\ }],
\ ],
diff --git a/test/lsp/test_did_save_event.vader b/test/lsp/test_did_save_event.vader
index fbec10e5..fc73c4d6 100644
--- a/test/lsp/test_did_save_event.vader
+++ b/test/lsp/test_did_save_event.vader
@@ -94,7 +94,7 @@ Execute(Server should be notified on save):
\ [
\ [1, 'textDocument/didChange', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ 'version': g:ale_lsp_next_version_id - 1,
\ },
\ 'contentChanges': [{'text': join(getline(1, '$'), "\n") . "\n"}],
@@ -118,14 +118,14 @@ Execute(Server should be notified on save with didSave is supported by server):
\ [
\ [1, 'textDocument/didChange', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ 'version': g:ale_lsp_next_version_id - 1,
\ },
\ 'contentChanges': [{'text': join(getline(1, '$'), "\n") . "\n"}],
\ }],
\ [1, 'textDocument/didSave', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ },
\ }],
\ ],
@@ -138,7 +138,7 @@ Execute(Server should be notified on change):
\ [
\ [1, 'textDocument/didChange', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ 'version': g:ale_lsp_next_version_id - 1,
\ },
\ 'contentChanges': [{'text': join(getline(1, '$'), "\n") . "\n"}],
diff --git a/test/lsp/test_engine_lsp_response_handling.vader b/test/lsp/test_engine_lsp_response_handling.vader
index 1c5082c5..6f46699a 100644
--- a/test/lsp/test_engine_lsp_response_handling.vader
+++ b/test/lsp/test_engine_lsp_response_handling.vader
@@ -314,7 +314,7 @@ Execute(LSP diagnostics responses should be handled correctly):
\ 'jsonrpc':'2.0',
\ 'method':'textDocument/publishDiagnostics',
\ 'params': {
- \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
\ 'diagnostics': [
\ {
\ 'range': {
@@ -403,7 +403,7 @@ Execute(LSP errors should mark linters no longer active):
call ale#lsp_linter#HandleLSPResponse(1, {
\ 'method': 'textDocument/publishDiagnostics',
\ 'params': {
- \ 'uri': ale#path#ToURI(g:dir . '/filename.py'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/filename.py'),
\ 'diagnostics': [],
\ },
\})
diff --git a/test/lsp/test_lsp_client_messages.vader b/test/lsp/test_lsp_client_messages.vader
index 4c6b0ffa..65fdaa67 100644
--- a/test/lsp/test_lsp_client_messages.vader
+++ b/test/lsp/test_lsp_client_messages.vader
@@ -44,7 +44,7 @@ Execute(ale#lsp#message#DidOpen() should return correct messages):
\ 'textDocument/didOpen',
\ {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/foo/bar.ts'),
\ 'languageId': 'typescript',
\ 'version': 12,
\ 'text': "foo()\nbar()\nbaz()\n",
@@ -62,7 +62,7 @@ Execute(ale#lsp#message#DidChange() should return correct messages):
\ 'textDocument/didChange',
\ {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/foo/bar.ts'),
\ 'version': 34,
\ },
\ 'contentChanges': [{'text': "foo()\nbar()\nbaz()\n"}],
@@ -84,7 +84,7 @@ Execute(ale#lsp#message#DidSave() should return correct messages):
\ 'textDocument/didSave',
\ {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/foo/bar.ts'),
\ },
\ }
\ ],
@@ -97,7 +97,7 @@ Execute(ale#lsp#message#DidSave() should return correct message with includeText
\ 'textDocument/didSave',
\ {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/foo/bar.ts'),
\ 'version': 1,
\ },
\ 'text': ale#util#GetBufferContents(bufnr('')),
@@ -112,7 +112,7 @@ Execute(ale#lsp#message#DidClose() should return correct messages):
\ 'textDocument/didClose',
\ {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/foo/bar.ts'),
\ },
\ }
\ ],
@@ -125,7 +125,7 @@ Execute(ale#lsp#message#Completion() should return correct messages):
\ 'textDocument/completion',
\ {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/foo/bar.ts'),
\ },
\ 'position': {'line': 11, 'character': 33},
\ }
@@ -139,7 +139,7 @@ Execute(ale#lsp#message#Completion() should return correct messages with a trigg
\ 'textDocument/completion',
\ {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/foo/bar.ts'),
\ },
\ 'position': {'line': 11, 'character': 33},
\ 'context': {'triggerKind': 2, 'triggerCharacter': '.'},
@@ -154,7 +154,7 @@ Execute(ale#lsp#message#Definition() should return correct messages):
\ 'textDocument/definition',
\ {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/foo/bar.ts'),
\ },
\ 'position': {'line': 11, 'character': 33},
\ }
@@ -168,7 +168,7 @@ Execute(ale#lsp#message#TypeDefinition() should return correct messages):
\ 'textDocument/typeDefinition',
\ {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/foo/bar.ts'),
\ },
\ 'position': {'line': 11, 'character': 33},
\ }
@@ -182,7 +182,7 @@ Execute(ale#lsp#message#References() should return correct messages):
\ 'textDocument/references',
\ {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/foo/bar.ts'),
\ },
\ 'position': {'line': 11, 'character': 33},
\ 'context': {'includeDeclaration': v:false},
@@ -208,7 +208,7 @@ Execute(ale#lsp#message#Hover() should return correct messages):
\ 'textDocument/hover',
\ {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
+ \ 'uri': ale#path#ToFileURI(g:dir . '/foo/bar.ts'),
\ },
\ 'position': {'line': 11, 'character': 33},
\ }
diff --git a/test/lsp/test_lsp_startup.vader b/test/lsp/test_lsp_startup.vader
index f0afe39c..21c61e13 100644
--- a/test/lsp/test_lsp_startup.vader
+++ b/test/lsp/test_lsp_startup.vader
@@ -138,7 +138,7 @@ Before:
\ 'id': 1,
\ 'params': {
\ 'initializationOptions': {},
- \ 'rootUri': ale#path#ToURI(a:root),
+ \ 'rootUri': ale#path#ToFileURI(a:root),
\ 'rootPath': a:root,
\ 'processId': getpid(),
\ 'capabilities': {
@@ -253,7 +253,7 @@ Before:
\ 'jsonrpc': '2.0',
\ 'params': {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#path#ToFileURI(expand('#' . a:buffer . ':p')),
\ 'version': ale#lsp#message#GetNextVersionID() - 1,
\ 'languageId': a:language,
\ 'text': "\n",