1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

fix(lsp): remove quotes and period surrounding specifier in uncached messages (#19794)

This commit is contained in:
David Sherret 2023-07-10 22:27:22 -04:00 committed by GitHub
parent 0d8af65621
commit be9e73d340
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View file

@ -931,9 +931,9 @@ impl DenoDiagnostic {
Self::ImportMapRemap { from, to } => (lsp::DiagnosticSeverity::HINT, format!("The import specifier can be remapped to \"{to}\" which will resolve it via the active import map."), Some(json!({ "from": from, "to": to }))), Self::ImportMapRemap { from, to } => (lsp::DiagnosticSeverity::HINT, format!("The import specifier can be remapped to \"{to}\" which will resolve it via the active import map."), Some(json!({ "from": from, "to": to }))),
Self::InvalidAssertType(assert_type) => (lsp::DiagnosticSeverity::ERROR, format!("The module is a JSON module and expected an assertion type of \"json\". Instead got \"{assert_type}\"."), None), Self::InvalidAssertType(assert_type) => (lsp::DiagnosticSeverity::ERROR, format!("The module is a JSON module and expected an assertion type of \"json\". Instead got \"{assert_type}\"."), None),
Self::NoAssertType => (lsp::DiagnosticSeverity::ERROR, "The module is a JSON module and not being imported with an import assertion. Consider adding `assert { type: \"json\" }` to the import statement.".to_string(), None), Self::NoAssertType => (lsp::DiagnosticSeverity::ERROR, "The module is a JSON module and not being imported with an import assertion. Consider adding `assert { type: \"json\" }` to the import statement.".to_string(), None),
Self::NoCache(specifier) => (lsp::DiagnosticSeverity::ERROR, format!("Uncached or missing remote URL: \"{specifier}\"."), Some(json!({ "specifier": specifier }))), Self::NoCache(specifier) => (lsp::DiagnosticSeverity::ERROR, format!("Uncached or missing remote URL: {specifier}"), Some(json!({ "specifier": specifier }))),
Self::NoCacheNpm(pkg_ref, specifier) => (lsp::DiagnosticSeverity::ERROR, format!("Uncached or missing npm package: \"{}\".", pkg_ref.req), Some(json!({ "specifier": specifier }))), Self::NoCacheNpm(pkg_ref, specifier) => (lsp::DiagnosticSeverity::ERROR, format!("Uncached or missing npm package: {}", pkg_ref.req), Some(json!({ "specifier": specifier }))),
Self::NoLocal(specifier) => (lsp::DiagnosticSeverity::ERROR, format!("Unable to load a local module: \"{specifier}\".\n Please check the file path."), None), Self::NoLocal(specifier) => (lsp::DiagnosticSeverity::ERROR, format!("Unable to load a local module: {specifier}\n Please check the file path."), None),
Self::Redirect { from, to} => (lsp::DiagnosticSeverity::INFORMATION, format!("The import of \"{from}\" was redirected to \"{to}\"."), Some(json!({ "specifier": from, "redirect": to }))), Self::Redirect { from, to} => (lsp::DiagnosticSeverity::INFORMATION, format!("The import of \"{from}\" was redirected to \"{to}\"."), Some(json!({ "specifier": from, "redirect": to }))),
Self::ResolutionError(err) => ( Self::ResolutionError(err) => (
lsp::DiagnosticSeverity::ERROR, lsp::DiagnosticSeverity::ERROR,

View file

@ -3907,7 +3907,7 @@ fn lsp_code_actions_deno_cache() {
"severity": 1, "severity": 1,
"code": "no-cache", "code": "no-cache",
"source": "deno", "source": "deno",
"message": "Uncached or missing remote URL: \"https://deno.land/x/a/mod.ts\".", "message": "Uncached or missing remote URL: https://deno.land/x/a/mod.ts",
"data": { "specifier": "https://deno.land/x/a/mod.ts" } "data": { "specifier": "https://deno.land/x/a/mod.ts" }
}], }],
"version": 1 "version": 1
@ -3997,7 +3997,7 @@ fn lsp_code_actions_deno_cache_npm() {
"severity": 1, "severity": 1,
"code": "no-cache-npm", "code": "no-cache-npm",
"source": "deno", "source": "deno",
"message": "Uncached or missing npm package: \"chalk\".", "message": "Uncached or missing npm package: chalk",
"data": { "specifier": "npm:chalk" } "data": { "specifier": "npm:chalk" }
}], }],
"version": 1 "version": 1
@ -4024,7 +4024,7 @@ fn lsp_code_actions_deno_cache_npm() {
"severity": 1, "severity": 1,
"code": "no-cache-npm", "code": "no-cache-npm",
"source": "deno", "source": "deno",
"message": "Uncached or missing npm package: \"chalk\".", "message": "Uncached or missing npm package: chalk",
"data": { "specifier": "npm:chalk" } "data": { "specifier": "npm:chalk" }
}], }],
"only": ["quickfix"] "only": ["quickfix"]
@ -4044,7 +4044,7 @@ fn lsp_code_actions_deno_cache_npm() {
"severity": 1, "severity": 1,
"code": "no-cache-npm", "code": "no-cache-npm",
"source": "deno", "source": "deno",
"message": "Uncached or missing npm package: \"chalk\".", "message": "Uncached or missing npm package: chalk",
"data": { "specifier": "npm:chalk" } "data": { "specifier": "npm:chalk" }
}], }],
"command": { "command": {
@ -6125,7 +6125,7 @@ fn lsp_completions_node_specifier() {
"severity": 1, "severity": 1,
"code": "no-cache-npm", "code": "no-cache-npm",
"source": "deno", "source": "deno",
"message": "Uncached or missing npm package: \"@types/node\"." "message": "Uncached or missing npm package: @types/node"
} }
]) ])
); );

View file

@ -15,7 +15,7 @@
"severity": 1, "severity": 1,
"code": "no-cache", "code": "no-cache",
"source": "deno", "source": "deno",
"message": "Uncached or missing remote URL: \"https://example.com/a/b.d.ts\".", "message": "Uncached or missing remote URL: https://example.com/a/b.d.ts",
"data": { "data": {
"specifier": "https://example.com/a/b.d.ts" "specifier": "https://example.com/a/b.d.ts"
} }
@ -34,7 +34,7 @@
"severity": 1, "severity": 1,
"code": "no-cache", "code": "no-cache",
"source": "deno", "source": "deno",
"message": "Uncached or missing remote URL: \"https://example.com/a/e.js\".", "message": "Uncached or missing remote URL: https://example.com/a/e.js",
"data": { "data": {
"specifier": "https://example.com/a/e.js" "specifier": "https://example.com/a/e.js"
} }
@ -53,7 +53,7 @@
"severity": 1, "severity": 1,
"code": "no-cache", "code": "no-cache",
"source": "deno", "source": "deno",
"message": "Uncached or missing remote URL: \"https://example.com/a/e.d.ts\".", "message": "Uncached or missing remote URL: https://example.com/a/e.d.ts",
"data": { "data": {
"specifier": "https://example.com/a/e.d.ts" "specifier": "https://example.com/a/e.d.ts"
} }
@ -72,7 +72,7 @@
"severity": 1, "severity": 1,
"code": "no-cache", "code": "no-cache",
"source": "deno", "source": "deno",
"message": "Uncached or missing remote URL: \"https://example.com/a/d.js\".", "message": "Uncached or missing remote URL: https://example.com/a/d.js",
"data": { "data": {
"specifier": "https://example.com/a/d.js" "specifier": "https://example.com/a/d.js"
} }
@ -91,7 +91,7 @@
"severity": 1, "severity": 1,
"code": "no-cache", "code": "no-cache",
"source": "deno", "source": "deno",
"message": "Uncached or missing remote URL: \"https://example.com/a/d.d.ts\".", "message": "Uncached or missing remote URL: https://example.com/a/d.d.ts",
"data": { "data": {
"specifier": "https://example.com/a/d.d.ts" "specifier": "https://example.com/a/d.d.ts"
} }