{"record":{"id":"a208f090218ad9ff","repo":"denoland/deno","slug":"expected-attribute-arguments-in-parentheses","errorCode":null,"errorMessage":"expected attribute arguments in parentheses: `{}(...)`","messagePattern":"expected attribute arguments in parentheses: `(.+?)\\(\\.\\.\\.\\)`","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"libs/ops/op2/config.rs","lineNumber":384,"sourceCode":"      None\n    };\n\n    Ok(CustomMeta { ident, args })\n  }\n}\n\nimpl CustomMeta {\n  pub fn as_meta_list(&self) -> Option<MetaList> {\n    self.args.clone().map(|(delimiter, tokens)| MetaList {\n      path: syn::Path::from(self.ident.clone()),\n      delimiter,\n      tokens,\n    })\n  }\n\n  pub fn require_list(&self) -> Result<MetaList, syn::Error> {\n    self.as_meta_list().ok_or_else(|| {\n      syn::Error::new(\n        self.ident.span(),\n        format!(\n          \"expected attribute arguments in parentheses: `{}(...)`\",\n          self.ident\n        ),\n      )\n    })\n  }\n}\n\nimpl ToTokens for CustomMeta {\n  fn to_tokens(&self, tokens: &mut TokenStream) {\n    match self.as_meta_list() {\n      Some(list) => {\n        list.to_tokens(tokens);\n      }\n      _ => {\n        self.ident.to_tokens(tokens);","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/libs/ops/op2/config.rs#L366-L402","documentation":"`CustomMeta::require_list` in libs/ops/op2/config.rs returns the attribute's parenthesized arguments as a `MetaList`. If the attribute was written as a bare path (or a name=value) with no `(...)` group, `as_meta_list()` yields `None` and this error is raised on the attribute identifier, asking for the `ident(...)` form.","triggerScenarios":"Writing an op2/webidl sub-attribute that requires arguments without the parentheses, e.g. `#[op2(webidl)]` where the parser needs `webidl(...)` (as consumed via `input.parse::<CustomMeta>()?.require_list()`), or `#[op2(validate)]` instead of `#[op2(validate(path = \"...\"))]`.","commonSituations":"Converting a boolean-style flag into an argument-taking one during upgrades; trimming 'unnecessary' parentheses from a copy-pasted attribute; IDE auto-completing the bare path form.","solutions":["Add parentheses with the required arguments: `#[op2(webidl(...))]`, `#[op2(validate(...))]` — the error message names the exact identifier it wants arguments for.","If you intended a flag with no arguments, you are using the wrong flag name; check op2's flag list for the bare-path variant.","Consult a nearby op in the same crate (ext/ is full of examples) for the argument shape this attribute expects."],"exampleFix":"// before\n#[op2(webidl)]\n#[string] fn op_get_color(color: &str) -> String { /* ... */ }\n\n// after\n#[op2(webidl(default = Color::Red))]\n#[string] fn op_get_color(color: &str) -> String { /* ... */ }","handlingStrategy":"validation","validationCode":"// Compile-time only: keep `cargo check` in CI and read the combined parse errors.\n// Habit: argument-taking op2 attributes are always written as `name(...)` — never a bare path.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When copying an op2 attribute, copy the full `(...)` group, not just the identifier.","Look at neighboring ops in ext/ for the exact argument shape before inventing one."],"tags":["op2","proc-macro","attribute-syntax","missing-arguments","compile-time"],"backgroundTag":"missing-macro-arguments","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}