commit f99d607cf0e2f3cb30dc8176d9ae17ae0ded03b3 Author: Alan O Date: Sun Jan 16 15:31:11 2022 -0500 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..13bc9c2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Set default behavior to automatically normalize line endings. +* text=auto + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..67dfeb3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +*.vsix \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..0e191b5 --- /dev/null +++ b/.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/.vscodeignore b/.vscodeignore new file mode 100644 index 0000000..f369b5e --- /dev/null +++ b/.vscodeignore @@ -0,0 +1,4 @@ +.vscode/** +.vscode-test/** +.gitignore +vsc-extension-quickstart.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..57232cd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change Log + +All notable changes to the "mdcs-highlighter" 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/README.md b/README.md new file mode 100644 index 0000000..7f42b18 --- /dev/null +++ b/README.md @@ -0,0 +1,65 @@ +# mdcs-highlighter README + +This is the README for your extension "mdcs-highlighter". After writing up a brief description, we recommend including the following sections. + +## Features + +Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. + +For example if there is an image subfolder under your extension project workspace: + +\!\[feature X\]\(images/feature-x.png\) + +> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. + +## Requirements + +If you have any requirements or dependencies, add a section describing those and how to install and configure them. + +## Extension Settings + +Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. + +For example: + +This extension contributes the following settings: + +* `myExtension.enable`: enable/disable this extension +* `myExtension.thing`: set to `blah` to do something + +## Known Issues + +Calling out known issues can help limit users opening duplicate issues against your extension. + +## Release Notes + +Users appreciate release notes as you update your extension. + +### 1.0.0 + +Initial release of ... + +### 1.0.1 + +Fixed issue #. + +### 1.1.0 + +Added features X, Y, and Z. + +----------------------------------------------------------------------------------------------------------- + +## Working with Markdown + +**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: + +* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux) +* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux) +* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets + +### 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/icon.png b/icon.png new file mode 100644 index 0000000..373a972 Binary files /dev/null and b/icon.png differ diff --git a/language-configuration.json b/language-configuration.json new file mode 100644 index 0000000..4b7fe20 --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,31 @@ +{ + "comments": { + "lineComment": "#" + }, + // symbols used as brackets + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["<", ">"], + ], + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["<", ">"], + ["\"", "\""], + ["'", "'"], + ["then", "\nend"], + ["else", "\nend"] + ], + // symbols that can be used to surround a selection + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..c392f09 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,15 @@ +{ + "name": "mdcs-highlighter", + "version": "0.0.1", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "mdcs-highlighter", + "version": "0.0.1", + "engines": { + "vscode": "^1.63.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..6cedfcd --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "mdcs-highlighter", + "displayName": "ChickenScript Syntax Highlighter", + "description": "Syntax highlighter for Minecraft ChickenScript", + "version": "0.0.1", + "author": {"name": "Alan O'Cull", "url": "https://alanocull.com", "email": "alanrocull@gmail.com"}, + "repository": {"url": "https://git.maxocull.com/alan/mdcs-highlighter"}, + "icon": "./icon.png", + "engines": { + "vscode": "^1.63.0" + }, + "categories": [ + "Programming Languages", + "Other" + ], + "contributes": { + "languages": [{ + "id": "chickenscript", + "aliases": ["ChickenScript", "chickenscript"], + "extensions": [".mdcs"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "chickenscript", + "scopeName": "source.mdcs", + "path": "./syntaxes/chickenscript.tmLanguage.json", + "embeddedLanguages": { + "meta.embedded.block.mcfunction": "mcfunction" + } + }] + } +} \ No newline at end of file diff --git a/syntaxes/chickenscript.tmLanguage.json b/syntaxes/chickenscript.tmLanguage.json new file mode 100644 index 0000000..a59120c --- /dev/null +++ b/syntaxes/chickenscript.tmLanguage.json @@ -0,0 +1,89 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "ChickenScript", + "patterns": [ + { + "include": "#keywords" + }, + { + "include": "#variables" + }, + { + "include": "#strings" + }, + { + "include": "#constants" + }, + { + "include": "#comments" + }, + { + "include": "#overrides" + } + ], + "repository": { + "keywords": { + "patterns": [{ + "name": "keyword.control.chickenscript", + "match": "\\b(if|elseif|else|then|while|do|for|return|function|datapack|end)\\b" + }] + }, + "variables": { + "patterns": [ + { + "name": "entity.name.class", + "match": "\\b(int|deci|vector|NBT|Entity)\\b" + }, + { + "name": "keyword.other", + "match": "\\b(property|singular)\\b" + } + ] + }, + "strings": { + "name": "string.quoted.double.chickenscript", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.chickenscript", + "match": "\\\\." + } + ] + }, + "constants": { + "patterns": [ + { + "name": "constant.numeric", + "match": "\\d+" + }, + { + "name": "constant.language", + "match": "[@]." + } + ] + }, + "comments": { + "patterns": [{ + "name": "comment.line.number-sign.chickenscript", + "match": "#.*" + }] + }, + "overrides": { + "begin": "\\s*!", + "end": "\n", + "beginCaptures": { + "0": { "name": "keyword.control" } + }, + "name": "meta.embedded.block.mcfunction", + "patterns": [ + { + "name": "constant.language", + "match": "&[^\\s]*" + }, + { "include": "source.mcfunction" } + ] + } + }, + "scopeName": "source.mdcs" +} \ No newline at end of file diff --git a/vsc-extension-quickstart.md b/vsc-extension-quickstart.md new file mode 100644 index 0000000..316487c --- /dev/null +++ b/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/chickenscript.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.