From 404a7a63208b6829fcc3b2b6da2971ac6494dc4e Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Tue, 5 Nov 2024 01:12:51 +0530 Subject: [PATCH] Apply suggestions from code review Co-authored-by: David Sherret --- src/workspace/mod.rs | 6 +++--- src/workspace/resolver.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/workspace/mod.rs b/src/workspace/mod.rs index 672d305..f96f545 100644 --- a/src/workspace/mod.rs +++ b/src/workspace/mod.rs @@ -141,8 +141,8 @@ pub enum WorkspaceDiagnosticKind { previous: bool, suggestion: NodeModulesDirMode, }, - #[error("invalid workspace member \"{name}\".")] - InvalidMember { name: String }, + #[error("Invalid workspace member name \"{name}\". Ensure the name is in the format '@scope/name'.")] + InvalidMemberName { name: String }, } #[derive(Debug, Error, Clone, PartialEq, Eq)] @@ -681,7 +681,7 @@ impl Workspace { if !is_valid_jsr_pkg_name(name) { diagnostics.push(WorkspaceDiagnostic { config_url: config.specifier.clone(), - kind: WorkspaceDiagnosticKind::InvalidMember { name: name.clone() }, + kind: WorkspaceDiagnosticKind::InvalidMemberName { name: name.clone() }, }); } } diff --git a/src/workspace/resolver.rs b/src/workspace/resolver.rs index bca2cda..7ce7ae9 100644 --- a/src/workspace/resolver.rs +++ b/src/workspace/resolver.rs @@ -1530,7 +1530,7 @@ mod test { .first() .unwrap() .to_string() - .starts_with(r#"invalid workspace member "@deno-test/libs/math"."#)); + .starts_with(r#"Invalid workspace member name "@deno-test/libs/math"."#)); } fn create_resolver(workspace_dir: &WorkspaceDirectory) -> WorkspaceResolver {