Skip to content

Commit

Permalink
Merge branch 'master' into feature/542-support-multiple-automations
Browse files Browse the repository at this point in the history
  • Loading branch information
justintucker1 committed Dec 30, 2024
2 parents 07284a2 + 51d4f83 commit 0af2437
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 101 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



## [2.51.0](https://github.com/rokucommunity/vscode-brightscript-language/compare/v2.50.5...v2.51.0) - 2024-12-20
### Added
- new remote commands ([#605](https://github.com/rokucommunity/vscode-brightscript-language/pull/605))
- `AppManager` `AppMemoryMonitor` `AppMemoryMonitorEvent` coloring ([#602](https://github.com/rokucommunity/vscode-brightscript-language/pull/602))
### Changed
- upgrade to [roku-deploy@3.12.3](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#3123---2024-12-06). Notable changes since 3.12.2:
- Fix issues with detecting "check for updates required" ([roku-deploy#181](https://github.com/rokucommunity/roku-deploy/pull/181))
- Identify when a 577 error is thrown, send a new developer friendly message ([roku-deploy#180](https://github.com/rokucommunity/roku-deploy/pull/180))
- upgrade to [roku-debug@0.21.13](https://github.com/rokucommunity/roku-debug/blob/master/CHANGELOG.md#02113---2024-12-20). Notable changes since 0.21.12:
- Check for two error types. Make sure we do not double display an error ([roku-debug#204](https://github.com/rokucommunity/roku-debug/pull/204))
- Add `$children` virtual variables for `roSGNode` ([roku-debug#192](https://github.com/rokucommunity/roku-debug/pull/192))
- Add the missing `Diagnostic` props to `BSDebugDiagnostic` ([roku-debug#203](https://github.com/rokucommunity/roku-debug/pull/203))
- Upgrade dependencies ([roku-debug#202](https://github.com/rokucommunity/roku-debug/pull/202))
- upgrade to [brighterscript@0.68.2](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0682---2024-12-06). Notable changes since 0.67.8:
- Add more convenience exports from vscode-languageserver ([brighterscript#1359](https://github.com/rokucommunity/brighterscript/pull/1359))
- Fix bug with ternary transpile for indexed set ([brighterscript#1357](https://github.com/rokucommunity/brighterscript/pull/1357))
- Add Namespace Source Literals ([brighterscript#1353](https://github.com/rokucommunity/brighterscript/pull/1353))
- Enhance lexer to support long numeric literals with type designators ([brighterscript#1351](https://github.com/rokucommunity/brighterscript/pull/1351))
- Fix issues with the ast walkArray function ([brighterscript#1347](https://github.com/rokucommunity/brighterscript/pull/1347))
- Optimize ternary transpilation for assignments ([brighterscript#1341](https://github.com/rokucommunity/brighterscript/pull/1341))
- upgrade to [brighterscript-formatter@1.7.7](https://github.com/rokucommunity/brighterscript-formatter/blob/master/CHANGELOG.md#177---2024-12-20)
### Fixed
- issues with busy spinner showing too many error messages ([#607](https://github.com/rokucommunity/vscode-brightscript-language/pull/607))
- syntax highlighting but for object functions ([#604](https://github.com/rokucommunity/vscode-brightscript-language/pull/604))
- numeric literal colorization ([#603](https://github.com/rokucommunity/vscode-brightscript-language/pull/603))



## [2.50.5](https://github.com/rokucommunity/vscode-brightscript-language/compare/v2.50.4...v2.50.5) - 2024-11-06
### Changed
- Show multi-line lsp progress details ([#600](https://github.com/rokucommunity/vscode-brightscript-language/pull/600))
Expand Down
133 changes: 45 additions & 88 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "brightscript",
"displayName": "BrightScript Language",
"version": "2.50.5",
"version": "2.51.0",
"publisher": "RokuCommunity",
"description": "Language support for Roku's BrightScript language.",
"author": {
Expand Down Expand Up @@ -57,8 +57,8 @@
"@vscode/extension-telemetry": "^0.4.7",
"array-sort": "^1.0.0",
"backoff": "^2.5.0",
"brighterscript": "^0.67.8",
"brighterscript-formatter": "^1.7.6",
"brighterscript": "^0.68.2",
"brighterscript-formatter": "^1.7.7",
"clone-deep": "^4.0.1",
"debounce": "^1.2.0",
"dotenv": "^6.2.0",
Expand All @@ -79,8 +79,8 @@
"postman-request": "^2.88.1-postman.32",
"pretty-bytes": "^5.6.0",
"resolve": "^1.22.8",
"roku-debug": "^0.21.12",
"roku-deploy": "^3.12.2",
"roku-debug": "^0.21.13",
"roku-deploy": "^3.12.3",
"roku-test-automation": "^2.0.10",
"semver": "^7.1.3",
"source-map": "^0.7.3",
Expand Down
33 changes: 31 additions & 2 deletions src/LanguageServerManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { LanguageServerManager } from './LanguageServerManager';
import { expect } from 'chai';
import { DefinitionRepository } from './DefinitionRepository';
import { DeclarationProvider } from './DeclarationProvider';
import type { ExtensionContext } from 'vscode';
import type { ExtensionContext, Disposable } from 'vscode';
import * as path from 'path';
import { Deferred, standardizePath as s } from 'brighterscript';
import { BusyStatus, Deferred, standardizePath as s } from 'brighterscript';
import * as fsExtra from 'fs-extra';
import URI from 'vscode-uri';
import { languageServerInfoCommand } from './commands/LanguageServerInfoCommand';
Expand Down Expand Up @@ -525,4 +525,33 @@ describe('LanguageServerManager', () => {
`);
});
});

describe('registerBusyStatusHandler', () => {
it('resets the timer anytime we get a new busy status', async () => {
languageServerManager['busyStatusWarningThreshold'] = 100;

let handler: any;
const client = {
onNotification: (method, h) => {
handler = h;
return undefined as Disposable;
},
outputChannel: {
appendLine: sinon.stub()
}
};
languageServerManager['client'] = client as any;

languageServerManager['registerBusyStatusHandler']();

handler({ status: BusyStatus.busy });
handler({ status: BusyStatus.busy });
handler({ status: BusyStatus.busy });
handler({ status: BusyStatus.busy });

await util.sleep(200);
//we should only have 1 console print (for the final busy event we sent)
expect(client.outputChannel.appendLine.callCount).to.eql(1);
});
});
});
17 changes: 11 additions & 6 deletions src/LanguageServerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ export class LanguageServerManager {
return this.ready();
}

/**
* How many milliseconds to wait before showing a warning about the LSP being busy for too long
*/
private busyStatusWarningThreshold = 60_000;

private registerBusyStatusHandler() {
let timeoutHandle: NodeJS.Timeout;

Expand All @@ -287,19 +292,19 @@ export class LanguageServerManager {
console.log(event);
this.updateStatusbar(event.status === BusyStatus.busy, event.activeRuns);

//clear any existing timeout
if (timeoutHandle) {
clearTimeout(timeoutHandle);
}

//if the busy status takes too long, write a lsp log entry with details of what's still pending
if (event.status === BusyStatus.busy) {
timeoutHandle = setTimeout(() => {
const delay = Date.now() - event.timestamp;
this.client.outputChannel.appendLine(`${logger.formatTimestamp(new Date())} language server has been 'busy' for ${delay}ms. most recent busyStatus event: ${JSON.stringify(event, undefined, 4)}`);
}, 60_000);

//clear any existing timeout
} else if (timeoutHandle) {
clearTimeout(timeoutHandle);
}, this.busyStatusWarningThreshold);
}
});

}

/**
Expand Down

0 comments on commit 0af2437

Please sign in to comment.