{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "stack": "rust",
  "description": "Rust code-graph rules. Adds what the graph needs on top of test-gap-rules/rust.json, which owns sourceExtensions, excludePathGlobs and the test-path predicates. Types and traits are the symbols; functions and methods come from the call analysis, which reads impl blocks.",
  "comments": {
    "line": ["//"],
    "block": [["/*", "*/"]],
    "string": ["\""],
    "dialect": "rust",
    "nested": true
  },
  "definitionPatterns": [
    {
      "id": "struct",
      "kind": "struct",
      "regex": "\\bstruct\\s+([A-Z][A-Za-z0-9_]*)"
    },
    {
      "id": "enum",
      "kind": "enum",
      "regex": "\\benum\\s+([A-Z][A-Za-z0-9_]*)"
    },
    {
      "id": "trait",
      "kind": "trait",
      "regex": "\\btrait\\s+([A-Z][A-Za-z0-9_]*)"
    },
    {
      "id": "type",
      "kind": "type",
      "regex": "\\btype\\s+([A-Z][A-Za-z0-9_]*)\\s*(?:<[^>]*>)?\\s*="
    },
    {
      "id": "fn",
      "kind": "fn",
      "regex": "^[ \\t]*(?:pub(?:\\([^)]*\\))?\\s+)?(?:async\\s+|const\\s+|unsafe\\s+)*fn\\s+([a-z_][A-Za-z0-9_]*)"
    }
  ],
  "importPatterns": [
    {
      "id": "use",
      "regex": "^\\s*(?:pub(?:\\([^)]*\\))?\\s+)?use\\s+(?:[A-Za-z_][A-Za-z0-9_]*::)*([A-Za-z_][A-Za-z0-9_]*)"
    }
  ],
  "referenceKinds": ["struct", "enum", "trait", "type"],
  "supertypes": {
    "syntax": "colon",
    "kinds": ["trait"]
  },
  "referenceKindsNote": "fn is absent for the reason the other stacks record: a bare lowercase name matched across files is rarely a call to that exact declaration. Call edges come from the call analysis instead.",
  "ignoredIdentifiers": [
    "self",
    "Self",
    "super",
    "crate",
    "fn",
    "let",
    "mut",
    "pub",
    "use",
    "mod",
    "impl",
    "trait",
    "struct",
    "enum",
    "type",
    "where",
    "match",
    "if",
    "else",
    "for",
    "while",
    "loop",
    "in",
    "return",
    "break",
    "continue",
    "as",
    "ref",
    "move",
    "static",
    "const",
    "unsafe",
    "async",
    "await",
    "dyn",
    "true",
    "false",
    "Some",
    "None",
    "Ok",
    "Err",
    "Option",
    "Result",
    "Vec",
    "String",
    "Box",
    "Rc",
    "Arc",
    "Default",
    "Debug",
    "Clone",
    "Copy"
  ]
}
