--- comment: I don't think anyone uses .hp. .cp tends to be paired with .h. (I could be wrong. :) -- chris fileTypes: - cc - cpp - cp - cxx - c++ - C - h - hh - hpp - h++ firstLineMatch: -\*- C\+\+ -\*- foldingStartMarker: "(?x)\n\ \t\t /\\*\\*(?!\\*)\n\ \t\t|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))\n\ \t" foldingStopMarker: (?" name: meta.angle-brackets.c++ patterns: - include: "#angle_brackets" - include: $base block: begin: \{ end: \} name: meta.block.c++ patterns: - captures: "1": name: support.function.any-method.c "2": name: punctuation.definition.parameters.c match: |- (?x) ( (?!while|for|do|if|else|switch|catch|enumerate|return|r?iterate)(?: \b[A-Za-z_][A-Za-z0-9_]*+\b | :: )*+ # actual name ) \s*(\() name: meta.function-call.c - include: $base constructor: patterns: - begin: "(?x)\n \t\t\t\t(?: ^\\s*) # begin-of-line\n \t\t\t\t((?!while|for|do|if|else|switch|catch|enumerate|r?iterate)[A-Za-z_][A-Za-z0-9_:]*) # actual name\n \t\t\t\t \\s*(\\() # start bracket or end-of-line\n \t\t\t" beginCaptures: "1": name: entity.name.function.c++ "2": name: punctuation.definition.parameters.c end: \) endCaptures: "0": name: punctuation.definition.parameters.c name: meta.function.constructor.c++ patterns: - include: $base - begin: "(?x)\n \t\t\t\t(:) # begin-of-line\n \t\t\t\t((?=\\s*[A-Za-z_][A-Za-z0-9_:]* # actual name\n \t\t\t\t \\s*(\\())) # start bracket or end-of-line\n \t\t\t" beginCaptures: "1": name: punctuation.definition.parameters.c end: (?=\{) name: meta.function.constructor.initializer-list.c++ patterns: - include: $base special_block: patterns: - begin: \b(namespace)\b\s*([_A-Za-z][_A-Za-z0-9]*\b)?+ beginCaptures: "1": name: storage.type.c++ "2": name: entity.name.type.c++ end: (?<=\})|(?=(;|,|\(|\)|>|\[|\]|=)) name: meta.namespace-block.c++ patterns: - begin: (\{) beginCaptures: "1": name: punctuation.definition.scope.c++ end: (\}) endCaptures: "1": name: punctuation.definition.invalid.c++ patterns: - include: "#special_block" - include: "#constructor" - include: $base - include: $base - begin: \b(class|struct)\b\s*([_A-Za-z][_A-Za-z0-9]*\b)?+ beginCaptures: "1": name: storage.type.c++ "2": name: entity.name.type.c++ end: (?<=\})|(?=(;|,|\(|\)|>|\[|\]|=)) name: meta.class-struct-block.c++ patterns: - include: "#angle_brackets" - begin: (\{) beginCaptures: "1": name: punctuation.definition.scope.c++ end: (\})(\s*\n)? endCaptures: "1": name: punctuation.definition.invalid.c++ "2": name: invalid.illegal.you-forgot-semicolon.c++ patterns: - include: "#special_block" - include: "#constructor" - include: $base - include: $base - begin: \b(extern)(?=\s*") beginCaptures: "1": name: storage.modifier.c++ end: (?<=\})|(?=\w) name: meta.extern-block.c++ patterns: - begin: \{ end: \} patterns: - include: "#special_block" - include: $base - include: $base scopeName: source.c++ uuid: 26251B18-6B1D-11D9-AFDB-000D93589AF6