diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2024-09-11 11:11:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-11 11:11:39 +0100 |
commit | ad30703e8e6bcf0fb87b5bc4ad1b49d040e54c77 (patch) | |
tree | d12ffffadb03aac3c93f0fd13499abccb5707160 /tests/integration/lsp_tests.rs | |
parent | 8bdd364dd568f93097ecee41e66c74d16d75c015 (diff) |
fix(lsp): encode url parts before parsing as uri (#25509)
Diffstat (limited to 'tests/integration/lsp_tests.rs')
-rw-r--r-- | tests/integration/lsp_tests.rs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 4c8372df6..cfd0da840 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -9722,6 +9722,51 @@ fn lsp_lockfile_redirect_resolution() { client.shutdown(); } +// Regression test for https://github.com/denoland/vscode_deno/issues/1157. +#[test] +fn lsp_diagnostics_brackets_in_file_name() { + let context = TestContextBuilder::new().use_temp_cwd().build(); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + let diagnostics = client.did_open(json!({ + "textDocument": { + "uri": "file:///a/%5Bfile%5D.ts", + "languageId": "typescript", + "version": 1, + "text": "/** @deprecated */\nexport const a = \"a\";\n\na;\n", + }, + })); + assert_eq!( + json!(diagnostics.all()), + json!([ + { + "range": { + "start": { "line": 3, "character": 0 }, + "end": { "line": 3, "character": 1 }, + }, + "severity": 4, + "code": 6385, + "source": "deno-ts", + "message": "'a' is deprecated.", + "relatedInformation": [ + { + "location": { + "uri": "file:///a/%5Bfile%5D.ts", + "range": { + "start": { "line": 0, "character": 4 }, + "end": { "line": 0, "character": 16 }, + }, + }, + "message": "The declaration was marked as deprecated here.", + }, + ], + "tags": [2], + }, + ]), + ); + client.shutdown(); +} + #[test] fn lsp_diagnostics_deprecated() { let context = TestContextBuilder::new().use_temp_cwd().build(); |