From dc80cc969c2a516220a3783412b27b371cd9bcd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerard=20Gasc=C3=B3n?= <52170489+GerardGascon@users.noreply.github.com> Date: Thu, 23 Dec 2021 22:15:42 +0100 Subject: [PATCH] Added regions and fixed syntax highlighting SGDK resource files now have regions - #region / #pragma region - #endregion / #pragma endregion Fixed some syntax highlighting errors related to the numbers - 2ADPCM should now be highlighted as expected --- CHANGELOG.md | 7 +++++++ README.md | 7 +++++++ package.json | 5 ++--- resources/language-configuration.json | 16 ++++++++++++++++ resources/res_grammar.json | 14 +++++++++++--- 5 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 resources/language-configuration.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 41f4dae9..470260cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ This is the change Log of Genesis Code. For more information you can see the [Documentation page](https://zerasul.github.io/genesis-code-docs/). +## 1.3.4 + +* SGDK resource files now have regions + * They start with *#region* / *#pragma region* + * They end with *#endregion* / *#pragma endregion* +* Fixed some syntax highlighting errors related with numbers + ## 1.3.3 * [Added SGDK 1.65 Support](https://github.com/zerasul/genesis-code/issues/277). diff --git a/README.md b/README.md index fe03c023..4860735c 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,13 @@ Now you can use the Bitmap Viewer; with some information of the images. You can ## Release Notes +### 1.3.4 + +* SGDK resource files now have regions + * They start with *#region* / *#pragma region* + * They end with *#endregion* / *#pragma endregion* +* Fixed some syntax highlighting errors related with numbers + ### 1.3.3 * Added SGDK 1.65 Support. diff --git a/package.json b/package.json index 99e3db82..eebe1910 100644 --- a/package.json +++ b/package.json @@ -94,9 +94,8 @@ "languages": [ { "id": "Sgdk Resource File", - "extensions": [ - ".res" - ] + "extensions": [".res"], + "configuration": "./resources/language-configuration.json" } ], "grammars": [ diff --git a/resources/language-configuration.json b/resources/language-configuration.json new file mode 100644 index 00000000..a5ebf5e1 --- /dev/null +++ b/resources/language-configuration.json @@ -0,0 +1,16 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "#", + }, + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["\"", "\""] + ], + "folding": { + "markers": { + "start": "(^\\s*#?region\\b)|(^\\s*#?pragma region\\b)", + "end": "(^\\s*#?endregion\\b)|(^\\s*#?pragma endregion\\b)" + } + } +} \ No newline at end of file diff --git a/resources/res_grammar.json b/resources/res_grammar.json index 9cd7f01b..2a35d592 100644 --- a/resources/res_grammar.json +++ b/resources/res_grammar.json @@ -26,6 +26,9 @@ { "include": "#compression" }, + { + "include": "#regions" + }, { "include": "#comment" }, @@ -92,7 +95,7 @@ ] }, "number": { - "match": "\\d", + "match": "([0-9]+\\\n)|(\\ +[0-9]+\\ )|(\t+[0-9]+\\ )|(\\ +[0-9]+\t)|(\t+[0-9]+\t)", "name": "constant.numeric.number" }, "height": { @@ -111,7 +114,12 @@ "end": "\\\n", "name": "comment.line.number-sign" }, - "timing": { + "regions": { + "begin": "(\\#region)|(\\#endregion)|(\\#pragma region)|(\\#pragma endregion)", + "end": "\\\n", + "name": "markup.italic" + }, + "timing": { "match": "AUTO|NTSC|PAL", "name": "keyword.control.timing" }, @@ -171,4 +179,4 @@ ] } } -} +} \ No newline at end of file