Files
vscode/syntaxes/zap.tmLanguage.json
zeekay eb901e0fab feat: add ZAP language support alongside Cap'n Proto
- Rename extension to vscode-zap
- Add .zap file extension support
- Create ZAP-specific TextMate grammar (zap.tmLanguage.json)
- Add ZAP language configuration with indentation rules
- Maintain backward compatibility with .capnp files
- Update package.json with modern VS Code API version
2026-01-29 09:24:00 -08:00

110 lines
2.5 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "ZAP",
"scopeName": "source.zap",
"fileTypes": ["zap"],
"patterns": [
{ "include": "#comments" },
{ "include": "#annotations" },
{ "include": "#keywords" },
{ "include": "#types" },
{ "include": "#strings" },
{ "include": "#numbers" },
{ "include": "#constants" },
{ "include": "#identifiers" }
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.line.number-sign.zap",
"match": "#.*$"
}
]
},
"annotations": {
"patterns": [
{
"name": "entity.other.attribute-name.zap",
"match": "@[a-zA-Z_][a-zA-Z0-9_]*"
}
]
},
"keywords": {
"patterns": [
{
"name": "keyword.control.zap",
"match": "\\b(struct|enum|union|interface|using|import|const)\\b"
},
{
"name": "keyword.operator.arrow.zap",
"match": "->"
}
]
},
"types": {
"patterns": [
{
"name": "support.type.primitive.zap",
"match": "\\b(Void|Bool|Int8|Int16|Int32|Int64|UInt8|UInt16|UInt32|UInt64|Float32|Float64|Text|Data)\\b"
},
{
"name": "support.type.generic.zap",
"match": "\\b(List|Map|Option)\\b"
},
{
"name": "entity.name.type.zap",
"match": "\\b[A-Z][a-zA-Z0-9_]*\\b"
}
]
},
"strings": {
"patterns": [
{
"name": "string.quoted.double.zap",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.zap",
"match": "\\\\."
}
]
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.hex.zap",
"match": "\\b0x[0-9A-Fa-f]+\\b"
},
{
"name": "constant.numeric.float.zap",
"match": "\\b\\d+\\.\\d+\\b"
},
{
"name": "constant.numeric.integer.zap",
"match": "\\b\\d+\\b"
}
]
},
"constants": {
"patterns": [
{
"name": "constant.language.zap",
"match": "\\b(true|false|void|null)\\b"
}
]
},
"identifiers": {
"patterns": [
{
"name": "variable.other.zap",
"match": "\\b[a-z_][a-zA-Z0-9_]*\\b"
}
]
}
}
}