1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-03 12:58:54 -05:00

lsp: use deno:/asset instead of deno:asset (#16023)

Make offering "virtual documents" via the lsp easier to parse. `deno:`
can be ambiguous to parse by editors (can conflict with linux paths)

Neovim recently landed a PR https://github.com/neovim/neovim/pull/19797
that allows it to parse `scheme:/` this PR should make deno lsp work
correctly in neovim
This commit is contained in:
sigmaSd 2022-10-01 19:02:25 +01:00 committed by GitHub
parent ecfafda9d8
commit a6618dc01c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -101,7 +101,7 @@ impl LspUrlMap {
specifier.clone() specifier.clone()
} else { } else {
let specifier_str = if specifier.scheme() == "asset" { let specifier_str = if specifier.scheme() == "asset" {
format!("deno:asset{}", specifier.path()) format!("deno:/asset{}", specifier.path())
} else if specifier.scheme() == "data" { } else if specifier.scheme() == "data" {
let data_url = DataUrl::process(specifier.as_str()) let data_url = DataUrl::process(specifier.as_str())
.map_err(|e| uri_error(format!("{:?}", e)))?; .map_err(|e| uri_error(format!("{:?}", e)))?;

View file

@ -987,7 +987,7 @@ fn lsp_hover_asset() {
"deno/virtualTextDocument", "deno/virtualTextDocument",
json!({ json!({
"textDocument": { "textDocument": {
"uri": "deno:asset/lib.deno.shared_globals.d.ts" "uri": "deno:/asset/lib.deno.shared_globals.d.ts"
} }
}), }),
) )
@ -998,7 +998,7 @@ fn lsp_hover_asset() {
"textDocument/hover", "textDocument/hover",
json!({ json!({
"textDocument": { "textDocument": {
"uri": "deno:asset/lib.es2015.symbol.wellknown.d.ts" "uri": "deno:/asset/lib.es2015.symbol.wellknown.d.ts"
}, },
"position": { "position": {
"line": 109, "line": 109,
@ -2810,7 +2810,7 @@ fn lsp_code_lens_non_doc_nav_tree() {
"deno/virtualTextDocument", "deno/virtualTextDocument",
json!({ json!({
"textDocument": { "textDocument": {
"uri": "deno:asset/lib.deno.shared_globals.d.ts" "uri": "deno:/asset/lib.deno.shared_globals.d.ts"
} }
}), }),
) )
@ -2822,7 +2822,7 @@ fn lsp_code_lens_non_doc_nav_tree() {
"textDocument/codeLens", "textDocument/codeLens",
json!({ json!({
"textDocument": { "textDocument": {
"uri": "deno:asset/lib.deno.shared_globals.d.ts" "uri": "deno:/asset/lib.deno.shared_globals.d.ts"
} }
}), }),
) )