diff --git a/etc/hlds/.vscodeignore b/etc/hlds/.vscodeignore new file mode 100644 index 0000000..f369b5e --- /dev/null +++ b/etc/hlds/.vscodeignore @@ -0,0 +1,4 @@ +.vscode/** +.vscode-test/** +.gitignore +vsc-extension-quickstart.md diff --git a/etc/hlds/CHANGELOG.md b/etc/hlds/CHANGELOG.md new file mode 100644 index 0000000..ae8bd34 --- /dev/null +++ b/etc/hlds/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change Log + +All notable changes to the "hlds" 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/etc/hlds/README.md b/etc/hlds/README.md new file mode 100644 index 0000000..91fef74 --- /dev/null +++ b/etc/hlds/README.md @@ -0,0 +1,10 @@ +# hlds + +Working on haldis? Thanks! This extension will hihghlight the `.hlds` files, maybe a bit sillyly but hey, it's something. + +### For more information + +* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) +* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) + +**Enjoy!** diff --git a/etc/hlds/hlds.vsix b/etc/hlds/hlds.vsix new file mode 100644 index 0000000..9b61079 Binary files /dev/null and b/etc/hlds/hlds.vsix differ diff --git a/etc/hlds/language-configuration.json b/etc/hlds/language-configuration.json new file mode 100644 index 0000000..f3e7fd6 --- /dev/null +++ b/etc/hlds/language-configuration.json @@ -0,0 +1,30 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "//", + // symbols used for start and end a block comment. Remove this entry if your language does not support block comments + "blockComment": [ "=============================================", "=============================================" ] + }, + // 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/etc/hlds/package.json b/etc/hlds/package.json new file mode 100644 index 0000000..6725b44 --- /dev/null +++ b/etc/hlds/package.json @@ -0,0 +1,31 @@ +{ + "name": "hlds", + "publisher": "Silvius", + "displayName": "Syntax highlighting for haldis (hlds) files.", + "description": "hlds", + "repository": "https://git.zeus.gent/midgard/haldis", + "version": "0.0.1", + "engines": { + "vscode": "^1.42.0" + }, + "categories": [ + "Programming Languages" + ], + "contributes": { + "languages": [{ + "id": "hlds", + "aliases": ["HLDS", "hlds"], + "extensions": [".hlds"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "hlds", + "scopeName": "source.hlds", + "path": "./syntaxes/hlds.tmLanguage.json" + }, { + "path": "./syntaxes/injections.json", + "scopeName": "comment.injection", + "injectTo": ["source.hlds"] + }] + } +} \ No newline at end of file diff --git a/etc/hlds/syntaxes/hlds.tmLanguage.json b/etc/hlds/syntaxes/hlds.tmLanguage.json new file mode 100644 index 0000000..cfbe47a --- /dev/null +++ b/etc/hlds/syntaxes/hlds.tmLanguage.json @@ -0,0 +1,97 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "HLDS", + "patterns": [ + { + "include": "#tags" + }, + { + "include": "#keywords" + }, + { + "include": "#header" + }, + { + "include": "#prices" + }, + { + "include": "#indent" + }, + { + "include": "#random" + } + ], + "repository": { + "random": { + "patterns": [ + { + "match": "#.*$", + "name": "markup.bold" + } + ] + }, + "tags": { + "patterns": [ + { + "match": "(::)\\s*({[a-zA-Z-_]*}\\s*)*", + "name": "markup.italic", + "captures": { + "1": { + "name": "markup.bold" + } + } + } + ] + }, + "indent": { + "patterns": [ + { + "name": "variable.other", + "match": "\\t[-_a-zA-Z0-9]*:" + }, + { + "name": "entity.name.type", + "match": "[-_a-zA-Z0-9]*:" + } + ] + }, + "prices": { + "patterns": [ + { + "name": "entity.name.class", + "match": "€\\s*[0-9.]*$" + } + ] + }, + "header": { + "patterns": [ + { + "name": "embedded.meta.tag", + "begin": "^==", + "end": "==$" + } + ] + }, + "comments": { + "patterns": [ + { + "name": "comment", + "match": "--[^€]*" + } + ] + }, + "keywords": { + "patterns": [ + { + "name": "keyword.control.hlds", + "match": "\\bdish\\b" + }, + { + "name": "keyword", + "match": "\\b(single_choice|multi_choice)\\b" + } + ] + } + }, + "scopeName": "source.hlds" +} \ No newline at end of file diff --git a/etc/hlds/syntaxes/injections.json b/etc/hlds/syntaxes/injections.json new file mode 100644 index 0000000..6557b5d --- /dev/null +++ b/etc/hlds/syntaxes/injections.json @@ -0,0 +1,36 @@ +{ + "scopeName": "comment.injection", + "injectionSelector": "L:embedded.meta.tag", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#header" + }, + { + "include": "#links" + }, + { + "include": "#brackets" + } + ], + "repository": { + "comment": { + "match": "#.*$", + "name": "comment" + }, + "header": { + "match": "^[a-zA-Z0-9_].*$", + "name": "keyword.todo" + }, + "links": { + "match": "^\\t[a-zA-Z0-9-_]*", + "name": "keyword.todo" + }, + "brackets": { + "match": "=", + "name": "variable.other" + } + } +} diff --git a/etc/hlds/vsc-extension-quickstart.md b/etc/hlds/vsc-extension-quickstart.md new file mode 100644 index 0000000..ad7b568 --- /dev/null +++ b/etc/hlds/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/hlds.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.