From 105397b54aebd94dfdd5227546aef51553191719 Mon Sep 17 00:00:00 2001 From: Mandar Chitre Date: Thu, 29 Dec 2022 23:32:34 +0800 Subject: [PATCH] feat(vscode): add syntax highlighting for log files --- vscode/fjage-log.tmLanguage.json | 20 ++++++++++++++++++++ vscode/language-configuration.json | 24 ++++++++++++++++++++++++ vscode/package.json | 21 +++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 vscode/fjage-log.tmLanguage.json create mode 100644 vscode/language-configuration.json create mode 100644 vscode/package.json diff --git a/vscode/fjage-log.tmLanguage.json b/vscode/fjage-log.tmLanguage.json new file mode 100644 index 00000000..1b0f092d --- /dev/null +++ b/vscode/fjage-log.tmLanguage.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "fjage-log", + "patterns": [{ "include": "#entry" }], + "repository": { + "entry": { + "patterns": [{ + "match": "^([0-9]{10})([0-9]{3})\\|([A-Z]+)\\|([^\\|]+)\\|", + "captures": { + "1": { "name": "markup.changed.fjage-log" }, + "2": { "name": "comment.block.fjage-log" }, + "3": { "name": "keyword.fjage-log" }, + "4": { "name": "comment.block.fjage-log" } + } + } + ] + } + }, + "scopeName": "source.fjage-log" +} diff --git a/vscode/language-configuration.json b/vscode/language-configuration.json new file mode 100644 index 00000000..59542202 --- /dev/null +++ b/vscode/language-configuration.json @@ -0,0 +1,24 @@ +{ + // symbols used as brackets + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + // symbols that that can be used to surround a selection + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} diff --git a/vscode/package.json b/vscode/package.json new file mode 100644 index 00000000..2925cd2a --- /dev/null +++ b/vscode/package.json @@ -0,0 +1,21 @@ +{ + "name": "fjage-log", + "displayName": "Fjåge log syntax", + "description": "Syntax highlighting for fjåge log files.", + "version": "0.0.1", + "publisher": "Mandar Chitre", + "engines": { "vscode": "^1.74.0" }, + "categories": [ "Languages" ], + "contributes": { + "languages": [{ + "id": "fjage-log", + "extensions": [], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "fjage-log", + "scopeName": "source.fjage-log", + "path": "./fjage-log.tmLanguage.json" + }] + } +}