diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2023-09-07 08:09:16 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-07 09:09:16 -0400 |
| commit | 3fc19dab47492e06043fc7add28e64693a4eb775 (patch) | |
| tree | 855e952933662aef37bd20c084901ae0e488b2db /cli/lsp | |
| parent | 01a761f1d4f7ff4943fbf80464a276b434d8a8f7 (diff) | |
feat: support import attributes (#20342)
Diffstat (limited to 'cli/lsp')
| -rw-r--r-- | cli/lsp/diagnostics.rs | 37 | ||||
| -rw-r--r-- | cli/lsp/documents.rs | 52 | ||||
| -rw-r--r-- | cli/lsp/registries.rs | 10 |
3 files changed, 66 insertions, 33 deletions
diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs index 0bee08c1d..fd4142fd9 100644 --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -871,9 +871,9 @@ pub enum DenoDiagnostic { /// remapped to an import map import specifier. ImportMapRemap { from: String, to: String }, /// The import assertion type is incorrect. - InvalidAssertType(String), - /// A module requires an assertion type to be a valid import. - NoAssertType, + InvalidAttributeType(String), + /// A module requires an attribute type to be a valid import. + NoAttributeType, /// A remote module was not found in the cache. NoCache(ModuleSpecifier), /// A remote npm package reference was not found in the cache. @@ -897,8 +897,8 @@ impl DenoDiagnostic { match self { Self::DenoWarn(_) => "deno-warn", Self::ImportMapRemap { .. } => "import-map-remap", - Self::InvalidAssertType(_) => "invalid-assert-type", - Self::NoAssertType => "no-assert-type", + Self::InvalidAttributeType(_) => "invalid-attribute-type", + Self::NoAttributeType => "no-attribute-type", Self::NoCache(_) => "no-cache", Self::NoCacheNpm(_, _) => "no-cache-npm", Self::NoLocal(_) => "no-local", @@ -958,15 +958,15 @@ impl DenoDiagnostic { ..Default::default() } } - "no-assert-type" => lsp::CodeAction { - title: "Insert import assertion.".to_string(), + "no-attribute-type" => lsp::CodeAction { + title: "Insert import attribute.".to_string(), kind: Some(lsp::CodeActionKind::QUICKFIX), diagnostics: Some(vec![diagnostic.clone()]), edit: Some(lsp::WorkspaceEdit { changes: Some(HashMap::from([( specifier.clone(), vec