{"record":{"id":"c5ad8ad4c1435ff2","repo":"zed-industries/zed","slug":"in-action-attribute","errorCode":null,"errorMessage":"in #[action] attribute: {}","messagePattern":"in #\\[action\\] attribute: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_macros/src/derive_action.rs","lineNumber":84,"sourceCode":"                    )?;\n                    deprecated_aliases.extend(aliases.into_iter().map(|lit| lit.value()));\n                } else if meta.path.is_ident(\"deprecated\") {\n                    if deprecated.is_some() {\n                        return Err(meta.error(\"'deprecated' argument specified multiple times\"));\n                    }\n                    meta.input.parse::<Token![=]>()?;\n                    let lit: LitStr = meta.input.parse()?;\n                    deprecated = Some(lit.value());\n                } else {\n                    return Err(meta.error(format!(\n                        \"'{:?}' argument not recognized, expected \\\n                        'namespace', 'no_json', 'no_register, 'deprecated_aliases', or 'deprecated'\",\n                        meta.path\n                    )));\n                }\n                Ok(())\n            })\n            .unwrap_or_else(|e| panic!(\"in #[action] attribute: {}\", e));\n        } else if attr.path().is_ident(\"doc\") {\n            use syn::{Expr::Lit, ExprLit, Lit::Str, Meta, MetaNameValue};\n            if let Meta::NameValue(MetaNameValue {\n                value:\n                    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    }","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_macros/src/derive_action.rs#L66-L102","documentation":"This panic comes from the #[action] proc macro in gpui_macros while it parses the attribute arguments on an action struct. When the macro meets an argument that is not one of the recognized keys, syn parsing fails and the macro panics with the parse error text, aborting compilation. Recognized keys are namespace, no_json, no_register, deprecated_aliases, and deprecated.","triggerScenarios":"Writing an action attribute with a typo or unknown key, e.g. #[action(deprecated_alises = \"x\")] or #[action(priority = 3)], or using a bare flag where a key = \"value\" pair is required. The panic occurs at compile time when cargo builds any crate containing the bad attribute.","commonSituations":"Misspelling one of the five accepted keys; copying attribute syntax from an older or newer gpui release whose accepted arguments differ; passing positional arguments to a macro that only accepts key-value pairs.","solutions":["Read the compiler output around the panic: the message lists the expected keys (namespace, no_json, no_register, deprecated_aliases, deprecated)","Fix the attribute to use only supported keys with correct types, e.g. #[action(namespace = \"zed\", deprecated = \"old name\")]","Pin/update gpui and gpui_macros to the version whose attribute grammar you are following, since accepted arguments changed across releases","If you need a new argument, add it explicitly to the parser loop in crates/gpui_macros/src/derive_action.rs rather than guessing"],"exampleFix":"// before\n#[action(deprecated_alises = \"Split\")]\nstruct SplitPane;\n\n// after\n#[action(deprecated_aliases = \"Split\")]\nstruct SplitPane;","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the accepted key list handy when writing action attributes: namespace, no_json, no_register, deprecated_aliases, deprecated","Run cargo check immediately after adding an action so the macro panic surfaces next to the typo","Pin one gpui/gpui_macros version per workspace so the attribute grammar matches the examples you copy"],"tags":["rust","proc-macro","gpui","compile-time","attribute"],"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"}