diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/lsp_tests.rs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index cbf272581..4ea4336a5 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -2515,6 +2515,55 @@ fn lsp_hover_typescript_types() { } #[test] +fn lsp_hover_jsr() { + let context = TestContextBuilder::new() + .use_http_server() + .use_temp_cwd() + .build(); + let temp_dir = context.temp_dir(); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + client.did_open(json!({ + "textDocument": { + "uri": temp_dir.uri().join("file.ts").unwrap(), + "languageId": "typescript", + "version": 1, + "text": "import \"jsr:@denotest/add@1.0.0\";\n", + } + })); + client.write_request( + "workspace/executeCommand", + json!({ + "command": "deno.cache", + "arguments": [[], temp_dir.uri().join("file.ts").unwrap()], + }), + ); + let res = client.write_request( + "textDocument/hover", + json!({ + "textDocument": { + "uri": temp_dir.uri().join("file.ts").unwrap(), + }, + "position": { "line": 0, "character": 7 }, + }), + ); + assert_eq!( + res, + json!({ + "contents": { + "kind": "markdown", + "value": "**Resolved Dependency**\n\n**Code**: jsr​:​@denotest/add​@1.0.0 (<http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts>)\n", + }, + "range": { + "start": { "line": 0, "character": 7 }, + "end": { "line": 0, "character": 32 }, + }, + }), + ); + client.shutdown(); +} + +#[test] fn lsp_hover_jsdoc_symbol_link() { let context = TestContextBuilder::new().use_temp_cwd().build(); let mut client = context.new_lsp_command().build(); |