VSCode syntax highlighting extension

This commit is contained in:
Robert Bendun 2022-05-24 14:13:38 +02:00
parent d1366aee74
commit 6652a08f42
6 changed files with 103 additions and 0 deletions

View File

@ -75,3 +75,7 @@ Następnie musisz dodać ustawienie typu pliku na podstawie rozszerzenia wewnąt
```vim ```vim
au BufRead,BufNewFile *.mq set filetype=musique au BufRead,BufNewFile *.mq set filetype=musique
``` ```
### Visual Studio Code
Skopiuj katalog [etc/editor/musique-vscode](etc/editor/musique-vscode) do folderu `<user home>/.vscode/extensions` i uruchom ponownie program VSCode.

2
etc/editor/musique-vscode/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.vscode/**
.vscode-test/**

View File

@ -0,0 +1,23 @@
{
"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": [
["[", "]"],
["(", ")"]
]
}

View File

@ -0,0 +1,31 @@
{
"name": "musique",
"displayName": "Musique Language Support",
"description": "Adds suport for Musique programming language into VSCode",
"version": "0.0.1",
"author": {
"name": "Robert Bendun",
"email": "robben@st.amu.edu.pl",
"url": "https://bendun.cc"
},
"license": "GNU AGPLv3",
"engines": {
"vscode": "^1.67.0"
},
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [{
"id": "musique",
"aliases": ["Musique", "musique"],
"extensions": [".mq"],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "musique",
"scopeName": "source.musique",
"path": "./syntaxes/musique.tmLanguage.json"
}]
}
}

View File

@ -0,0 +1,39 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Musique",
"patterns": [
{
"include": "#keywords"
},
{
"include": "#strings"
}
],
"repository": {
"keywords": {
"patterns": [{
"name": "keyword.control.musique",
"match": "\\b(var|true|false|nil)\\b"
}]
},
"operators": {
"patterns": [{
"name": "keyword.operator.arithmetic.musique",
"match": "(\\*|\\+|\\-|/)"
}]
},
"builtins": {
"patterns": [{
"name": "keyword.control.musique",
"match": "(if|play|len)"
}]
},
"multiline-comments": {
"patterns": [{
"name": "comment.block",
"match": "---+.*----+"
}]
}
},
"scopeName": "source.musique"
}

View File

@ -0,0 +1,4 @@
# Install your extension
* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code.
* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.