| { |
| "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", |
| "name": "FIDL", |
| "scopeName": "source.fidl", |
| "patterns": [ |
| { |
| "include": "#comments" |
| }, |
| { |
| "name": "meta.library.fidl", |
| "match": "\\b(library)\\b\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*)\\s*(;)", |
| "captures": { |
| "1": { |
| "name": "keyword.control" |
| }, |
| "2": { |
| "name": "entity.name.type" |
| }, |
| "3": { |
| "name": "punctuation.terminator" |
| } |
| } |
| }, |
| { |
| "name": "meta.library.fidl", |
| "match": "\\b(using)\\b\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*)\\s*(;)", |
| "captures": { |
| "1": { |
| "name": "keyword.control" |
| }, |
| "2": { |
| "name": "entity.name.type" |
| }, |
| "3": { |
| "name": "punctuation.terminator" |
| } |
| } |
| }, |
| { |
| "name": "meta.library.fidl", |
| "match": "\\b(using)\\b\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*)\\s*\\b(as)\\b\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(;)", |
| "captures": { |
| "1": { |
| "name": "keyword.control" |
| }, |
| "2": { |
| "name": "entity.name.type" |
| }, |
| "3": { |
| "name": "keyword.control" |
| }, |
| "4": { |
| "name": "entity.name.type" |
| }, |
| "5": { |
| "name": "punctuation.terminator" |
| } |
| } |
| }, |
| { |
| "name": "meta.library.fidl", |
| "match": "\\b(using)\\b\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(=)\\s*\\b(bool|float32|float64|int8|int16|int32|int64|uint8|uint16|uint32|uint64)\\b\\s*(;)", |
| "captures": { |
| "1": { |
| "name": "keyword.control" |
| }, |
| "2": { |
| "name": "entity.name.type" |
| }, |
| "3": { |
| "name": "punctuation.separator" |
| }, |
| "4": { |
| "name": "storage.type.basic" |
| }, |
| "5": { |
| "name": "punctuation.terminator" |
| } |
| } |
| }, |
| { |
| "name": "meta.const.fidl", |
| "match": "\\b(const)\\b\\s*\\b(bool|float32|float64|int8|int16|int32|int64|uint8|uint16|uint32|uint64)\\b\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(=)\\s*(?:@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*|(-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)\\b)|(\\b(?:true|false)\\b))\\s*(;)", |
| "captures": { |
| "1": { |
| "name": "keyword.control" |
| }, |
| "2": { |
| "name": "storage.type.basic" |
| }, |
| "3": { |
| "name": "variable.constant" |
| }, |
| "4": { |
| "name": "punctuation.separator" |
| }, |
| "5": { |
| "name": "constant.numeric" |
| }, |
| "6": { |
| "name": "constant.language" |
| }, |
| "7": { |
| "name": "punctuation.terminator" |
| } |
| } |
| }, |
| { |
| "name": "meta.interface-block.fidl", |
| "begin": "\\b(interface)\\b\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*{", |
| "beginCaptures": { |
| "1": { |
| "name": "keyword.control" |
| }, |
| "2": { |
| "name": "entity.name.type" |
| } |
| }, |
| "end": "}", |
| "endCaptures": {}, |
| "patterns": [ |
| { |
| "include": "#method" |
| }, |
| { |
| "include": "#comments" |
| } |
| ] |
| }, |
| { |
| "name": "meta.enum-block.fidl", |
| "begin": "\\b(enum)\\b\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(?:(:)\\s*\\b(bool|float32|float64|int8|int16|int32|int64|uint8|uint16|uint32|uint64)\\b)?\\s*{", |
| "beginCaptures": { |
| "1": { |
| "name": "keyword.control" |
| }, |
| "2": { |
| "name": "entity.name.type" |
| }, |
| "3": { |
| "name": "punctuation.separator" |
| }, |
| "4": { |
| "name": "storage.type.basic" |
| } |
| }, |
| "end": "}", |
| "endCaptures": {}, |
| "patterns": [ |
| { |
| "include": "#enum-member" |
| }, |
| { |
| "include": "#comments" |
| } |
| ] |
| }, |
| { |
| "name": "meta.struct-block.fidl", |
| "begin": "\\b(struct)\\b\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*{", |
| "beginCaptures": { |
| "1": { |
| "name": "keyword.control" |
| }, |
| "2": { |
| "name": "entity.name.type" |
| } |
| }, |
| "end": "}", |
| "endCaptures": {}, |
| "patterns": [ |
| { |
| "include": "#struct-member" |
| }, |
| { |
| "include": "#comments" |
| } |
| ] |
| }, |
| { |
| "name": "meta.union-block.fidl", |
| "begin": "\\b(union)\\b\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*{", |
| "beginCaptures": { |
| "1": { |
| "name": "keyword.control" |
| }, |
| "2": { |
| "name": "entity.name.type" |
| } |
| }, |
| "end": "}", |
| "endCaptures": {}, |
| "patterns": [ |
| { |
| "include": "#union-member" |
| }, |
| { |
| "include": "#comments" |
| } |
| ] |
| } |
| ], |
| "repository": { |
| "comments": { |
| "patterns": [ |
| { |
| "name": "comment.block.fidl", |
| "begin": "/\\*", |
| "beginCaptures": {}, |
| "end": "\\*/", |
| "endCaptures": {}, |
| "patterns": [] |
| }, |
| { |
| "name": "invalid.illegal.stray-comment-end.fidl", |
| "match": "\\*/.*\\n", |
| "captures": {} |
| }, |
| { |
| "name": "comment.line.double-slash.fidl", |
| "match": "//.*\\n", |
| "captures": {} |
| } |
| ] |
| }, |
| "method": { |
| "patterns": [ |
| { |
| "name": "meta.method.fidl", |
| "begin": "(-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)\\b)\\s*(:)\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)", |
| "beginCaptures": { |
| "1": { |
| "name": "constant.numeric" |
| }, |
| "2": { |
| "name": "punctuation.separator" |
| }, |
| "3": { |
| "name": "entity.name.function" |
| } |
| }, |
| "end": "(;)", |
| "endCaptures": { |
| "1": { |
| "name": "punctuation.terminator" |
| } |
| }, |
| "patterns": [ |
| { |
| "include": "#method-arguments" |
| }, |
| { |
| "match": "(->)", |
| "captures": { |
| "1": { |
| "name": "punctuation.separator" |
| } |
| } |
| } |
| ] |
| }, |
| { |
| "name": "meta.method.event.fidl", |
| "begin": "(-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)\\b)\\s*(:)\\s*(->)\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*[(]", |
| "beginCaptures": { |
| "1": { |
| "name": "constant.numeric" |
| }, |
| "2": { |
| "name": "punctuation.separator" |
| }, |
| "3": { |
| "name": "punctuation.separator" |
| }, |
| "4": { |
| "name": "entity.name.function" |
| } |
| }, |
| "end": "[)]\\s*(;)", |
| "endCaptures": { |
| "1": { |
| "name": "punctuation.terminator" |
| } |
| }, |
| "patterns": [ |
| { |
| "include": "#method-argument" |
| } |
| ] |
| } |
| ] |
| }, |
| "method-arguments": { |
| "patterns": [ |
| { |
| "name": "meta.method.arguments.fidl", |
| "begin": "\\(", |
| "beginCaptures": {}, |
| "end": "\\)", |
| "endCaptures": {}, |
| "patterns": [ |
| { |
| "include": "#method-argument" |
| } |
| ] |
| } |
| ] |
| }, |
| "method-argument": { |
| "patterns": [ |
| { |
| "name": "meta.method.argument.fidl", |
| "begin": "(?=[a-zA-Z_@])", |
| "beginCaptures": {}, |
| "end": "(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(?:(?:,)|(?=\\)))", |
| "endCaptures": { |
| "1": { |
| "name": "variable.name" |
| } |
| }, |
| "patterns": [ |
| { |
| "include": "#type" |
| }, |
| { |
| "match": "(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)", |
| "captures": { |
| "1": { |
| "name": "variable.parameter" |
| } |
| } |
| } |
| ] |
| } |
| ] |
| }, |
| "enum-member": { |
| "patterns": [ |
| { |
| "name": "meta.enum.member.fidl", |
| "match": "(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(=)\\s*(-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)\\b)\\s*(;)", |
| "captures": { |
| "1": { |
| "name": "variable" |
| }, |
| "2": { |
| "name": "punctuation.separator" |
| }, |
| "3": { |
| "name": "constant.numeric" |
| }, |
| "4": { |
| "name": "punctuation.terminator" |
| } |
| } |
| } |
| ] |
| }, |
| "struct-member": { |
| "patterns": [ |
| { |
| "name": "meta.struct.member.fidl", |
| "match": "(?:\\b(bool|float32|float64|int8|int16|int32|int64|uint8|uint16|uint32|uint64)\\b|(\\bhandle\\b(?:<(?:process|thread|vmo|event|port|log|socket|eventpair|job|vmar|fifo|timer|channel|interrupt)>)?([?])?)|(\\bstring\\b(?:[:](?:(-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)\\b)|@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*))?([?])?)|(\\b(request)\\b<(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*)>([?])?))\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(;)", |
| "captures": { |
| "1": { |
| "name": "storage.type.basic" |
| }, |
| "2": { |
| "name": "storage.type.basic" |
| }, |
| "3": { |
| "name": "punctuation.nullable" |
| }, |
| "4": { |
| "name": "storage.type.basic" |
| }, |
| "5": { |
| "name": "constant.numeric" |
| }, |
| "6": { |
| "name": "punctuation.nullable" |
| }, |
| "7": { |
| "name": "storage.type.basic" |
| }, |
| "8": { |
| "name": "keyword.control" |
| }, |
| "9": { |
| "name": "entity.type.name" |
| }, |
| "10": { |
| "name": "punctuation.nullable" |
| }, |
| "11": { |
| "name": "variable" |
| }, |
| "12": { |
| "name": "punctuation.terminator" |
| } |
| } |
| }, |
| { |
| "name": "meta.struct.member.fidl", |
| "match": "(?:\\b(bool|float32|float64|int8|int16|int32|int64|uint8|uint16|uint32|uint64)\\b|(\\bhandle\\b(?:<(?:process|thread|vmo|event|port|log|socket|eventpair|job|vmar|fifo|timer|channel|interrupt)>)?([?])?)|(\\bstring\\b(?:[:](?:(-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)\\b)|@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*))?([?])?)|(\\b(request)\\b<(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*)>([?])?))\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(=)\\s*(?:(-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)\\b)|(\\b(?:true|false)\\b)|(\"(?:[^\\\"]|\\.)*\"))\\s*(;)", |
| "captures": { |
| "1": { |
| "name": "storage.type.basic" |
| }, |
| "2": { |
| "name": "storage.type.basic" |
| }, |
| "3": { |
| "name": "punctuation.nullable" |
| }, |
| "4": { |
| "name": "storage.type.basic" |
| }, |
| "5": { |
| "name": "constant.numeric" |
| }, |
| "6": { |
| "name": "punctuation.nullable" |
| }, |
| "7": { |
| "name": "storage.type.basic" |
| }, |
| "8": { |
| "name": "keyword.control" |
| }, |
| "9": { |
| "name": "entity.type.name" |
| }, |
| "10": { |
| "name": "punctuation.nullable" |
| }, |
| "11": { |
| "name": "variable" |
| }, |
| "12": { |
| "name": "punctuation.separator" |
| }, |
| "13": { |
| "name": "constant.numeric" |
| }, |
| "14": { |
| "name": "constant.language" |
| }, |
| "15": { |
| "name": "string.quoted.double" |
| }, |
| "16": { |
| "name": "punctuation.terminator" |
| } |
| } |
| }, |
| { |
| "name": "meta.struct.member.fidl", |
| "match": "(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*([?])?)\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(;)", |
| "captures": { |
| "1": { |
| "name": "entity.name.type" |
| }, |
| "2": { |
| "name": "punctuation.nullable" |
| }, |
| "3": { |
| "name": "variable" |
| }, |
| "4": { |
| "name": "punctuation.terminator" |
| } |
| } |
| }, |
| { |
| "name": "meta.struct.member.fidl", |
| "begin": "(?=[a-zA-Z_@])", |
| "beginCaptures": {}, |
| "end": "(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(;)", |
| "endCaptures": { |
| "1": { |
| "name": "variable" |
| }, |
| "2": { |
| "name": "punctuation.terminator" |
| } |
| }, |
| "patterns": [ |
| { |
| "include": "#type" |
| } |
| ] |
| } |
| ] |
| }, |
| "union-member": { |
| "patterns": [ |
| { |
| "name": "meta.union.member.fidl", |
| "match": "(?:\\b(bool|float32|float64|int8|int16|int32|int64|uint8|uint16|uint32|uint64)\\b|(\\bhandle\\b(?:<(?:process|thread|vmo|event|port|log|socket|eventpair|job|vmar|fifo|timer|channel|interrupt)>)?([?])?)|(\\bstring\\b(?:[:](?:(-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)\\b)|@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*))?([?])?)|(\\b(request)\\b<(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*)>([?])?))\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(;)", |
| "captures": { |
| "1": { |
| "name": "storage.type.basic" |
| }, |
| "2": { |
| "name": "storage.type.basic" |
| }, |
| "3": { |
| "name": "punctuation.nullable" |
| }, |
| "4": { |
| "name": "storage.type.basic" |
| }, |
| "5": { |
| "name": "constant.numeric" |
| }, |
| "6": { |
| "name": "punctuation.nullable" |
| }, |
| "7": { |
| "name": "storage.type.basic" |
| }, |
| "8": { |
| "name": "keyword.control" |
| }, |
| "9": { |
| "name": "entity.type.name" |
| }, |
| "10": { |
| "name": "punctuation.nullable" |
| }, |
| "11": { |
| "name": "variable" |
| }, |
| "12": { |
| "name": "punctuation.terminator" |
| } |
| } |
| }, |
| { |
| "name": "meta.union.member.fidl", |
| "match": "(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*([?])?)\\s*(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(;)", |
| "captures": { |
| "1": { |
| "name": "entity.name.type" |
| }, |
| "2": { |
| "name": "punctuation.nullable" |
| }, |
| "3": { |
| "name": "variable" |
| }, |
| "4": { |
| "name": "punctuation.terminator" |
| } |
| } |
| }, |
| { |
| "name": "meta.union.member.fidl", |
| "begin": "(?=[a-zA-Z_@])", |
| "beginCaptures": {}, |
| "end": "(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)\\s*(;)", |
| "endCaptures": { |
| "1": { |
| "name": "variable" |
| }, |
| "2": { |
| "name": "punctuation.terminator" |
| } |
| }, |
| "patterns": [ |
| { |
| "include": "#type" |
| } |
| ] |
| } |
| ] |
| }, |
| "type": { |
| "patterns": [ |
| { |
| "include": "#array-type" |
| }, |
| { |
| "include": "#vector-type" |
| }, |
| { |
| "match": "(?:\\b(bool|float32|float64|int8|int16|int32|int64|uint8|uint16|uint32|uint64)\\b|(\\bhandle\\b(?:<(?:process|thread|vmo|event|port|log|socket|eventpair|job|vmar|fifo|timer|channel|interrupt)>)?([?])?)|(\\bstring\\b(?:[:](?:(-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)\\b)|@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*))?([?])?)|(\\b(request)\\b<(@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*)>([?])?))", |
| "captures": { |
| "1": { |
| "name": "storage.type.basic" |
| }, |
| "2": { |
| "name": "storage.type.basic" |
| }, |
| "3": { |
| "name": "punctuation.nullable" |
| }, |
| "4": { |
| "name": "storage.type.basic" |
| }, |
| "5": { |
| "name": "constant.numeric" |
| }, |
| "6": { |
| "name": "punctuation.nullable" |
| }, |
| "7": { |
| "name": "storage.type.basic" |
| }, |
| "8": { |
| "name": "keyword.control" |
| }, |
| "9": { |
| "name": "entity.type.name" |
| }, |
| "10": { |
| "name": "punctuation.nullable" |
| } |
| } |
| } |
| ] |
| }, |
| "array-type": { |
| "patterns": [ |
| { |
| "name": "storage.type.array.fidl", |
| "begin": "\\b(array)\\b<", |
| "beginCaptures": { |
| "1": { |
| "name": "storage.type.array" |
| } |
| }, |
| "end": ">[:](?:(-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)\\b)|@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*)", |
| "endCaptures": { |
| "1": { |
| "name": "constant.numeric" |
| } |
| }, |
| "patterns": [ |
| { |
| "include": "#type" |
| } |
| ] |
| } |
| ] |
| }, |
| "vector-type": { |
| "patterns": [ |
| { |
| "name": "storage.type.vector.fidl", |
| "begin": "\\b(vector)\\b<", |
| "beginCaptures": { |
| "1": { |
| "name": "storage.type.array" |
| } |
| }, |
| "end": ">(?:[:](?:(-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)\\b)|@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b(?:\\.@?\\b[a-zA-Z_][0-9a-zA-Z_]*\\b)*))?([?])?", |
| "endCaptures": { |
| "1": { |
| "name": "constant.numeric" |
| }, |
| "2": { |
| "name": "punctuation.nullable" |
| } |
| }, |
| "patterns": [ |
| { |
| "include": "#type" |
| } |
| ] |
| } |
| ] |
| } |
| } |
| } |