{ "fileTypes": [ "rs" ], "foldingStartMarker": "^.*\\bfn\\s*(\\w+\\s*)?\\([^\\)]*\\)(\\s*\\{[^\\}]*)?\\s*$", "foldingStopMarker": "^\\s*\\}", "name": "Rust", "patterns": [ { "include": "#rust_comment_doc_block" }, { "include": "#rust_comment_block" }, { "include": "#rust_string" }, { "include": "#rust_raw_string" }, { "match": "\\b[A-Z]\\b", "name": "storage.type.source.rust" }, { "match": "\\b_*[A-Z][a-zA-Z0-9_]*[a-z][a-zA-Z0-9_]*\\b", "name": "storage.type.source.rust" }, { "match": "\\b(c_[a-z0-9_]+|[a-z_][a-z0-9_]*_t)\\b", "name": "storage.type.source.rust" }, { "match": "\\b([A-Z_][A-Z0-9_]+)\\b", "name": "constant.other.source.rust" }, { "match": "\\'[a-zA-Z_][a-zA-Z0-9_]*(?!\\')\\b", "name": "storage.modifier.lifetime.source.rust" }, { "begin": "\\'(?=([^\\'\\\\]|\\\\(x\\h{2}|u\\{\\h{1,6}\\}|n|r|t|0|\"|'|\\\\))\\')", "end": "\\'", "name": "string.quoted.single.source.rust", "patterns": [ { "include": "#rust_escaped_character" } ] }, { "captures": { "1": { "name": "keyword.other.source.rust" }, "2": { "name": "entity.name.function.source.rust" } }, "match": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\b", "name": "meta.function.source.rust" }, { "captures": { "1": { "name": "keyword.other.source.rust" }, "2": { "name": "entity.name.macro.source.rust" } }, "match": "\\b(macro_rules!)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\b", "name": "meta.macro.source.rust" }, { "match": "\\b(crate|enum|extern|fn|impl|let|mod|move|mut|pub|ref|static|struct|super|trait|type|unsafe|use|const|where)\\b", "name": "keyword.other.source.rust" }, { "match": "\\b(break|else|for|if|loop|match|return|while|continue)\\b", "name": "keyword.control.source.rust" }, { "match": "\\b(as|in|box)\\b", "name": "keyword.operator.source.rust" }, { "match": "\\b(virtual|proc|alignof|become|offsetof|priv|pure|sizeof|typeof|unsized|yield|do|abstract|final|override|macro)\\b", "name": "invalid.illegal.source.rust" }, { "match": "\\b(true|false)\\b", "name": "constant.language.source.rust" }, { "match": "\\b(self)\\b", "name": "variable.language.source.rust" }, { "match": "(?&|!~@.,;:?+*/%^'#$]|\\b_\\b", "name": "keyword.operator.source.rust" }, { "match": "[(){}\\[\\]]|::", "name": "meta.default.source.rust" }, { "match": "\\b[a-z_][a-z0-9_]*(?=\\()", "name": "support.function.source.rust" }, { "match": "\\b(Copy|Send|Sized|Sync|Drop|Fn|FnMut|FnOnce|Box|ToOwned|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator|Option|Some|None|Result|Ok|Err|SliceConcatExt|String|ToString|Vec)\\b", "name": "support.type.source.rust" } ], "repository": { "rust_comment_block": { "begin": "/\\*", "end": "\\*/", "name": "comment.block.source.rust", "patterns": [ { "include": "#rust_comment_block" }, { "include": "#rust_comment_doc_block" } ] }, "rust_comment_doc_block": { "begin": "/\\*[!\\*][^\\*/]", "end": "\\*/", "name": "comment.block.documentation.source.rust", "patterns": [ { "include": "#rust_comment_block" }, { "include": "#rust_comment_doc_block" } ] }, "rust_escaped_character": { "match": "\\\\(x\\h{2}|u\\{\\h{1,6}\\}|n|r|t|0|\"|'|\\\\)", "name": "constant.character.escape.source.rust" }, "rust_raw_string": { "begin": "r(#*)\"", "end": "\"(\\1)", "name": "string.quoted.double.raw.source.rust" }, "rust_string": { "begin": "\"", "end": "\"", "name": "string.quoted.double.source.rust", "patterns": [ { "include": "#rust_escaped_character" } ] } }, "scopeName": "source.rust", "uuid": "4339386b-4d67-4f0e-9e78-09ecbcddf71d" }