diff --git a/CHANGELOG.md b/CHANGELOG.md index 99bd102f..8286b483 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,65 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## [2.42.0](https://github.com/rokucommunity/vscode-brightscript-language/compare/v2.41.2...2.42.0) - 2023-07-26 +### Added + - `deleteDevChannelBeforeInstall` launch option ([#494](https://github.com/rokucommunity/vscode-brightscript-language/pull/494)) +### Changed + - upgrade to [roku-debug@0.20.3](https://github.com/rokucommunity/roku-debug/blob/master/CHANGELOG.md#0203---2023-07-26). Notable changes since 0.20.2: + - Add `deleteDevChannelBeforeInstall` option to delete dev channel before install ([roku-debug#158](https://github.com/rokucommunity/roku-debug/pull/158)) + + + +## [2.41.2](https://github.com/rokucommunity/vscode-brightscript-language/compare/v2.41.1...v2.41.2) - 2023-07-25 +### Added + - a spinner in the statusbar when the language server is busy ([#492](https://github.com/rokucommunity/vscode-brightscript-language/pull/492)) +### Changed + - upgrade to [roku-deploy@3.10.3](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#3103---2023-07-22). Notable changes since 3.10.2: + - Bump word-wrap from 1.2.3 to 1.2.4 ([roku-deploy#117](https://github.com/rokucommunity/roku-deploy/pull/117)) + - upgrade to [roku-debug@0.20.2](https://github.com/rokucommunity/roku-debug/blob/master/CHANGELOG.md#0202---2023-07-24). Notable changes since 0.20.1: + - Bump word-wrap from 1.2.3 to 1.2.4 ([roku-debug#157](https://github.com/rokucommunity/roku-debug/pull/157)) + - upgrade to [brighterscript@0.65.4](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0654---2023-07-24). Notable changes since 0.65.1: + - Bump word-wrap from 1.2.3 to 1.2.4 ([brighterscript#851](https://github.com/rokucommunity/brighterscript/pull/851)) + - Show busy spinner for lsp builds ([brighterscript#852](https://github.com/rokucommunity/brighterscript/pull/852)) + - Expose event interface ([brighterscript#845](https://github.com/rokucommunity/brighterscript/pull/845)) + - Add beforeProgramDispose event ([brighterscript#844](https://github.com/rokucommunity/brighterscript/pull/844)) + - Make component ready on afterScopeCreate ([brighterscript#843](https://github.com/rokucommunity/brighterscript/pull/843)) + - Add project index to language server log entries ([brighterscript#836](https://github.com/rokucommunity/brighterscript/pull/836)) + - Bump semver from 6.3.0 to 6.3.1 in /benchmarks ([brighterscript#838](https://github.com/rokucommunity/brighterscript/pull/838)) + - Bump semver from 5.7.1 to 5.7.2 ([brighterscript#837](https://github.com/rokucommunity/brighterscript/pull/837)) + - Prevent crashing when diagnostic is missing range. ([brighterscript#832](https://github.com/rokucommunity/brighterscript/pull/832)) + - Prevent crash when diagnostic is missing range ([brighterscript#831](https://github.com/rokucommunity/brighterscript/pull/831)) + - Add baseline interface docs ([brighterscript#829](https://github.com/rokucommunity/brighterscript/pull/829)) + - upgrade to [brighterscript-formatter@1.6.31](https://github.com/rokucommunity/brighterscript-formatter/blob/master/CHANGELOG.md#1631---2023-07-24). Notable changes since 1.6.30: + - Bump word-wrap from 1.2.3 to 1.2.4 ([brighterscript-formatter#74](https://github.com/rokucommunity/brighterscript-formatter/pull/74)) + + + +## [2.41.1](https://github.com/rokucommunity/vscode-brightscript-language/compare/v2.41.0...v2.41.1) - 2023-07-07 +### Changed + - upgrade to [roku-debug@0.20.1](https://github.com/rokucommunity/roku-debug/blob/master/CHANGELOG.md#0201---2023-07-07). Notable changes since 0.20.0: + - Fix rendezvous tracking crash ([roku-debug#156](https://github.com/rokucommunity/roku-debug/pull/156)) + + + +## [2.41.0](https://github.com/rokucommunity/vscode-brightscript-language/compare/v2.40.4...v2.41.0) - 2023-07-05 +### Added + - ECP Rendezvous tracking (`rendezvousTracking` launch.json option) ([#490](https://github.com/rokucommunity/vscode-brightscript-language/pull/490)) + - `fileLogging` launch.json option ([#487](https://github.com/rokucommunity/vscode-brightscript-language/pull/487)) +### Changed +### Fixed + - Fix iface syntax highlighting for comments & funcs ([#489](https://github.com/rokucommunity/vscode-brightscript-language/pull/489)) + - npm audit issues ([4121aee](https://github.com/rokucommunity/vscode-brightscript-language/commit/4121aee)) + - upgrade to [roku-debug@0.20.0](https://github.com/rokucommunity/roku-debug/blob/master/CHANGELOG.md#0200---2023-07-05). Notable changes since 0.18.12: + - Support sgrendezvous through ecp ([roku-debug#150](https://github.com/rokucommunity/roku-debug/pull/150)) + - Move `@types/request` to deps to fix `d.bs` files ([#roku-debug691a7be](https://github.com/rokucommunity/roku-debug/commit/691a7be)) + - File logging ([roku-debug#155](https://github.com/rokucommunity/roku-debug/pull/155)) + - upgrade to [brighterscript@0.65.1](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0651---2023-06-09). Notable changes since 0.65.0: + - Fix injection of duplicate super calls into classes ([brighterscript#823](https://github.com/rokucommunity/brighterscript/pull/823)) + - upgrade to [brighterscript-formatter@1.6.30](https://github.com/rokucommunity/brighterscript-formatter/blob/master/CHANGELOG.md#1630---2023-07-05) + + + ## [2.40.4](https://github.com/rokucommunity/vscode-brightscript-language/compare/v2.40.3...v2.40.4) - 2023-05-18 ### Changed - upgrade to [roku-debug@0.18.12](https://github.com/rokucommunity/roku-debug/blob/master/CHANGELOG.md#01812---2023-05-18). Notable changes since 0.18.11: diff --git a/package-lock.json b/package-lock.json index 520b22aa..0bbe2e10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,20 +1,20 @@ { "name": "brightscript", - "version": "2.40.4", + "version": "2.42.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "brightscript", - "version": "2.40.4", + "version": "2.42.0", "hasInstallScript": true, "license": "MIT", "dependencies": { "@vscode/extension-telemetry": "^0.4.7", "array-sort": "^1.0.0", "backoff": "^2.5.0", - "brighterscript": "^0.65.0", - "brighterscript-formatter": "^1.6.29", + "brighterscript": "^0.65.4", + "brighterscript-formatter": "^1.6.31", "debounce": "^1.2.0", "dotenv": "^6.2.0", "fast-xml-parser": "^3.12.16", @@ -29,8 +29,8 @@ "node-ssdp": "^4.0.0", "postman-request": "^2.88.1-postman.32", "pretty-bytes": "^5.6.0", - "roku-debug": "^0.19.1", - "roku-deploy": "^3.10.2", + "roku-debug": "^0.20.3", + "roku-deploy": "^3.10.3", "roku-test-automation": "^2.0.0-beta.20", "semver": "^7.1.3", "source-map": "^0.7.3", @@ -2440,9 +2440,9 @@ } }, "node_modules/brighterscript": { - "version": "0.65.0", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.0.tgz", - "integrity": "sha512-SnBYgL5f8kReqteJYT8TASYHu2XRc2gPxZfL2Q1JVeF9i5xeK4lJGAzjK3dinuiirYzHNIIoXpkzhTFIq7+DDg==", + "version": "0.65.4", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.4.tgz", + "integrity": "sha512-bp2aVhLOM1xRuZiyKx1WQp4JS8Fm6wfD7kAI4rE3YYMYeMhZ/SxTCvBtmTsaW/Z40oB8bBJXuKSuXgz2uF+ywQ==", "dependencies": { "@rokucommunity/bslib": "^0.1.1", "@xml-tools/parser": "^1.0.7", @@ -2467,7 +2467,7 @@ "parse-ms": "^2.1.0", "readline": "^1.3.0", "require-relative": "^0.8.7", - "roku-deploy": "^3.10.2", + "roku-deploy": "^3.10.3", "serialize-error": "^7.0.1", "source-map": "^0.7.4", "vscode-languageserver": "7.0.0", @@ -2482,11 +2482,11 @@ } }, "node_modules/brighterscript-formatter": { - "version": "1.6.29", - "resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.29.tgz", - "integrity": "sha512-NfFscJM+9lEyaWrY5J9pliLOhNxiBkfsBKD8XmbigrbWpY4Ff6sqojw0Op2SFhySWy7N2e4J4inshx9FgKTI1A==", + "version": "1.6.31", + "resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.31.tgz", + "integrity": "sha512-XOc1LVAUXrWtCwAZeOUS/7gH5TbiEqZ0IwyAJcM7J5CxrFpMrw6NKg/Yox1oKaH1m11kcLR7KgckK5CTha0eYQ==", "dependencies": { - "brighterscript": "^0.65.0", + "brighterscript": "^0.65.4", "glob-all": "^3.3.0", "jsonc-parser": "^3.0.0", "source-map": "^0.7.3", @@ -8941,13 +8941,13 @@ } }, "node_modules/roku-debug": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/roku-debug/-/roku-debug-0.19.1.tgz", - "integrity": "sha512-Y67K2k6o0QeOq7BH2MWInj7DegSk2azHTdkcuihpBgLNlGLKvXWTJdA4bnpytzM61Oj0izFWewdeA5r3VBOAeA==", + "version": "0.20.3", + "resolved": "https://registry.npmjs.org/roku-debug/-/roku-debug-0.20.3.tgz", + "integrity": "sha512-hrInaz7X7DWs6S8cfy8hsqeE8F7kDdxMpYWa6OVlkfeX5lWDZuNfwWhfAUntuNMpdCTMMKxWX270BndU9deM+Q==", "dependencies": { "@rokucommunity/logger": "^0.3.3", "@types/request": "^2.48.8", - "brighterscript": "^0.65.0", + "brighterscript": "^0.65.4", "dateformat": "~4", "eol": "^0.9.1", "eventemitter3": "^4.0.7", @@ -8958,8 +8958,8 @@ "postman-request": "^2.88.1-postman.32", "replace-in-file": "^6.3.2", "replace-last": "^1.2.6", - "roku-deploy": "^3.10.2", - "semver": "^7.3.5", + "roku-deploy": "^3.10.3", + "semver": "^7.5.3", "serialize-error": "^8.1.0", "smart-buffer": "^4.2.0", "source-map": "^0.7.4", @@ -9028,9 +9028,9 @@ } }, "node_modules/roku-deploy": { - "version": "3.10.2", - "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.10.2.tgz", - "integrity": "sha512-oKMw8+CpbvFrNjf3g7PmhSRInTXitaFmtFhxb0ANiE+sC2p+/8wn/1/KqnYsTWPdEKUOLh0xIz2FHK9Nd5o9UA==", + "version": "3.10.3", + "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.10.3.tgz", + "integrity": "sha512-COJSQ638QklcM+8AN1nujFuzT04rTZLFuLSww35edm8w/y0l60oF/Iu7TQ46m75DwoGFzGFfomLEmA1ltQk9mA==", "dependencies": { "chalk": "^2.4.2", "dateformat": "^3.0.3", @@ -9208,9 +9208,9 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -13429,9 +13429,9 @@ } }, "brighterscript": { - "version": "0.65.0", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.0.tgz", - "integrity": "sha512-SnBYgL5f8kReqteJYT8TASYHu2XRc2gPxZfL2Q1JVeF9i5xeK4lJGAzjK3dinuiirYzHNIIoXpkzhTFIq7+DDg==", + "version": "0.65.4", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.4.tgz", + "integrity": "sha512-bp2aVhLOM1xRuZiyKx1WQp4JS8Fm6wfD7kAI4rE3YYMYeMhZ/SxTCvBtmTsaW/Z40oB8bBJXuKSuXgz2uF+ywQ==", "requires": { "@rokucommunity/bslib": "^0.1.1", "@xml-tools/parser": "^1.0.7", @@ -13456,7 +13456,7 @@ "parse-ms": "^2.1.0", "readline": "^1.3.0", "require-relative": "^0.8.7", - "roku-deploy": "^3.10.2", + "roku-deploy": "^3.10.3", "serialize-error": "^7.0.1", "source-map": "^0.7.4", "vscode-languageserver": "7.0.0", @@ -13534,11 +13534,11 @@ } }, "brighterscript-formatter": { - "version": "1.6.29", - "resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.29.tgz", - "integrity": "sha512-NfFscJM+9lEyaWrY5J9pliLOhNxiBkfsBKD8XmbigrbWpY4Ff6sqojw0Op2SFhySWy7N2e4J4inshx9FgKTI1A==", + "version": "1.6.31", + "resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.31.tgz", + "integrity": "sha512-XOc1LVAUXrWtCwAZeOUS/7gH5TbiEqZ0IwyAJcM7J5CxrFpMrw6NKg/Yox1oKaH1m11kcLR7KgckK5CTha0eYQ==", "requires": { - "brighterscript": "^0.65.0", + "brighterscript": "^0.65.4", "glob-all": "^3.3.0", "jsonc-parser": "^3.0.0", "source-map": "^0.7.3", @@ -18373,13 +18373,13 @@ } }, "roku-debug": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/roku-debug/-/roku-debug-0.19.1.tgz", - "integrity": "sha512-Y67K2k6o0QeOq7BH2MWInj7DegSk2azHTdkcuihpBgLNlGLKvXWTJdA4bnpytzM61Oj0izFWewdeA5r3VBOAeA==", + "version": "0.20.3", + "resolved": "https://registry.npmjs.org/roku-debug/-/roku-debug-0.20.3.tgz", + "integrity": "sha512-hrInaz7X7DWs6S8cfy8hsqeE8F7kDdxMpYWa6OVlkfeX5lWDZuNfwWhfAUntuNMpdCTMMKxWX270BndU9deM+Q==", "requires": { "@rokucommunity/logger": "^0.3.3", "@types/request": "^2.48.8", - "brighterscript": "^0.65.0", + "brighterscript": "^0.65.4", "dateformat": "~4", "eol": "^0.9.1", "eventemitter3": "^4.0.7", @@ -18390,8 +18390,8 @@ "postman-request": "^2.88.1-postman.32", "replace-in-file": "^6.3.2", "replace-last": "^1.2.6", - "roku-deploy": "^3.10.2", - "semver": "^7.3.5", + "roku-deploy": "^3.10.3", + "semver": "^7.5.3", "serialize-error": "^8.1.0", "smart-buffer": "^4.2.0", "source-map": "^0.7.4", @@ -18445,9 +18445,9 @@ } }, "roku-deploy": { - "version": "3.10.2", - "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.10.2.tgz", - "integrity": "sha512-oKMw8+CpbvFrNjf3g7PmhSRInTXitaFmtFhxb0ANiE+sC2p+/8wn/1/KqnYsTWPdEKUOLh0xIz2FHK9Nd5o9UA==", + "version": "3.10.3", + "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.10.3.tgz", + "integrity": "sha512-COJSQ638QklcM+8AN1nujFuzT04rTZLFuLSww35edm8w/y0l60oF/Iu7TQ46m75DwoGFzGFfomLEmA1ltQk9mA==", "requires": { "chalk": "^2.4.2", "dateformat": "^3.0.3", @@ -18575,9 +18575,9 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } diff --git a/package.json b/package.json index 3ed62b2f..e68a82d4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "brightscript", "displayName": "BrightScript Language", - "version": "2.40.4", + "version": "2.42.0", "publisher": "RokuCommunity", "description": "Language support for Roku's BrightScript language.", "author": { @@ -48,14 +48,15 @@ "uninstall-local": "node scripts/uninstall-local.js", "build-docs": "statigen -s docs -o .tmp/docs", "watch-docs": "npm run build-docs -- --watch", - "releases": "ts-node scripts/releases.ts" + "releases": "ts-node scripts/releases.ts", + "sync-launch-settings": "ts-node scripts/sync-launch-settings.ts" }, "dependencies": { "@vscode/extension-telemetry": "^0.4.7", "array-sort": "^1.0.0", "backoff": "^2.5.0", - "brighterscript": "^0.65.0", - "brighterscript-formatter": "^1.6.29", + "brighterscript": "^0.65.4", + "brighterscript-formatter": "^1.6.31", "debounce": "^1.2.0", "dotenv": "^6.2.0", "fast-xml-parser": "^3.12.16", @@ -70,8 +71,8 @@ "node-ssdp": "^4.0.0", "postman-request": "^2.88.1-postman.32", "pretty-bytes": "^5.6.0", - "roku-debug": "^0.19.1", - "roku-deploy": "^3.10.2", + "roku-debug": "^0.20.3", + "roku-deploy": "^3.10.3", "roku-test-automation": "^2.0.0-beta.20", "semver": "^7.1.3", "source-map": "^0.7.3", @@ -370,6 +371,11 @@ }, "additionalProperties": false }, + "rendezvousTracking": { + "type": "boolean", + "description": "Should rendezvous tracking be enabled on launch? If `true`: turn on ECP rendezvous tracking, or turn on 8080 rendezvous tracking if ECP unsupported. If `false`, turn off both.", + "default": true + }, "componentLibrariesPort": { "type": "number", "description": "Port to access component libraries.", @@ -803,6 +809,11 @@ ], "default": "log", "description": "The level of logging that should be done during a debug session." + }, + "deleteDevChannelBeforeInstall": { + "type": "boolean", + "default": false, + "description": "Delete any currently installed dev channel before starting the debug session" } } } @@ -2118,6 +2129,142 @@ "default": "log", "description": "The level of logging that should be done during a debug session.", "scope": "resource" + }, + "brightscript.debug.fileLogging": { + "oneOf": [ + { + "type": "object", + "description": "Configure file logging for debug console logs as well as RokuCommunity debugger logs", + "default": { + "dir": "${workspaceFolder}/logs", + "rokuDevice": { + "enabled": true, + "filename": "rokuDevice.log", + "mode": "session", + "logLimit": 5 + }, + "debugger": { + "enabled": true, + "filename": "debugger.log", + "mode": "session", + "logLimit": 5 + } + }, + "properties": { + "enabled": { + "type": "boolean", + "description": "Should file logging be enabled" + }, + "dir": { + "type": "string", + "description": "Directory where log files should be stored. used when filename is relative", + "default": "${workspaceFolder}/logs" + }, + "logLimit": { + "type": "number", + "description": "The number of log files to keep. `null` means keep all logs", + "default": null + }, + "rokuDevice": { + "oneOf": [ + { + "type": "object", + "description": "File logging for the telnet or IO output from the Roku device currently being debugged. (i.e. all the stuff produced by `print` statements in your code)", + "properties": { + "enabled": { + "type": "boolean", + "description": "Should file logging be enabled" + }, + "dir": { + "type": "string", + "description": "Directory where log files should be stored. used when filename is relative", + "default": "${workspaceFolder}/logs" + }, + "logLimit": { + "type": "number", + "description": "The number of log files to keep. `null` means keep all logs", + "default": null + }, + "mode": { + "type": "string", + "description": "`'session'` means a unique timestamped file will be created on every debug session.`'append'` means all logs will be appended to a single file", + "default": "session", + "enum": [ + "session", + "append" + ] + } + } + }, + { + "type": "boolean", + "description": "Enable file logging for debug console logs as well as RokuCommunity debugger logs" + } + ] + }, + "debugger": { + "oneOf": [ + { + "type": "object", + "description": "File logging for the debugger. Mostly used to provide crash logs to the RokuCommunity team.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Should file logging be enabled" + }, + "dir": { + "type": "string", + "description": "Directory where log files should be stored. used when filename is relative", + "default": "${workspaceFolder}/logs" + }, + "logLimit": { + "type": "number", + "description": "The number of log files to keep. `null` means keep all logs", + "default": null + }, + "mode": { + "type": "string", + "description": "`'session'` means a unique timestamped file will be created on every debug session.`'append'` means all logs will be appended to a single file", + "default": "session", + "enum": [ + "session", + "append" + ] + } + } + }, + { + "type": "boolean", + "description": "Enable file logging for debug console logs as well as RokuCommunity debugger logs" + } + ] + } + } + }, + { + "type": "boolean", + "description": "Enable file logging for debug console logs as well as RokuCommunity debugger logs" + } + ], + "scope": "resource" + }, + "brightscript.debug.showHiddenVariables": { + "type": "boolean", + "description": "Show variables that are prefixed with a special prefix designated to be hidden", + "default": false, + "scope": "resource" + }, + "brightscript.debug.rendezvousTracking": { + "type": "boolean", + "description": "Should rendezvous tracking be enabled on launch? If `true`: turn on ECP rendezvous tracking, or turn on 8080 rendezvous tracking if ECP unsupported. If `false`, turn off both.", + "default": true, + "scope": "resource" + }, + "brightscript.debug.deleteDevChannelBeforeInstall": { + "type": "boolean", + "default": false, + "description": "Delete any currently installed dev channel before starting the debug session", + "scope": "resource" } } }, diff --git a/scripts/sync-launch-settings.ts b/scripts/sync-launch-settings.ts index def4de14..267334a0 100644 --- a/scripts/sync-launch-settings.ts +++ b/scripts/sync-launch-settings.ts @@ -1,10 +1,11 @@ -console.log('Sync settings from launch to debug`'); -console.log('==================================='); -const packageJsonFile = '../package.json'; -const packageJson = require(packageJsonFile); -const { EOL } = require('os'); -const fs = require('fs'); - +import { EOL } from 'os'; +import * as fsExtra from 'fs-extra'; +import * as path from 'path'; +const cwd = __dirname; +const packageJsonPath = path.resolve(`${cwd}/../package.json`); +const packageJson = fsExtra.readJsonSync(packageJsonPath); + +console.log('Sync launch.json definitions into brightscript.debug.* user settings definitions...'); // extract object from 'package.json' const configurationArray = packageJson.contributes.configuration; @@ -28,7 +29,7 @@ const launchProperties = packageJson.contributes.debuggers[0].configurationAttri for (const [key, data] of Object.entries(launchProperties)) { const launchProperty = {}; - for (const [dataKey, dataValue] of Object.entries(data)) { + for (const [dataKey, dataValue] of Object.entries(data as any)) { launchProperty[dataKey] = dataValue; } const scope = 'scope'; @@ -39,18 +40,17 @@ for (const [key, data] of Object.entries(launchProperties)) { } // have to parse final output object to get clean JSON -const newDebugPropertiesParsed = JSON.parse(JSON.stringify(newDebugProperties)) +const newDebugPropertiesParsed = JSON.parse(JSON.stringify(newDebugProperties)); // finally replace elements back into 'package.json' file configurationArray[debugIndex].properties = newDebugPropertiesParsed; packageJson.contributes.configuration = configurationArray; try { - fs.writeFileSync(packageJsonFile, JSON.stringify(packageJson, null, 4), 'utf8'); - fs.appendFileSync(packageJsonFile, EOL, 'utf8'); + fsExtra.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 4), 'utf8'); + fsExtra.appendFileSync(packageJsonPath, EOL, 'utf8'); } catch (e) { console.error(e); } -console.log('launch settings synchronised with debug settings inside package.json file'); -console.log(packageJson.contributes.configuration); +console.log('done!'); diff --git a/src/DebugConfigurationProvider.ts b/src/DebugConfigurationProvider.ts index 951af8e3..972106be 100644 --- a/src/DebugConfigurationProvider.ts +++ b/src/DebugConfigurationProvider.ts @@ -50,7 +50,9 @@ export class BrightScriptDebugConfigurationProvider implements DebugConfiguratio enableSourceMaps: true, packagePort: 80, enableDebugProtocol: false, - remotePort: 8060 + remotePort: 8060, + rendezvousTracking: true, + deleteDevChannelBeforeInstall: false }; let config: any = vscode.workspace.getConfiguration('brightscript') || {}; @@ -239,6 +241,8 @@ export class BrightScriptDebugConfigurationProvider implements DebugConfiguratio config.logfilePath ??= null; config.enableDebugProtocol = config.enableDebugProtocol ? true : false; config.cwd = folderUri.fsPath; + config.rendezvousTracking = config.rendezvousTracking === false ? false : true; + config.deleteDevChannelBeforeInstall = config.deleteDevChannelBeforeInstall === true; if (config.request !== 'launch') { await vscode.window.showErrorMessage(`roku-debug only supports the 'launch' request type`); diff --git a/src/LanguageServerManager.ts b/src/LanguageServerManager.ts index a7a1eb9a..6e1113e1 100644 --- a/src/LanguageServerManager.ts +++ b/src/LanguageServerManager.ts @@ -14,6 +14,7 @@ import { window, workspace } from 'vscode'; +import { BusyStatus, NotificationName, Logger } from 'brighterscript'; import { CustomCommands, Deferred } from 'brighterscript'; import type { CodeWithSourceMap } from 'source-map'; import BrightScriptDefinitionProvider from './BrightScriptDefinitionProvider'; @@ -26,6 +27,8 @@ import { util } from './util'; import { LanguageServerInfoCommand, languageServerInfoCommand } from './commands/LanguageServerInfoCommand'; import * as fsExtra from 'fs-extra'; +export const LANGUAGE_SERVER_NAME = 'BrighterScript Language Server'; + export class LanguageServerManager { constructor() { this.deferred = new Deferred(); @@ -101,7 +104,10 @@ export class LanguageServerManager { //create the statusbar this.languageServerStatusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right); this.languageServerStatusBar.command = LanguageServerInfoCommand.commandName; - this.updateStatusbar('running'); + + //enable the statusbar loading anmation. the language server will disable once it finishes loading + this.updateStatusbar(false); + this.languageServerStatusBar.show(); //disable the simple providers (the language server will handle all of these) @@ -151,7 +157,7 @@ export class LanguageServerManager { // Create the language client and start the client. this.client = new LanguageClient( 'brighterScriptLanguageServer', - 'BrighterScript Language Server', + LANGUAGE_SERVER_NAME, serverOptions, clientOptions ); @@ -162,19 +168,7 @@ export class LanguageServerManager { this.client.onNotification('critical-failure', (message) => { void window.showErrorMessage(message); }); - - //update the statusbar with build statuses - this.client.onNotification('build-status', (message) => { - if (message === 'building') { - this.updateStatusbar('running'); - - } else if (message === 'success') { - this.updateStatusbar('running'); - - } else if (message === 'critical-error') { - this.updateStatusbar('encountered a critical runtime error', '#FF0000'); - } - }); + this.registerBusyStatusHandler(); this.deferred.resolve(true); } catch (e) { console.error(e); @@ -188,10 +182,43 @@ export class LanguageServerManager { return this.ready(); } - private updateStatusbar(tooltip: string, color?: string) { - this.languageServerStatusBar.text = `$(flame)bsc-${this.selectedBscInfo.version}`; - this.languageServerStatusBar.tooltip = 'BrightScript Language Server: ' + tooltip; - this.languageServerStatusBar.color = color; + private registerBusyStatusHandler() { + let timeoutHandle: NodeJS.Timeout; + + const logger = new Logger(); + this.client.onNotification(NotificationName.busyStatus, (event: any) => { + this.setBusyStatus(event.status); + + //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.getTimestamp()} 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); + } + }); + + } + + private setBusyStatus(status: BusyStatus) { + if (status === BusyStatus.busy) { + this.updateStatusbar(true); + } else { + this.updateStatusbar(false); + } + } + + /** + * Enable/disable the loading spinner on the statusbar item + */ + private updateStatusbar(isLoading: boolean) { + const icon = isLoading ? '$(sync~spin)' : '$(flame)'; + this.languageServerStatusBar.text = `${icon} bsc-${this.selectedBscInfo.version}`; + this.languageServerStatusBar.tooltip = `BrightScript Language Server: running`; } /** diff --git a/src/commands/LanguageServerInfoCommand.ts b/src/commands/LanguageServerInfoCommand.ts index 1cef7961..a183f120 100644 --- a/src/commands/LanguageServerInfoCommand.ts +++ b/src/commands/LanguageServerInfoCommand.ts @@ -1,5 +1,5 @@ import * as vscode from 'vscode'; -import { languageServerManager } from '../LanguageServerManager'; +import { LANGUAGE_SERVER_NAME, languageServerManager } from '../LanguageServerManager'; import * as path from 'path'; export class LanguageServerInfoCommand { @@ -18,12 +18,25 @@ export class LanguageServerInfoCommand { label: `Restart BrighterScript Language Server`, description: ``, command: this.restartLanguageServer.bind(this) + }, { + label: `View language server logs`, + description: ``, + command: this.focusLanguageServerOutputChannel.bind(this) }]; + let selection = await vscode.window.showQuickPick(commands, { placeHolder: `BrighterScript Project Info` }); await selection?.command(); })); } + private async focusLanguageServerOutputChannel() { + const commands = await vscode.commands.getCommands(); + const command = commands.find(x => x.endsWith(LANGUAGE_SERVER_NAME)); + if (command) { + void vscode.commands.executeCommand(command); + } + } + private async restartLanguageServer() { await vscode.commands.executeCommand('extension.brightscript.languageServer.restart'); }