{ "fileTypes": [ "dart" ], "foldingStartMarker": "\\{\\s*$", "foldingStopMarker": "^\\s*\\}", "name": "Dart", "patterns": [ { "match": "^(#!.*)$", "name": "meta.preprocessor.script.dart" }, { "begin": "^\\w*\\b(library|import|part of|part|export)\\b", "beginCaptures": { "0": { "name": "keyword.other.import.dart" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.terminator.dart" } }, "name": "meta.declaration.dart", "patterns": [ { "include": "#strings" }, { "match": "\\b(as|show|hide)\\b", "name": "keyword.other.import.dart" } ] }, { "include": "#comments" }, { "include": "#punctuation" }, { "include": "#annotations" }, { "include": "#constants-and-special-vars" }, { "include": "#keywords" }, { "include": "#strings" } ], "repository": { "dartdoc": { "patterns": [ { "match": "(\\[.*?\\])", "captures": { "0": { "name": "variable.name.source.dart" } } }, { "match": "(`.*?`)", "captures": { "0": { "name": "variable.other.source.dart" } } }, { "match": "(\\* (( ).*))$", "captures": { "2": { "name": "variable.other.source.dart" } } }, { "match": "(\\* .*)$" } ] }, "comments": { "patterns": [ { "captures": { "0": { "name": "punctuation.definition.comment.dart" } }, "match": "/\\*\\*/", "name": "comment.block.empty.dart" }, { "include": "#comments-doc-oldschool" }, { "include": "#comments-doc" }, { "include": "#comments-inline" } ] }, "comments-doc-oldschool": { "patterns": [ { "begin": "/\\*\\*", "end": "\\*/", "name": "comment.block.documentation.dart", "patterns": [ { "include": "#dartdoc" } ] } ] }, "comments-doc": { "patterns": [ { "match": "(///) (.*?)$", "captures": { "1": { "name": "comment.block.triple-slash.dart" }, "2": { "name": "variable.other.source.dart" } } }, { "match": "(///)(.*?)$", "captures": { "1": { "name": "comment.block.triple-slash.dart" }, "2": { "name": "comment.block.documentation.dart", "patterns": [ { "include": "#dartdoc" } ] } } } ] }, "comments-inline": { "patterns": [ { "begin": "/\\*", "end": "\\*/", "name": "comment.block.dart" }, { "captures": { "1": { "name": "comment.line.double-slash.dart" } }, "match": "((//).*)$" } ] }, "annotations": { "patterns": [ { "match": "@[a-zA-Z]+", "name": "storage.type.annotation.dart" } ] }, "constants-and-special-vars": { "patterns": [ { "match": "\\b(true|false|null)\\b", "name": "constant.language.dart" }, { "match": "\\b(this|super)\\b", "name": "variable.language.dart" }, { "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b", "name": "constant.numeric.dart" }, { "match": "\\b_?[A-Z][a-zA-Z0-9_]+\\b", "name": "support.class.dart" }, { "match": "(_?[a-z][a-zA-Z0-9_]+)(\\(|\\s+=>)", "captures": { "1": { "name": "entity.name.function.dart" } } }, { "match": "\\b[A-Z_0-9]+\\b", "name": "support.constant.dart" } ] }, "keywords": { "patterns": [ { "match": "\\bas\\b", "name": "keyword.cast.dart" }, { "match": "\\b(try|on|catch|finally|throw|rethrow)\\b", "name": "keyword.control.catch-exception.dart" }, { "match": "\\b(break|case|continue|default|do|else|for|if|in|return|switch|while)\\b", "name": "keyword.control.dart" }, { "match": "\\b(sync(\\*)?|async(\\*)?|await|yield(\\*)?)\\b", "name": "keyword.control.dart" }, { "match": "\\bassert\\b", "name": "keyword.control.dart" }, { "match": "\\b(new)\\b", "name": "keyword.control.new.dart" }, { "match": "\\b(abstract|class|enum|extends|external|factory|implements|interface|get|native|operator|set|typedef|with)\\b", "name": "keyword.declaration.dart" }, { "match": "\\b(is\\!?)\\b", "name": "keyword.operator.dart" }, { "match": "\\?|:", "name": "keyword.operator.ternary.dart" }, { "match": "(<<|>>>?|~|\\^|\\||&)", "name": "keyword.operator.bitwise.dart" }, { "match": "((&|\\^|\\||<<|>>>?)=)", "name": "keyword.operator.assignment.bitwise.dart" }, { "match": "(==|!=|<=?|>=?)", "name": "keyword.operator.comparison.dart" }, { "match": "(([+*/%-]|\\~)=)", "name": "keyword.operator.assignment.arithmetic.dart" }, { "match": "(=)", "name": "keyword.operator.assignment.dart" }, { "match": "(\\-\\-|\\+\\+)", "name": "keyword.operator.increment-decrement.dart" }, { "match": "(\\-|\\+|\\*|\\/|\\~\\/|%)", "name": "keyword.operator.arithmetic.dart" }, { "match": "(!|&&|\\|\\|)", "name": "keyword.operator.logical.dart" }, { "match": "\\b(static|final|const)\\b", "name": "storage.modifier.dart" }, { "match": "\\b(?:void|bool|num|int|double|dynamic|var)\\b", "name": "storage.type.primitive.dart" } ] }, "string-interp": { "patterns": [ { "captures": { "2": { "name": "variable.parameter.dart" }, "3": { "name": "variable.parameter.dart" } }, "match": "\\$((\\w+)|\\{(\\w+)\\})" }, { "match": "\\\\.", "name": "constant.character.escape.dart" } ] }, "strings": { "patterns": [ { "begin": "(?