commit 7ca0eb7a30c69c780aa30c068b54a440b91cf81f Author: JFronny Date: Mon Sep 30 16:47:17 2024 +0200 Add files diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..70e63ff --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# 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..44a86ab --- /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}" + ] + } + ] +} 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/LICENSE b/LICENSE new file mode 100644 index 0000000..269be59 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 J. Fronny + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..6288e0f --- /dev/null +++ b/README.md @@ -0,0 +1,65 @@ +# muscript README + +This is the README for your extension "muscript". 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 + +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, 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/language-configuration.json b/language-configuration.json new file mode 100644 index 0000000..91fcbbb --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,32 @@ +{ + "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/package.json b/package.json new file mode 100644 index 0000000..37c3a50 --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "muscript", + "displayName": "muScript", + "description": "Syntax highlighting for muScript", + "version": "0.0.1", + "engines": { + "vscode": "^1.93.0" + }, + "categories": [ + "Programming Languages" + ], + "contributes": { + "languages": [{ + "id": "muscript", + "aliases": ["muScript", "muscript"], + "extensions": ["mu"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "muscript", + "scopeName": "source.mu", + "path": "./syntaxes/muscript.tmLanguage.json" + }] + } +} diff --git a/syntaxes/muscript.tmLanguage.json b/syntaxes/muscript.tmLanguage.json new file mode 100644 index 0000000..999d0e6 --- /dev/null +++ b/syntaxes/muscript.tmLanguage.json @@ -0,0 +1,138 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "scopeName": "source.mu", + "name": "muScript", + "patterns": [ + { + "name": "meta.preprocessor", + "match": "^\\s*#\\w+" + }, + { + "include": "#expressions" + } + ], + "repository": { + "expressions": { + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#strings" + }, + { + "include": "#closure" + }, + { + "include": "#identifiers" + }, + { + "include": "#operators" + } + ] + }, + "identifiers": { + "patterns": [ + { + "captures": { + "0": { + "name": "constant.numeric.boolean.muscript" + } + }, + "name": "meta.literals", + "match": "\\b(true|false|null)\\b" + }, + { + "captures": { + "0": { + "name": "variable.other.muscript" + } + }, + "name": "meta.literals", + "match": "\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\b" + }, + { + "captures": { + "0": { + "name": "constant.numeric.muscript" + } + }, + "name": "meta.literals", + "match": "\\b(\\d+(?:\\.\\d*))\\b" + } + ] + }, + "strings": { + "patterns": [ + { + "name": "string.quoted.double.muscript", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.muscript", + "match": "\\\\." + } + ] + }, + { + "name": "string.quoted.single.muscript", + "begin": "'", + "end": "'", + "patterns": [ + { + "name": "constant.character.escape.muscript", + "match": "\\\\." + } + ] + } + ] + }, + "comments": { + "patterns": [ + { + "name": "comment.line.double-slash.muscript", + "match": "//.*$" + }, + { + "name": "comment.block.muscript", + "begin": "/\\*", + "end": "\\*/" + } + ] + }, + "operators": { + "patterns": [ + { + "name": "keyword.operator.muscript", + "match": "[-+*/%^<>=!&|]" + }, + { + "name": "" + } + ] + }, + "closure": { + "patterns": [ + { + "name": "meta.function.muscript", + "begin": "\\{\\s*(?:([a-zA-Z_$][a-zA-Z0-9_$]*)(?:, )?)*\\s*->", + "beginCaptures": { + "1": { + "name": "variable.parameter" + } + }, + "end": "\\}", + "patterns": [ + { + "include": "#identifiers" + }, + { + "include": "#expressions" + } + ] + } + ] + } + } +} \ No newline at end of file