Skip to content

Commit

Permalink
initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Cupelt committed Jul 30, 2023
0 parents commit c11889f
Show file tree
Hide file tree
Showing 10 changed files with 275 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.vsix
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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}"
]
}
]
}
3 changes: 3 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vscode/**
.vscode-test/**
.gitignore
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Change Log

All notable changes to the "TriggerReactor-VSCode" extension will be documented in this file.

## [1.0.0] - 2023-03-22

### Added

- Add language highlighter

## [1.0.1] - 2023-04-19

### Added

- Add language highlighter `SYNC statements`
- Add language highlighter `AS statements`
- Add language highlighter `SYNC/ASYNC statements`
- Add language highlighter `commant`

- support folding

### Fixed

- Fixed a `FINNALY` was not highlighted.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Cupelt

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.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# TriggerReactor-VSCode

VSCode Helper from TriggerReactor
Binary file added icons/TRGLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
"lineComment": "//",
},
// symbols used as brackets
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
// symbols that are auto closed when typing
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
// symbols that can be used to surround a selection
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
]
}
32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "triggerreactor-vscode",
"displayName": "TriggerReactor-VSCode",
"description": "Support for TriggerReactor scripts",
"icon": "icons/TRGLogo.png",
"repository": "https://github.com/Cupelt/triggerreactor-vscode",
"version": "1.0.1-Release",
"publisher": "TriggerReactor",
"engines": {
"vscode": "*"
},
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [{
"id": "TriggerReactor",
"aliases": ["TriggerReactor", "trg"],
"extensions": [".trg"],
"configuration": "./language-configuration.json",
"icon": {
"light": "./icons/TRGLogo.png",
"dark": "./icons/TRGLogo.png"
}
}],
"grammars": [{
"language": "TriggerReactor",
"scopeName": "source.triggerreactor",
"path": "./syntaxes/TriggerReactor.tmLanguage.json"
}]
}
}
146 changes: 146 additions & 0 deletions syntaxes/triggerreactor.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "TriggerReactor",
"patterns": [
{
"include": "#import"
},
{
"include": "#executors"
},
{
"include": "#placeholders"
},
{
"include": "#class"
},
{
"include": "#functions"
},
{
"include": "#comments"
},
{
"include": "#numbers"
},
{
"include": "#constants-and-special-vars"
},
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#variables"
}
],
"repository": {
"keywords":{
"patterns": [
{
"patterns": [
{
"name": "keyword.control.TriggerReactor",
"match": "\\b(IF|ELSE|ELSEIF|ENDIF|IS|WHILE|ENDWHILE|FOR|ENDFOR|TRY|CATCH|FINALLY|ENDTRY|LAMBDA|ENDLAMBDA)\\b"
},
{
"name": "keyword.control.TriggerReactor",
"match": "\\b(if|else|elseif|endif|is|while|endwhile|for|endfor|try|catch|finally|endtry|lambda|endlambda)\\b"
},
{
"name": "entity.name.namespace",
"match": "\\b(SYNC|ENDSYNC|ASYNC|ENDASYNC)\\b"
},
{
"name": "entity.name.namespace",
"match": "\\b(sync|endsync|async|endasync)\\b"
},
{
"name": "keyword.control.ternary.TriggerReactor",
"match": "\\?|:"
}
]
},
{
"name": "keyword.operator.TriggerReactor",
"match": "(===?|!=|<=|>=|<>|<|>)"
}
]
},
"strings": {
"name": "string.quoted.double.TriggerReactor",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.TriggerReactor",
"match": "\\\\."
}
]
},
"numbers": {
"patterns": [
{
"match": "(?x)\n\\b(?<!\\$)\n0(x|X)\n(\n (?<!\\.)[0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?[Ll]?(?!\\.)\n |\n (\n [0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?\\.?\n |\n ([0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?)?\\.[0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?\n )\n [Pp][+-]?[0-9]([0-9_]*[0-9])?[FfDd]?\n)\n\\b(?!\\$)",
"name": "constant.numeric.hex.TriggerReactor"
},
{
"match": "\\b(?<!\\$)0(b|B)[01]([01_]*[01])?[Ll]?\\b(?!\\$)",
"name": "constant.numeric.binary.TriggerReactor"
},
{
"match": "\\b(?<!\\$)0[0-7]([0-7_]*[0-7])?[Ll]?\\b(?!\\$)",
"name": "constant.numeric.octal.TriggerReactor"
},
{
"match": "(?x)\n(?<!\\$)\n(\n \\b[0-9]([0-9_]*[0-9])?\\.\\B(?!\\.)\n |\n \\b[0-9]([0-9_]*[0-9])?\\.([Ee][+-]?[0-9]([0-9_]*[0-9])?)[FfDd]?\\b\n |\n \\b[0-9]([0-9_]*[0-9])?\\.([Ee][+-]?[0-9]([0-9_]*[0-9])?)?[FfDd]\\b\n |\n \\b[0-9]([0-9_]*[0-9])?\\.([0-9]([0-9_]*[0-9])?)([Ee][+-]?[0-9]([0-9_]*[0-9])?)?[FfDd]?\\b\n |\n (?<!\\.)\\B\\.[0-9]([0-9_]*[0-9])?([Ee][+-]?[0-9]([0-9_]*[0-9])?)?[FfDd]?\\b\n |\n \\b[0-9]([0-9_]*[0-9])?([Ee][+-]?[0-9]([0-9_]*[0-9])?)[FfDd]?\\b\n |\n \\b[0-9]([0-9_]*[0-9])?([Ee][+-]?[0-9]([0-9_]*[0-9])?)?[FfDd]\\b\n |\n \\b(0|[1-9]([0-9_]*[0-9])?)(?!\\.)[Ll]?\\b\n)\n(?!\\$)",
"name": "constant.numeric.decimal.TriggerReactor"
}
]
},
"constants-and-special-vars": {
"patterns": [
{
"match": "\\b(true|false|null)\\b",
"name": "constant.language.TriggerReactor"
}
]
},
"comments": {
"name": "comment.line.TriggerReactor",
"begin": "//",
"end": "$"
},
"import": {
"begin": "(import|IMPORT)\\s(\\w|\\.)*(\\sas\\s|\\sAS\\s)?",
"beginCaptures": {
"1": { "name" : "storage.modifier.import.TriggerReactor" },
"3": { "name" : "storage.modifier.import.TriggerReactor" }
},
"end": "(\\n|;)"
},
"functions": {
"name": "entity.name.function.TriggerReactor",
"match": "([A-Za-z_$][\\w$]*)\\s*(\\()"
},
"class": {
"name": "entity.name.class.TriggerReactor",
"match": "\\b(?<!\\.)[A-Z]\\w*\\("
},
"variables": {
"name": "variable.other.object.triggerreactor",
"match": "(?<![\\w$])[a-zA-Z_$][\\w$]*(?=\\s*\\.\\s*[\\w$]+)"
},
"executors": {
"name": "entity.other.inherited-class.triggerreactor",
"match": "^\\s*#[A-Z|a-z]+"
},
"placeholders": {
"name" : "variable.parameter",
"match": "\\$\\w+"
}
},
"scopeName": "source.triggerreactor"
}

0 comments on commit c11889f

Please sign in to comment.