From 1e0495d019ad849a36c1fceb85f16a008939bcf4 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Fri, 23 Aug 2024 12:41:13 -0400 Subject: [PATCH 1/4] Add `@rokucommunity/promises` to releases flow --- scripts/releases.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/releases.ts b/scripts/releases.ts index 92fabac9..2d23162c 100644 --- a/scripts/releases.ts +++ b/scripts/releases.ts @@ -454,6 +454,10 @@ class Runner { }, { name: 'roku-promise', dependencies: [] + }, { + name: 'promises', + npmName: '@rokucommunity/promises', + dependencies: [] }].map(project => { const repoName = project.name.split('/').pop(); return { From 805d59d9d8a896e076e1d516128d247144a3da3a Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Fri, 6 Sep 2024 10:35:55 -0400 Subject: [PATCH 2/4] Add syntax highlighting support for bsdoc tags (#586) * Add syntax highlighting support for bsdoc tags * Support multiple single quotes in a row * Fix @param and @type color --- src/grammar/brightscript.tmLanguage.spec.ts | 121 ++++++++++++++++++++ syntaxes/brightscript.tmLanguage.json | 59 ++++++++++ 2 files changed, 180 insertions(+) diff --git a/src/grammar/brightscript.tmLanguage.spec.ts b/src/grammar/brightscript.tmLanguage.spec.ts index df7d9327..08e28166 100644 --- a/src/grammar/brightscript.tmLanguage.spec.ts +++ b/src/grammar/brightscript.tmLanguage.spec.ts @@ -224,6 +224,10 @@ describe('brightscript.tmlanguage.json', () => { `); }); + /** + * @param test comment 123 + */ + it('handles comments following interface fields', async () => { await testGrammar(` interface Person @@ -254,6 +258,123 @@ describe('brightscript.tmlanguage.json', () => { `); }); + describe('bsdoc', () => { + //the grammar tester doesn't like testing standalone comments, so prefix all of the testable lines of code in this block with a single `t` identifier + + it('colorizes generic tags correctly', async () => { + await testGrammar(` + t'@unknownparam just comments + ' ^^^^^^^^^^^^^ comment.block.documentation.brs + ' ^^^^^^^^^^^^ storage.type.class.bsdoc + ' ^ storage.type.class.bsdoc + '^ comment.line.apostrophe.brs + `); + }); + + /** + * @param p1 comment one + * @param {string} p1 comment one + */ + it('colorizes @param without type', async () => { + await testGrammar(` + t'@param p1 + ' ^^ variable.other.bsdoc + ' ^^^^^ storage.type.class.bsdoc + ' ^ storage.type.class.bsdoc + '^ comment.line.apostrophe.brs + `); + }); + + it('colorizes @param', async () => { + await testGrammar(` + t'@param {boolean} p1 + ' ^^ variable.other.bsdoc + ' ^ punctuation.definition.bracket.curly.end.bsdoc + ' ^^^^^^^ entity.name.type.instance.bsdoc + ' ^ punctuation.definition.bracket.curly.begin.bsdoc + ' ^^^^^ storage.type.class.bsdoc + ' ^ storage.type.class.bsdoc + '^ comment.line.apostrophe.brs + `); + }); + + it('colorizes @param without name', async () => { + await testGrammar(` + t'@param {boolean} + ' ^ punctuation.definition.bracket.curly.end.bsdoc + ' ^^^^^^^ entity.name.type.instance.bsdoc + ' ^ punctuation.definition.bracket.curly.begin.bsdoc + ' ^^^^^ storage.type.class.bsdoc + ' ^ storage.type.class.bsdoc + '^ comment.line.apostrophe.brs + `); + }); + + it('colorizes @param with comment', async () => { + await testGrammar(` + t'@param {boolean} p1 this is a comment + ' ^^^^^^^^^^^^^^^^^ comment.block.documentation.brs + ' ^^ variable.other.bsdoc + ' ^ punctuation.definition.bracket.curly.end.bsdoc + ' ^^^^^^^ entity.name.type.instance.bsdoc + ' ^ punctuation.definition.bracket.curly.begin.bsdoc + ' ^^^^^ storage.type.class.bsdoc + ' ^ storage.type.class.bsdoc + '^ comment.line.apostrophe.brs + `); + }); + + it('colorizes @type without type', async () => { + await testGrammar(` + t'@type p1 + ' ^^ variable.other.bsdoc + ' ^^^^ storage.type.class.bsdoc + ' ^ storage.type.class.bsdoc + '^ comment.line.apostrophe.brs + `); + }); + + it('colorizes @param', async () => { + await testGrammar(` + t'@type {boolean} p1 + ' ^^ variable.other.bsdoc + ' ^ punctuation.definition.bracket.curly.end.bsdoc + ' ^^^^^^^ entity.name.type.instance.bsdoc + ' ^ punctuation.definition.bracket.curly.begin.bsdoc + ' ^^^^ storage.type.class.bsdoc + ' ^ storage.type.class.bsdoc + '^ comment.line.apostrophe.brs + `); + }); + + it('colorizes @param without name', async () => { + await testGrammar(` + t'@type {boolean} + ' ^ punctuation.definition.bracket.curly.end.bsdoc + ' ^^^^^^^ entity.name.type.instance.bsdoc + ' ^ punctuation.definition.bracket.curly.begin.bsdoc + ' ^^^^ storage.type.class.bsdoc + ' ^ storage.type.class.bsdoc + '^ comment.line.apostrophe.brs + `); + }); + + it('colorizes @param with comment', async () => { + await testGrammar(` + t'@type {boolean} p1 this is a comment + ' ^^^^^^^^^^^^^^^^^ comment.block.documentation.brs + ' ^^ variable.other.bsdoc + ' ^ punctuation.definition.bracket.curly.end.bsdoc + ' ^^^^^^^ entity.name.type.instance.bsdoc + ' ^ punctuation.definition.bracket.curly.begin.bsdoc + ' ^^^^ storage.type.class.bsdoc + ' ^ storage.type.class.bsdoc + '^ comment.line.apostrophe.brs + `); + }); + + }); + it.skip('handles `as Function` parameters properly', async () => { await testGrammar(` function getStyle(builderFunc as Function, processorFunc as Function) as object diff --git a/syntaxes/brightscript.tmLanguage.json b/syntaxes/brightscript.tmLanguage.json index cb841980..eae517a4 100644 --- a/syntaxes/brightscript.tmLanguage.json +++ b/syntaxes/brightscript.tmLanguage.json @@ -19,6 +19,9 @@ { "include": "#regex" }, + { + "include": "#bsdoc" + }, { "include": "#if_with_paren" }, @@ -997,6 +1000,62 @@ "match": "('\\s*vscode_rale_tracker_entry[^\\S\\r\\n]*)", "name": "keyword.preprocessor.brs" }, + "bsdoc": { + "patterns": [ + { + "include": "#bsdoc_param_and_type" + }, + { + "include": "#bsdoc_generic" + } + ] + }, + "bsdoc_generic": { + "match": "(?i:\\s*(rem|'+)\\s*(@)(\\w+)(.*$))", + "captures": { + "1": { + "name": "comment.line.apostrophe.brs" + }, + "2": { + "name": "punctuation.definition.block.tag.bsdoc storage.type.class.bsdoc" + }, + "3": { + "name": "punctuation.definition.block.tag.bsdoc storage.type.class.bsdoc" + }, + "4": { + "name": "comment.block.documentation.brs" + } + } + }, + "bsdoc_param_and_type": { + "match": "(?i:\\s*(rem|'+)\\s*(@)(param|type)\\s+(?:(\\{)\\s*([^\\}]+)\\s*(\\}))?\\s*([a-z0-9_.]+)?(.*))", + "captures": { + "1": { + "name": "comment.line.apostrophe.brs" + }, + "2": { + "name": "punctuation.definition.block.tag.bsdoc storage.type.class.bsdoc" + }, + "3": { + "name": "punctuation.definition.block.tag.bsdoc storage.type.class.bsdoc" + }, + "4": { + "name": "punctuation.definition.bracket.curly.begin.bsdoc" + }, + "5": { + "name": " comment.block.documentation.brs entity.name.type.instance.bsdoc" + }, + "6": { + "name": "punctuation.definition.bracket.curly.end.bsdoc" + }, + "7": { + "name": "variable.other.bsdoc" + }, + "8": { + "name": "comment.block.documentation.brs" + } + } + }, "annotation": { "patterns": [ { From 5f65688d149678a087c35b95f2b0f1b65b5656ce Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Fri, 6 Sep 2024 16:00:11 -0400 Subject: [PATCH 3/4] Update changelog for v2.49.0 --- CHANGELOG.md | 13 +++++++++++++ package-lock.json | 8 ++++---- package.json | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78ed01c3..b8c96ea4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## [2.49.0](https://github.com/rokucommunity/vscode-brightscript-language/compare/v2.48.6...v2.49.0) - 2024-09-06 +### Added + - Add syntax highlighting support for bsdoc tags ([#586](https://github.com/rokucommunity/vscode-brightscript-language/pull/586)) + - Add sort imports setting ([#582](https://github.com/rokucommunity/vscode-brightscript-language/pull/582)) +### Changed + - upgrade to [brighterscript@0.67.6](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0676---2024-09-05). Notable changes since 0.67.4: + - Add support for resolving sourceRoot at time of config load ([brighterscript#1290](https://github.com/rokucommunity/brighterscript/pull/1290)) + - Add support for roIntrinsicDouble ([brighterscript#1291](https://github.com/rokucommunity/brighterscript/pull/1291)) + - Add plugin naming convention ([brighterscript#1284](https://github.com/rokucommunity/brighterscript/pull/1284)) + - Add templatestring support for annotation.getArguments() ([brighterscript#1264](https://github.com/rokucommunity/brighterscript/pull/1264)) + + + ## [2.48.6](https://github.com/rokucommunity/vscode-brightscript-language/compare/v2.48.5...v2.48.6) - 2024-07-24 ### Added - support for viewing nodes that are in the node tree from NodeCountByTypePage ([#579](https://github.com/rokucommunity/vscode-brightscript-language/pull/579)) diff --git a/package-lock.json b/package-lock.json index 072e7426..c48768d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@vscode/extension-telemetry": "^0.4.7", "array-sort": "^1.0.0", "backoff": "^2.5.0", - "brighterscript": "^0.67.4", + "brighterscript": "^0.67.6", "brighterscript-formatter": "^1.7.4", "clone-deep": "^4.0.1", "debounce": "^1.2.0", @@ -2573,9 +2573,9 @@ } }, "node_modules/brighterscript": { - "version": "0.67.4", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.67.4.tgz", - "integrity": "sha512-1EbX2Po9WbIyi4r557fk6txkYR0VvbnGm1caS9AVlVek2R6d9+QsQxr+f24PePM4l/TOBvZ1JieBt6NheM4P2Q==", + "version": "0.67.6", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.67.6.tgz", + "integrity": "sha512-MsqPOTJSzvVaOY4R5aykdg9jqesBPZbIXZZvmBKHI5DYwBWtY9SMDe2G+AwTwQ3q8KJvmsPQ6Yw/UbL8tReizQ==", "dependencies": { "@rokucommunity/bslib": "^0.1.1", "@rokucommunity/logger": "^0.3.9", diff --git a/package.json b/package.json index 001200bf..36bc0920 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@vscode/extension-telemetry": "^0.4.7", "array-sort": "^1.0.0", "backoff": "^2.5.0", - "brighterscript": "^0.67.4", + "brighterscript": "^0.67.6", "brighterscript-formatter": "^1.7.4", "clone-deep": "^4.0.1", "debounce": "^1.2.0", From 23568cb49def85cf42506060eac925d600212834 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Fri, 6 Sep 2024 16:00:41 -0400 Subject: [PATCH 4/4] 2.49.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c48768d2..8c2e878b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "brightscript", - "version": "2.48.6", + "version": "2.49.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "brightscript", - "version": "2.48.6", + "version": "2.49.0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 36bc0920..83ec9a50 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "brightscript", "displayName": "BrightScript Language", - "version": "2.48.6", + "version": "2.49.0", "publisher": "RokuCommunity", "description": "Language support for Roku's BrightScript language.", "author": {