mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
fix(lsp): allow query strings for "deno:/status.md" (#20697)
This commit is contained in:
parent
46a4bd5178
commit
b433133a1f
2 changed files with 32 additions and 1 deletions
|
@ -3735,7 +3735,9 @@ impl Inner {
|
|||
let specifier = self
|
||||
.url_map
|
||||
.normalize_url(¶ms.text_document.uri, LspUrlKind::File);
|
||||
let contents = if specifier.as_str() == "deno:/status.md" {
|
||||
let contents = if specifier.scheme() == "deno"
|
||||
&& specifier.path() == "/status.md"
|
||||
{
|
||||
let mut contents = String::new();
|
||||
let mut documents_specifiers = self
|
||||
.documents
|
||||
|
|
|
@ -4320,6 +4320,35 @@ fn test_lsp_code_actions_ordering() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lsp_status_file() {
|
||||
let context = TestContextBuilder::new().use_temp_cwd().build();
|
||||
let mut client = context.new_lsp_command().build();
|
||||
client.initialize_default();
|
||||
|
||||
let res = client.write_request(
|
||||
"deno/virtualTextDocument",
|
||||
json!({
|
||||
"textDocument": {
|
||||
"uri": "deno:/status.md"
|
||||
}
|
||||
}),
|
||||
);
|
||||
let res = res.as_str().unwrap().to_string();
|
||||
assert!(res.starts_with("# Deno Language Server Status"));
|
||||
|
||||
let res = client.write_request(
|
||||
"deno/virtualTextDocument",
|
||||
json!({
|
||||
"textDocument": {
|
||||
"uri": "deno:/status.md?1"
|
||||
}
|
||||
}),
|
||||
);
|
||||
let res = res.as_str().unwrap().to_string();
|
||||
assert!(res.starts_with("# Deno Language Server Status"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lsp_code_actions_deno_cache() {
|
||||
let context = TestContextBuilder::new().use_temp_cwd().build();
|
||||
|
|
Loading…
Reference in a new issue