Add files

This commit is contained in:
Johannes Frohnmeyer 2024-09-30 16:47:17 +02:00
commit 7ca0eb7a30
Signed by: Johannes
GPG Key ID: E76429612C2929F4
9 changed files with 306 additions and 0 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# Set default behavior to automatically normalize line endings.
* text=auto

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
*.vsix

17
.vscode/launch.json vendored Normal file
View File

@ -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}"
]
}
]
}

4
.vscodeignore Normal file
View File

@ -0,0 +1,4 @@
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md

21
LICENSE Normal file
View File

@ -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.

65
README.md Normal file
View File

@ -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!**

View File

@ -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": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"],
["`", "`"]
]
}

25
package.json Normal file
View File

@ -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"
}]
}
}

View File

@ -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"
}
]
}
]
}
}
}