#Syntax Highlighting
This document describes the currently implemented Masterbelt syntax highlighting captures.
Highlighting covers every keyword and the language's declarations, bindings, match patterns, type expressions, operators, literals, and comments. Future captures must extend this document before or together with query changes.
#Captures
Keywords:
visibility_modifieris captured as@keyword.- The
constkeyword is captured as@keyword. - The
typekeyword is captured as@keyword. - The
usekeyword is captured as@keyword. - The
fromkeyword is captured as@keyword. - The
askeyword is captured as@keyword. field_modifier(readonly,writable,primary) is captured as@keyword.modifier.effect_modifier(asyncable,failable,cancellable) is captured as@keyword.modifier.- The
fnkeyword is captured as@keyword. - The
enumkeyword is captured as@keyword. - The
returnkeyword is captured as@keyword. - The
master,record, andsourcekeywords are captured as@keyword. - The
filter,include, andexcludekeywords are captured as@keyword. - The
validation,each,all,validate, andassertkeywords are captured as@keyword. - The
staticandselectkeywords are captured as@keyword. - The
scopecontext keyword is captured as@keyword; theindexedcontext keyword is captured as@keyword.modifier. - The
if,else,match,for,in,let, andfailkeywords are captured as@keyword, as are thebreakandcontinuestatements.
Definitions and identifiers:
- Const item names are captured as
@constant. - Type declaration names are captured as
@type.definition. - Type parameter names on a generic type declaration are captured as
@type.parameter. - Product type field names are captured as
@property. - Product literal field names are captured as
@property. - The type prefix of a typed product literal is captured as
@type. - Function type parameter names are captured as
@variable.parameter. - Enum declaration names are captured as
@type.definition. - Enum variant names are captured as
@constant. - In a member access expression
Target.Member, the target identifier is captured as@typeand the member identifier is captured as@constant. - Top-level function declaration names are captured as
@function. - Method names declared inside a product type are captured as
@function.method. - Master declaration names are captured as
@type.definition. - The
validaterule name of a master validation rule is captured as@function. - The scope name of a master scope declaration is captured as
@function. - The projection name of a master select section is captured as
@type.definition. - The source-kind identifier of a master source entry is captured as
@type. - Master source option names are captured as
@property. - Local
constbinding names are captured as@constant;letbinding names, assignment targets, andforloop binding names are captured as@variable.
Match patterns:
- An enum pattern
Target.Variantcaptures the target identifier as@typeand the variant identifier as@constant. - A product pattern's type identifier is captured as
@type, its field names as@property, and itsasbinding as@variable. - A type pattern's
asbinding is captured as@variable. - The wildcard pattern
_is captured as@variable.builtin.
Operators:
- A unary or binary expression's operator token is captured as
@operator. The capture uses the expression'soperatorfield, so the<>of a generic type application and the|of a union type — which are the same tokens in type position — are not coloured as operators. - The
=>arrow token and the variadic*prefix are captured as@operator.
Type expressions:
named_typeis captured as@type.reserved_type_identifieris captured as@type.builtin.- The constructor identifier of
generic_typeis captured as@type.
Literals and comments:
null_literalis captured as@constant.builtin.bool_literalis captured as@boolean.integer_literalis captured as@number.string_literalis captured as@string.line_commentis captured as@comment.block_commentis captured as@comment.doc_commentis captured as@comment.documentation.