Skip to content

Commit

Permalink
Merge branch 'master' into enhanced-bsc-picker
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron authored Sep 16, 2024
2 parents 45cf3f2 + 23568cb commit fb8c811
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 8 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [[email protected]](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))
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions scripts/releases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
121 changes: 121 additions & 0 deletions src/grammar/brightscript.tmLanguage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ describe('brightscript.tmlanguage.json', () => {
`);
});

/**
* @param test comment 123
*/

it('handles comments following interface fields', async () => {
await testGrammar(`
interface Person
Expand Down Expand Up @@ -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
Expand Down
59 changes: 59 additions & 0 deletions syntaxes/brightscript.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
{
"include": "#regex"
},
{
"include": "#bsdoc"
},
{
"include": "#if_with_paren"
},
Expand Down Expand Up @@ -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": [
{
Expand Down

0 comments on commit fb8c811

Please sign in to comment.