From 5682ee708c5adbcab6c7d38acf47d2a5cf7e1fb2 Mon Sep 17 00:00:00 2001 From: 0x4261756D <–38735823+0x4261756D@users.noreply.github.com> Date: Thu, 22 Dec 2022 05:44:08 +0100 Subject: [PATCH] Add syntax highlighting for vscode --- editor/{micro.yaml => micro/kurz.yaml} | 0 editor/vscode/kurz-lang/.vscode/launch.json | 17 ++++ editor/vscode/kurz-lang/.vscodeignore | 4 + editor/vscode/kurz-lang/CHANGELOG.md | 9 ++ editor/vscode/kurz-lang/README.md | 5 + editor/vscode/kurz-lang/kurz-lang-0.0.1.vsix | Bin 0 -> 3066 bytes .../kurz-lang/language-configuration.json | 20 ++++ editor/vscode/kurz-lang/package.json | 25 +++++ .../kurz-lang/syntaxes/kurz.tmLanguage.json | 89 ++++++++++++++++++ .../kurz-lang/vsc-extension-quickstart.md | 29 ++++++ 10 files changed, 198 insertions(+) rename editor/{micro.yaml => micro/kurz.yaml} (100%) create mode 100644 editor/vscode/kurz-lang/.vscode/launch.json create mode 100644 editor/vscode/kurz-lang/.vscodeignore create mode 100644 editor/vscode/kurz-lang/CHANGELOG.md create mode 100644 editor/vscode/kurz-lang/README.md create mode 100644 editor/vscode/kurz-lang/kurz-lang-0.0.1.vsix create mode 100644 editor/vscode/kurz-lang/language-configuration.json create mode 100644 editor/vscode/kurz-lang/package.json create mode 100644 editor/vscode/kurz-lang/syntaxes/kurz.tmLanguage.json create mode 100644 editor/vscode/kurz-lang/vsc-extension-quickstart.md diff --git a/editor/micro.yaml b/editor/micro/kurz.yaml similarity index 100% rename from editor/micro.yaml rename to editor/micro/kurz.yaml diff --git a/editor/vscode/kurz-lang/.vscode/launch.json b/editor/vscode/kurz-lang/.vscode/launch.json new file mode 100644 index 0000000..0e191b5 --- /dev/null +++ b/editor/vscode/kurz-lang/.vscode/launch.json @@ -0,0 +1,17 @@ +// A launch configuration that launches the extension inside a new window +// Use IntelliSense to learn about possible attributes. +// Hover to view descriptions of existing attributes. +// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Extension", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ] + } + ] +} \ No newline at end of file diff --git a/editor/vscode/kurz-lang/.vscodeignore b/editor/vscode/kurz-lang/.vscodeignore new file mode 100644 index 0000000..f369b5e --- /dev/null +++ b/editor/vscode/kurz-lang/.vscodeignore @@ -0,0 +1,4 @@ +.vscode/** +.vscode-test/** +.gitignore +vsc-extension-quickstart.md diff --git a/editor/vscode/kurz-lang/CHANGELOG.md b/editor/vscode/kurz-lang/CHANGELOG.md new file mode 100644 index 0000000..89247de --- /dev/null +++ b/editor/vscode/kurz-lang/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change Log + +All notable changes to the "kurz-lang" extension will be documented in this file. + +Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. + +## [Unreleased] + +- Initial release \ No newline at end of file diff --git a/editor/vscode/kurz-lang/README.md b/editor/vscode/kurz-lang/README.md new file mode 100644 index 0000000..39be7ec --- /dev/null +++ b/editor/vscode/kurz-lang/README.md @@ -0,0 +1,5 @@ +# kurz-lang README + +This is a syntax highlighting extension for the lanuage '[kurz](https://gittea.dev/0x4261756D/kurz)'. + +**Enjoy!** diff --git a/editor/vscode/kurz-lang/kurz-lang-0.0.1.vsix b/editor/vscode/kurz-lang/kurz-lang-0.0.1.vsix new file mode 100644 index 0000000000000000000000000000000000000000..8b5394399ece300e1e96738706fa1b769528150e GIT binary patch literal 3066 zcmaJ@c|4SB8y-7Zvvn|%od#py6=BF&#@3KJs0Jf5Bg4T&*0O|f4n~#)3qpg+kdd6 z3nu+Q7$59c{rnt)BD)&+zULREwV~xa)6LQl)YBsmhk41Eg zZmI)BE~~i=9^%%+MDSIOOZCm)A#rE7Br0ogEXF1*Wp~fFVNRvg;?+acnq`O`%9nZ| zIfP5sIECoFfRcwcg?CmR>{$9PvWah+(DgZ%#LTeP&y0Vww}A&QY;YW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`)KTe&gmeG9uxQS0R81 za=h1Q3x9Q#a7YDW8S?iv6QgZOj`ZAJqx!*(0`B)r(^I>c%%6YZZ%-AG3 zmm|_9faPeheAWsrr8y&uHBzeE)8_uo4CgernbY}J&6WM!N77!Lg}MGtKnl5q|9Y?Qob%$4{RX5q; zw_`0&yeq4x%3NCHh+H>ZZs?t@#+)@V=zh!&>xzd1eQjE$zSsYX^1=Em9yl&G93AW( zhQNX^hXmo&f>E~r?V+!Nz`K}W#?=M#i#-Rb#R6UyG@U6MDpu_;=p8JGej8KRCwe*Q z(k4?o@6K!J@!txGNej$ka@L)lv=0-K;kOm$orc8E#(vZ*(}gS;cMFfssA|=#;@K_P z^jdgJ3VY8M^2{W!qI||~tl;H6Rvb~LsWO{SMS-fuMvAJe3;C{5P0?~47YUH?+=@Xt z0@We*r_xls;hS+u;KnIe@lRPZ6!%13>Fdhz4h`$4Lld>#IS_14em?PrtV`8wyiT7? zHT%HtG*dt?{_NS&1s*T5h`WlFER(C28>xb^wgiAZmeRF!wD zV21SbE{cL^bmp#Te0zv=) literal 0 HcmV?d00001 diff --git a/editor/vscode/kurz-lang/language-configuration.json b/editor/vscode/kurz-lang/language-configuration.json new file mode 100644 index 0000000..cd2a8b6 --- /dev/null +++ b/editor/vscode/kurz-lang/language-configuration.json @@ -0,0 +1,20 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "//", + }, + // symbols used as brackets + "brackets": [ + ["{", "}"], + ], + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["{", "}"], + ["\"", "\""], + ], + // symbols that can be used to surround a selection + "surroundingPairs": [ + ["{", "}"], + ["\"", "\""], + ] +} \ No newline at end of file diff --git a/editor/vscode/kurz-lang/package.json b/editor/vscode/kurz-lang/package.json new file mode 100644 index 0000000..b6247ca --- /dev/null +++ b/editor/vscode/kurz-lang/package.json @@ -0,0 +1,25 @@ +{ + "name": "kurz-lang", + "displayName": "kurz", + "description": "Syntax highlighting for the kurz language", + "version": "0.0.1", + "engines": { + "vscode": "^1.74.0" + }, + "categories": [ + "Programming Languages" + ], + "contributes": { + "languages": [{ + "id": "kurz", + "aliases": ["kurz", "kurz"], + "extensions": [".qbl"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "kurz", + "scopeName": "source.kurz", + "path": "./syntaxes/kurz.tmLanguage.json" + }] + } +} diff --git a/editor/vscode/kurz-lang/syntaxes/kurz.tmLanguage.json b/editor/vscode/kurz-lang/syntaxes/kurz.tmLanguage.json new file mode 100644 index 0000000..42e58f1 --- /dev/null +++ b/editor/vscode/kurz-lang/syntaxes/kurz.tmLanguage.json @@ -0,0 +1,89 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "kurz", + "patterns": + [ + { + "include": "#keywords" + }, + { + "include": "#strings" + }, + { + "include": "#comment" + } + ], + "repository": + { + "keywords": + { + "patterns": + [ + { + "name": "keyword.control.kurz", + "match": "\\b(if|else|while)\\b" + }, + { + "name": "keyword.operator", + "match": "[-+<>]|==|!=|=>|print(ln)?" + }, + { + "name": "support.function.kurz", + "match": "function" + }, + { + "name": "support.type.kurz", + "match": "\\b(bool|int|str|any)\\b" + }, + { + "name": "constant.numeric.kurz", + "match": "[0-9]" + }, + { + "name": "constant.language.kurz", + "match": "true|false" + }, + { + "name": "support.function.kurz", + "match": "\\b(deq|swp|dup|req|depth|decrease)\\b" + }, + { + "name": "keyword.control", + "match": "arr" + } + ] + }, + "comment": + { + "patterns": + [ + { + "name": "comment.line.kurz", + "begin": "//", + "end": "$", + "patterns": + [ + { + "name": "markup.bold.kurz", + "match": "(TODO|FIXME):?" + } + ] + } + ] + }, + "strings": + { + "name": "string.quoted.double.kurz", + "begin": "\"", + "end": "\"", + "patterns": + [ + { + "name": "constant.character.escape.kurz", + "match": "\\\\." + } + ] + } + }, + "scopeName": "source.kurz" +} \ No newline at end of file diff --git a/editor/vscode/kurz-lang/vsc-extension-quickstart.md b/editor/vscode/kurz-lang/vsc-extension-quickstart.md new file mode 100644 index 0000000..f5959bf --- /dev/null +++ b/editor/vscode/kurz-lang/vsc-extension-quickstart.md @@ -0,0 +1,29 @@ +# Welcome to your VS Code Extension + +## What's in the folder + +* This folder contains all of the files necessary for your extension. +* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension. +* `syntaxes/kurz.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization. +* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets. + +## Get up and running straight away + +* Make sure the language configuration settings in `language-configuration.json` are accurate. +* Press `F5` to open a new window with your extension loaded. +* Create a new file with a file name suffix matching your language. +* Verify that syntax highlighting works and that the language configuration settings are working. + +## Make changes + +* You can relaunch the extension from the debug toolbar after making changes to the files listed above. +* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. + +## Add more language features + +* To add features such as IntelliSense, hovers and validators check out the VS Code extenders documentation at https://code.visualstudio.com/docs + +## Install your extension + +* To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code. +* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.