Add syntax highlighting

This commit is contained in:
2025-10-15 12:10:56 +02:00
parent 246d62c029
commit 2ce6f733d7
5 changed files with 553 additions and 1 deletions
@@ -0,0 +1,30 @@
{
"comments": {
"blockComment": ["<!--", "-->"]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "\"", "close": "\"" },
{ "open": "'", "close": "'" }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
"folding": {
"markers": {
"start": "^\\s*<!--\\s*#region\\b",
"end": "^\\s*<!--\\s*#endregion\\b"
}
}
}
+41
View File
@@ -0,0 +1,41 @@
{
"name": "wl-language",
"displayName": "WL Language Support",
"description": "Syntax highlighting for WL templating language",
"version": "1.0.0",
"engines": {
"vscode": "^1.60.0"
},
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [
{
"id": "wl",
"aliases": [
"WL",
"wl"
],
"extensions": [
".wl"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "wl",
"scopeName": "source.wl",
"path": "./syntaxes/wl.tmLanguage.json"
}
],
"themes": [
{
"label": "WL Enhanced",
"uiTheme": "vs-dark",
"path": "./themes/wl-theme.json"
}
]
}
}
@@ -0,0 +1,359 @@
{
"name": "WL",
"scopeName": "source.wl",
"fileTypes": ["wl"],
"patterns": [
{
"include": "#comments"
},
{
"include": "#html-tags"
},
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#operators"
},
{
"include": "#system-variables"
},
{
"include": "#functions"
},
{
"include": "#constants"
}
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.block.html.wl",
"begin": "<!--",
"end": "-->",
"patterns": []
}
]
},
"keywords": {
"patterns": [
{
"name": "keyword.control.wl",
"match": "\\b(if|else|while|for|in)\\b"
},
{
"name": "keyword.other.wl",
"match": "\\b(procedure|let|include)\\b"
},
{
"name": "keyword.operator.wl",
"match": "\\b(len|escape)\\b"
}
]
},
"constants": {
"patterns": [
{
"name": "constant.language.wl",
"match": "\\b(none|true|false)\\b"
}
]
},
"strings": {
"patterns": [
{
"name": "string.quoted.double.wl",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.wl",
"match": "\\\\(n|t|r|\"|'|\\\\|x[0-9A-Fa-f]{2})"
}
]
},
{
"name": "string.quoted.single.wl",
"begin": "'",
"end": "'",
"patterns": [
{
"name": "constant.character.escape.wl",
"match": "\\\\(n|t|r|\"|'|\\\\|x[0-9A-Fa-f]{2})"
}
]
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.float.wl",
"match": "\\b[0-9]+\\.[0-9]+\\b"
},
{
"name": "constant.numeric.integer.wl",
"match": "\\b[0-9]+\\b"
}
]
},
"operators": {
"patterns": [
{
"name": "keyword.operator.append.wl",
"match": "<<"
},
{
"name": "keyword.operator.comparison.wl",
"match": "(==|!=|<=|>=)"
},
{
"name": "keyword.operator.relational.wl",
"match": "(<|>)"
},
{
"name": "keyword.operator.assignment.wl",
"match": "="
},
{
"name": "keyword.operator.arithmetic.wl",
"match": "(\\+|-|\\*|/|%)"
}
]
},
"system-variables": {
"patterns": [
{
"name": "variable.other.system.wl",
"match": "\\$[a-zA-Z_][a-zA-Z0-9_]*"
}
]
},
"functions": {
"patterns": [
{
"name": "entity.name.function.wl",
"match": "\\b[a-zA-Z_][a-zA-Z0-9_]*(?=\\s*\\()"
}
]
},
"html-tags": {
"patterns": [
{
"name": "meta.tag.html.wl",
"begin": "(<)([a-zA-Z][a-zA-Z0-9]*)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.wl"
},
"2": {
"name": "entity.name.tag.wl"
}
},
"end": "(/>)|(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.self-closing.wl"
},
"2": {
"name": "punctuation.definition.tag.end.wl"
}
},
"patterns": [
{
"name": "string.quoted.double.html.wl",
"begin": "\"",
"end": "\"",
"patterns": [
{
"include": "#embedded-expression"
}
]
},
{
"name": "string.quoted.single.html.wl",
"begin": "'",
"end": "'",
"patterns": [
{
"include": "#embedded-expression"
}
]
},
{
"include": "#embedded-expression"
}
]
},
{
"name": "meta.tag.closing.html.wl",
"match": "(</)([a-zA-Z][a-zA-Z0-9]*)(>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.begin.wl"
},
"2": {
"name": "entity.name.tag.wl"
},
"3": {
"name": "punctuation.definition.tag.end.wl"
}
}
}
]
},
"embedded-expression": {
"patterns": [
{
"name": "meta.embedded.block.wl",
"begin": "\\\\\\{",
"end": "\\}",
"patterns": [
{
"include": "#expression-contents"
}
]
},
{
"name": "meta.embedded.wl",
"begin": "\\\\",
"end": "(?=[\\s\"'/>])",
"patterns": [
{
"include": "#expression-contents"
}
]
}
]
},
"expression-contents": {
"patterns": [
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#operators"
},
{
"include": "#system-variables"
},
{
"include": "#functions"
},
{
"include": "#constants"
},
{
"include": "#brackets"
}
]
},
"brackets": {
"patterns": [
{
"begin": "\\[",
"end": "\\]",
"patterns": [
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#operators"
},
{
"include": "#system-variables"
},
{
"include": "#functions"
},
{
"include": "#constants"
},
{
"include": "#brackets"
}
]
},
{
"begin": "\\{",
"end": "\\}",
"patterns": [
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#operators"
},
{
"include": "#system-variables"
},
{
"include": "#functions"
},
{
"include": "#constants"
},
{
"include": "#brackets"
}
]
},
{
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#operators"
},
{
"include": "#system-variables"
},
{
"include": "#functions"
},
{
"include": "#constants"
},
{
"include": "#brackets"
}
]
}
]
}
}
}
+113
View File
@@ -0,0 +1,113 @@
{
"name": "WL Enhanced",
"type": "dark",
"colors": {
"editor.background": "#1e1e1e",
"editor.foreground": "#d4d4d4"
},
"tokenColors": [
{
"name": "WL Control Keywords",
"scope": "keyword.control.wl",
"settings": {
"foreground": "#C586C0",
"fontStyle": "bold"
}
},
{
"name": "WL Declaration Keywords (let, include, procedure)",
"scope": "keyword.other.wl",
"settings": {
"foreground": "#569CD6",
"fontStyle": "bold"
}
},
{
"name": "WL Operator Keywords (len, escape)",
"scope": "keyword.operator.wl",
"settings": {
"foreground": "#4EC9B0"
}
},
{
"name": "WL HTML Tags",
"scope": "entity.name.tag.wl",
"settings": {
"foreground": "#4EC9B0"
}
},
{
"name": "WL HTML Tag Punctuation",
"scope": "punctuation.definition.tag.wl",
"settings": {
"foreground": "#808080"
}
},
{
"name": "WL Constants",
"scope": "constant.language.wl",
"settings": {
"foreground": "#569CD6"
}
},
{
"name": "WL Strings",
"scope": "string.quoted.double.wl, string.quoted.single.wl, string.quoted.double.html.wl, string.quoted.single.html.wl",
"settings": {
"foreground": "#CE9178"
}
},
{
"name": "WL Numbers",
"scope": "constant.numeric.wl",
"settings": {
"foreground": "#B5CEA8"
}
},
{
"name": "WL System Variables",
"scope": "variable.other.system.wl",
"settings": {
"foreground": "#9CDCFE",
"fontStyle": "italic"
}
},
{
"name": "WL Functions",
"scope": "entity.name.function.wl",
"settings": {
"foreground": "#DCDCAA"
}
},
{
"name": "WL Operators",
"scope": "keyword.operator.wl",
"settings": {
"foreground": "#D4D4D4"
}
},
{
"name": "WL Append Operator",
"scope": "keyword.operator.append.wl",
"settings": {
"foreground": "#C586C0",
"fontStyle": "bold"
}
},
{
"name": "WL Comments",
"scope": "comment.block.html.wl",
"settings": {
"foreground": "#6A9955",
"fontStyle": "italic"
}
},
{
"name": "WL Embedded Expressions",
"scope": "meta.embedded.wl",
"settings": {
"background": "#2d2d30"
}
}
]
}