diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..124645f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeee732 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +*.vsix diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..0db595f --- /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/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d07967f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change Log + +All notable changes to the "reabank-support" 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 diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..9fb9a06 --- /dev/null +++ b/LICENCE @@ -0,0 +1,13 @@ +Copyright 2021 Adaline Valentina Simonian + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..21264ae --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# reabank-syntax-highlighting + +Provides syntax highlighting support for [Reaper](https://reaper.fm) Reabank files, with additional support for [Reaticulate](https://reaticulate.com) annotations. + +![Screenshot](screenshot.png) + +## Release Notes + +### 1.0.0 + +Initial release of reabank-syntax-highlighting. diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..dacf65a 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..5dc7e7b --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,13 @@ +{ + "comments": { + "lineComment": "//" + }, + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["\"", "\""] + ], + // symbols that can be used to surround a selection + "surroundingPairs": [ + ["\"", "\""] + ] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..69fc426 --- /dev/null +++ b/package.json @@ -0,0 +1,48 @@ +{ + "name": "reabank-syntax-highlighting", + "displayName": "Reabank Syntax Highlighting", + "description": "Syntax highlighting for Reabank files", + "version": "1.0.0", + "engines": { + "vscode": "^1.56.0" + }, + "license": "ISC", + "publisher": "adalinesimonian", + "icon": "icon.png", + "galleryBanner": { + "color": "#333", + "theme": "dark" + }, + "author": { + "name": "Adaline Simonian", + "email": "adalinesimonian@gmail.com", + "url": "https://github.com/adalinesimonian" + }, + "repository": { + "type": "git", + "url": "https://github.com/adalinesimonian/reabank-syntax-highlighting.git" + }, + "homepage": "https://github.com/adalinesimonian/reaticulate-number-banks#readme", + "categories": [ + "Programming Languages" + ], + "keywords": [ + "reaper", + "reaticulate", + "daw", + "audio production" + ], + "contributes": { + "languages": [{ + "id": "reabank", + "aliases": ["Reabank", "reabank"], + "extensions": [".reabank"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "reabank", + "scopeName": "source.reabank", + "path": "./syntaxes/reabank.tmLanguage.json" + }] + } +} diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..3d7827f Binary files /dev/null and b/screenshot.png differ diff --git a/syntaxes/reabank.tmLanguage.json b/syntaxes/reabank.tmLanguage.json new file mode 100644 index 0000000..3de4eed --- /dev/null +++ b/syntaxes/reabank.tmLanguage.json @@ -0,0 +1,174 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "Reabank", + "patterns": [ + { "include": "#program-line" }, + { "include": "#bank-line" }, + { "include": "#reaticulate-program-def" }, + { "include": "#reaticulate-annotation" }, + { "include": "#comments" } + ], + "repository": { + "bank-line": { + "match": "^(Bank)\\s+(\\d+)\\s+(\\d+)(?:\\s+([^\r?\n]+))", + "captures": { + "1": { "name": "entity.name.tag.bank.reabank" }, + "2": { "name": "constant.numeric.msb.reabank" }, + "3": { "name": "constant.numeric.lsb.reabank" }, + "4": { "name": "entity.name.type.bank.reabank" } + } + }, + "program-line": { + "match": "^(\\d+)(?:\\s+([^\r?\n]+))", + "captures": { + "1": { "name": "constant.numeric.program.reabank" }, + "2": { "name": "entity.name.other.program" } + } + }, + "reaticulate-program-def": { + "match": "^(//#prog)\\s+(\\d+)(?:\\s+([^\r?\n]+))", + "captures": { + "1": { "name": "meta.preprocessor.reaticulate-program-def.reabank" }, + "2": { "name": "constant.numeric.program.reabank" }, + "3": { "name": "entity.name.other.program" } + } + }, + "reaticulate-annotation": { + "begin": "^//!", + "end": "(?=\\r?\\n)", + "beginCaptures": { + "0": { "name": "meta.preprocessor.reaticulate-annotation.reabank" } + }, + "patterns": [ + {"include": "#attribute"}, + {"include": "#output-events"} + ] + }, + "attribute": { + "patterns": [ + { + "name": "entity.attribute.reabank", + "begin": "(?<=\\b)(i|n|c|f|g|m|n|chase|clone|off|spacer|transpose|velocity|pitchrange|velrange)(?==)", + "beginCaptures": { + "0": { "name": "entity.other.attribute-name.reabank" } + }, + "end": "(?=(\\s*+[^=\\s]|\\r?\\n))", + "patterns": [{ "include": "#attribute-interior" }] + } + ] + }, + "output-events": { + "patterns": [{ + "name": "entity.attribute.reabank", + "begin": "(?<=\\b)o(?==)", + "beginCaptures": { + "0": { "name": "entity.other.attribute-name.reabank" } + }, + "end": "(?=(\\s*+[^=\\s]|\\r?\\n))", + "patterns": [ + {"include": "#output-events-interior"} + ] + }] + }, + "attribute-interior": { + "patterns": [{ + "begin": "=", + "beginCaptures": { + "0": {"name": "punctuation.separator.key-value.reabank"} + }, + "end": "(?=\\s)", + "patterns": [ + { "include": "#strings" }, + { + "name": "entity.name.variable.enum-member.reabank", + "match": "([^\\s\"'=<>`/])+" + } + ] + }] + }, + "output-events-interior": { + "patterns": [{ + "begin": "=", + "beginCaptures": { + "0": {"name": "punctuation.separator.key-value.reabank"} + }, + "end": "(?=\\s)", + "patterns": [ + { "include": "#output-event" }, + { + "match": "/", + "name": "punctuation.separator.output-events.reabank" + } + ] + }] + }, + "output-event": { + "patterns": [ + { + "match": "(?<=[=/])-", + "name": "entity.name.operator.noroute.reabank" + }, + { + "match": "(?<=[=/]-?)(program|cc|note|note-hold|pitch|art)(?=(@|\\.|:|/|\\s))", + "name": "entity.name.function.output-event-type.reabank" + }, + { + "match": "(?<=[=/]-?(?:[a-z-]+)?)(@)(\\d+)", + "captures": { + "1": {"name": "entity.name.operator.channel.reabank"}, + "2": {"name": "constant.numeric.channel.reabank"} + } + }, + { + "match": "(?<=[=/]-?(?:[a-z-]+)?(?:@\\d+)?)(\\.)(\\d+)", + "captures": { + "1": {"name": "entity.name.operator.bus.reabank"}, + "2": {"name": "constant.numeric.bus.reabank"} + } + }, + { + "match": "(?<=[=/]-?(?:[a-z-]+)?(?:@\\d+)?(?:\\.\\d+)?)(:)(\\d+)(?:(,)(\\d+))?", + "captures": { + "1": {"name": "entity.name.operator.arguments.reabank"}, + "2": {"name": "constant.numeric.argument.reabank"}, + "3": {"name": "punctuation.separator.output-event-arguments.reabank"}, + "4": {"name": "constant.numeric.argument.reabank"} + } + }, + { + "match": "(?<=[=/]-?(?:[a-z-]+)?(?:@\\d+)?(?:\\.\\d+)?(?::\\d+(?:,\\d+)?)?)(%)(\\d+)", + "captures": { + "1": {"name": "entity.name.operator.filter-program.reabank"}, + "2": {"name": "constant.numeric.filter-program.reabank"} + } + } + ] + }, + "comments": { + "patterns": [{ + "name": "comment.line.double-slash.reabank", + "match": "//([^!#\\r\\n][^\\r\\n]*)?\\r?\\n" + }] + }, + "strings": { + "name": "string.quoted.double.reabank", + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.reabank" + } + }, + "end": "(\"|(?=\\r?\\n))", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.reabank" + } + }, + "patterns": [{ + "match": "\\\\.", + "name": "constant.character.escape.ini" + }] + } + }, + "scopeName": "source.reabank" +}