From d79d69746081fee773e45bb41132ac7664fbe47b Mon Sep 17 00:00:00 2001 From: Nathanne Isip Date: Fri, 18 Oct 2024 01:52:55 +0800 Subject: [PATCH] Initial VS Code language extension folder source files. --- extension/.gitattributes | 1 + extension/.gitignore | 3 ++ extension/.vscodeignore | 3 ++ extension/language-configuration.json | 35 ++++++++++++++ extension/syntaxes/zhivo.tmLanguage.json | 59 ++++++++++++++++++++++++ 5 files changed, 101 insertions(+) create mode 100644 extension/.gitattributes create mode 100644 extension/.gitignore create mode 100644 extension/.vscodeignore create mode 100644 extension/language-configuration.json create mode 100644 extension/syntaxes/zhivo.tmLanguage.json diff --git a/extension/.gitattributes b/extension/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/extension/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/extension/.gitignore b/extension/.gitignore new file mode 100644 index 0000000..a9266aa --- /dev/null +++ b/extension/.gitignore @@ -0,0 +1,3 @@ +.vscode +node_modules +*.vsix diff --git a/extension/.vscodeignore b/extension/.vscodeignore new file mode 100644 index 0000000..19bbe78 --- /dev/null +++ b/extension/.vscodeignore @@ -0,0 +1,3 @@ +.vscode/** +.vscode-test/** +.gitignore diff --git a/extension/language-configuration.json b/extension/language-configuration.json new file mode 100644 index 0000000..cca095b --- /dev/null +++ b/extension/language-configuration.json @@ -0,0 +1,35 @@ +{ + "comments": { + "lineComment": "#" + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}" }, + { "open": "[", "close": "]" }, + { "open": "(", "close": ")" }, + { "open": "\"", "close": "\"", "notIn": ["string", "comment"] }, + { "open": "'", "close": "'", "notIn": ["string", "comment"] } + ], + "surroundingPairs": [ + { "open": "{", "close": "}" }, + { "open": "[", "close": "]" }, + { "open": "(", "close": ")" }, + { "open": "\"", "close": "\"", "notIn": ["string", "comment"] }, + { "open": "'", "close": "'", "notIn": ["string", "comment"] } + ], + "folding": { + "markers": { + "start": "^\\s*//\\s*#?region\\b", + "end": "^\\s*//\\s*#?endregion\\b" + } + }, + "wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)", + "indentationRules": { + "increaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$", + "decreaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\)\\}\\]].*$" + } +} \ No newline at end of file diff --git a/extension/syntaxes/zhivo.tmLanguage.json b/extension/syntaxes/zhivo.tmLanguage.json new file mode 100644 index 0000000..5f3f2ac --- /dev/null +++ b/extension/syntaxes/zhivo.tmLanguage.json @@ -0,0 +1,59 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "Zhivo", + "patterns": [ + { "include": "#keywords" }, + { "include": "#strings" }, + { "include": "#digits" }, + { "include": "#comments" } + ], + "repository": { + "keywords": { + "patterns": [{ + "name": "keyword.control.zhivo", + "match": "\\b(break|continue|ret|throw|if|else|unless|when|do|while|loop|random|catch|handle|then|func|use|test|render|type|true|false|maybe|nil)\\b" + }] + }, + "digits": { + "patterns": [{ + "name": "digit.numberic.zhivo", + "match": "\\b(0b[01]+|0t[0-2]+|0c[0-7]+|0x[0-9a-fA-F]+|\\d+(\\.\\d*)?)\\b" + }] + }, + "comments": { + "patterns": [{ + "name": "comment.line.zhivo", + "begin": "#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.zhivo" + } + }, + "end": "$" + }] + }, + "strings": { + "name": "string.quoted.double.zhivo", + "begin": "\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.zhivo" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.zhivo" + } + }, + "patterns": [ + { + "name": "constant.character.escape.zhivo", + "match": "\\\\[btnfr\"\\\\]" + } + ] + } + }, + "fileTypes": ["zhv"], + "scopeName": "source.zhivo" +} \ No newline at end of file