{"record":{"id":"9dcd867f0250af00","repo":"zed-industries/zed","slug":"in-action-attribute-name-name-must-not","errorCode":null,"errorMessage":"in #[action] attribute: `name = \"{name}\" must not contain `::`, also specify `namespace` instead","messagePattern":"in #\\[action\\] attribute: `name = \"(.+?)\" must not contain `::`, also specify `namespace` instead","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_macros/src/derive_action.rs","lineNumber":107,"sourceCode":"                    Lit(ExprLit {\n                        lit: Str(ref lit_str),\n                        ..\n                    }),\n                ..\n            }) = attr.meta\n            {\n                let doc = lit_str.value();\n                let doc_str = doc_str.get_or_insert_default();\n                doc_str.push_str(doc.trim());\n                doc_str.push('\\n');\n            }\n        }\n    }\n\n    let name = name_argument.unwrap_or_else(|| struct_name.to_string());\n\n    if name.contains(\"::\") {\n        panic!(\n            \"in #[action] attribute: `name = \\\"{name}\\\"` must not contain `::`, \\\n            also specify `namespace` instead\"\n        );\n    }\n\n    let full_name = if let Some(namespace) = namespace {\n        format!(\"{namespace}::{name}\")\n    } else {\n        name\n    };\n\n    let is_unit_struct = matches!(&input.data, Data::Struct(data) if data.fields.is_empty());\n\n    let build_fn_body = if no_json {\n        let error_msg = format!(\"{} cannot be built from JSON\", full_name);\n        quote! { Err(gpui::private::anyhow::anyhow!(#error_msg)) }\n    } else if is_unit_struct {\n        quote! { Ok(Box::new(Self)) }","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_macros/src/derive_action.rs#L89-L125","documentation":"The #[action] macro rejects action names that contain the path separator '::'. Name and namespace are stored separately so the registry can compose the full action id as namespace::name; a '::' inside name itself would create ambiguous, nested ids. If the name argument (or the fallback struct name) contains '::', the macro panics at compile time and points you to the namespace argument instead.","triggerScenarios":"Compiling an action declared as #[action(name = \"workspace::split\")] - i.e. a fully-qualified name pasted into the name argument - instead of splitting it into #[action(namespace = \"workspace\", name = \"split\")].","commonSituations":"Copying fully-qualified action id strings (like the \"workspace::split\" names that appear in keymaps or the command palette) into the name argument; refactoring or renaming actions and moving qualifiers into the name field by accident.","solutions":["Move the qualifier into the namespace argument: #[action(namespace = \"workspace\", name = \"split\")]","Or remove the '::' portion and let the action keep only the leaf name","Re-run cargo check; the panic disappears once no name contains '::'"],"exampleFix":"// before\n#[action(name = \"workspace::split_pane\")]\nstruct SplitPane;\n\n// after\n#[action(namespace = \"workspace\", name = \"split_pane\")]\nstruct SplitPane;","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never paste fully-qualified names containing '::' into the name argument; keep the qualifier in namespace","Grep your tree for action attributes whose name value contains '::' before building","Derive names from the struct name and set namespace separately from the start"],"tags":["rust","proc-macro","gpui","action","naming"],"backgroundTag":"invalid-macro-argument","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}