roku-debug 0.20.5 → 0.20.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/CompileErrorProcessor.d.ts +7 -2
- package/dist/CompileErrorProcessor.js +64 -69
- package/dist/CompileErrorProcessor.js.map +1 -1
- package/dist/DeviceInfo.d.ts +1 -0
- package/dist/adapters/DebugProtocolAdapter.d.ts +64 -17
- package/dist/adapters/DebugProtocolAdapter.js +264 -157
- package/dist/adapters/DebugProtocolAdapter.js.map +1 -1
- package/dist/adapters/TelnetAdapter.d.ts +8 -3
- package/dist/adapters/TelnetAdapter.js +14 -6
- package/dist/adapters/TelnetAdapter.js.map +1 -1
- package/dist/adapters/TelnetRequestPipeline.d.ts +34 -0
- package/dist/adapters/TelnetRequestPipeline.js +35 -22
- package/dist/adapters/TelnetRequestPipeline.js.map +1 -1
- package/dist/debugProtocol/Constants.d.ts +171 -81
- package/dist/debugProtocol/Constants.js +206 -126
- package/dist/debugProtocol/Constants.js.map +1 -1
- package/dist/debugProtocol/DebugProtocolClientReplaySession.d.ts +46 -0
- package/dist/debugProtocol/DebugProtocolClientReplaySession.js +278 -0
- package/dist/debugProtocol/DebugProtocolClientReplaySession.js.map +1 -0
- package/dist/debugProtocol/PluginInterface.d.ts +38 -0
- package/dist/debugProtocol/PluginInterface.js +86 -0
- package/dist/debugProtocol/PluginInterface.js.map +1 -0
- package/dist/debugProtocol/ProtocolUtil.d.ts +56 -0
- package/dist/debugProtocol/ProtocolUtil.js +164 -0
- package/dist/debugProtocol/ProtocolUtil.js.map +1 -0
- package/dist/debugProtocol/client/DebugProtocolClient.d.ts +310 -0
- package/dist/debugProtocol/client/DebugProtocolClient.js +1079 -0
- package/dist/debugProtocol/client/DebugProtocolClient.js.map +1 -0
- package/dist/debugProtocol/client/DebugProtocolClientPlugin.d.ts +44 -0
- package/dist/debugProtocol/client/DebugProtocolClientPlugin.js +3 -0
- package/dist/debugProtocol/client/DebugProtocolClientPlugin.js.map +1 -0
- package/dist/debugProtocol/events/ProtocolEvent.d.ts +66 -0
- package/dist/debugProtocol/events/ProtocolEvent.js +3 -0
- package/dist/debugProtocol/events/ProtocolEvent.js.map +1 -0
- package/dist/debugProtocol/events/requests/AddBreakpointsRequest.d.ts +30 -0
- package/dist/debugProtocol/events/requests/AddBreakpointsRequest.js +63 -0
- package/dist/debugProtocol/events/requests/AddBreakpointsRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/AddConditionalBreakpointsRequest.d.ts +48 -0
- package/dist/debugProtocol/events/requests/AddConditionalBreakpointsRequest.js +69 -0
- package/dist/debugProtocol/events/requests/AddConditionalBreakpointsRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/ContinueRequest.d.ts +20 -0
- package/dist/debugProtocol/events/requests/ContinueRequest.js +40 -0
- package/dist/debugProtocol/events/requests/ContinueRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/ExecuteRequest.d.ts +26 -0
- package/dist/debugProtocol/events/requests/ExecuteRequest.js +49 -0
- package/dist/debugProtocol/events/requests/ExecuteRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/ExitChannelRequest.d.ts +20 -0
- package/dist/debugProtocol/events/requests/ExitChannelRequest.js +40 -0
- package/dist/debugProtocol/events/requests/ExitChannelRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/HandshakeRequest.d.ts +26 -0
- package/dist/debugProtocol/events/requests/HandshakeRequest.js +47 -0
- package/dist/debugProtocol/events/requests/HandshakeRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/ListBreakpointsRequest.d.ts +20 -0
- package/dist/debugProtocol/events/requests/ListBreakpointsRequest.js +40 -0
- package/dist/debugProtocol/events/requests/ListBreakpointsRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/RemoveBreakpointsRequest.d.ts +29 -0
- package/dist/debugProtocol/events/requests/RemoveBreakpointsRequest.js +60 -0
- package/dist/debugProtocol/events/requests/RemoveBreakpointsRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/StackTraceRequest.d.ts +22 -0
- package/dist/debugProtocol/events/requests/StackTraceRequest.js +43 -0
- package/dist/debugProtocol/events/requests/StackTraceRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/StepRequest.d.ts +25 -0
- package/dist/debugProtocol/events/requests/StepRequest.js +46 -0
- package/dist/debugProtocol/events/requests/StepRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/StopRequest.d.ts +20 -0
- package/dist/debugProtocol/events/requests/StopRequest.js +39 -0
- package/dist/debugProtocol/events/requests/StopRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/ThreadsRequest.d.ts +20 -0
- package/dist/debugProtocol/events/requests/ThreadsRequest.js +40 -0
- package/dist/debugProtocol/events/requests/ThreadsRequest.js.map +1 -0
- package/dist/debugProtocol/events/requests/VariablesRequest.d.ts +59 -0
- package/dist/debugProtocol/events/requests/VariablesRequest.js +123 -0
- package/dist/debugProtocol/events/requests/VariablesRequest.js.map +1 -0
- package/dist/debugProtocol/events/responses/AddBreakpointsResponse.js.map +1 -0
- package/dist/debugProtocol/events/responses/AddConditionalBreakpointsResponse.d.ts +3 -0
- package/dist/debugProtocol/events/responses/AddConditionalBreakpointsResponse.js +9 -0
- package/dist/debugProtocol/events/responses/AddConditionalBreakpointsResponse.js.map +1 -0
- package/dist/debugProtocol/events/responses/ExecuteV3Response.d.ts +42 -0
- package/dist/debugProtocol/events/responses/ExecuteV3Response.js +94 -0
- package/dist/debugProtocol/events/responses/ExecuteV3Response.js.map +1 -0
- package/dist/debugProtocol/events/responses/GenericResponse.d.ts +17 -0
- package/dist/debugProtocol/events/responses/GenericResponse.js +40 -0
- package/dist/debugProtocol/events/responses/GenericResponse.js.map +1 -0
- package/dist/debugProtocol/events/responses/GenericV3Response.d.ts +15 -0
- package/dist/debugProtocol/events/responses/GenericV3Response.js +38 -0
- package/dist/debugProtocol/events/responses/GenericV3Response.js.map +1 -0
- package/dist/debugProtocol/events/responses/HandshakeResponse.d.ts +28 -0
- package/dist/debugProtocol/events/responses/HandshakeResponse.js +69 -0
- package/dist/debugProtocol/events/responses/HandshakeResponse.js.map +1 -0
- package/dist/debugProtocol/events/responses/HandshakeV3Response.d.ts +42 -0
- package/dist/debugProtocol/events/responses/HandshakeV3Response.js +98 -0
- package/dist/debugProtocol/events/responses/HandshakeV3Response.js.map +1 -0
- package/dist/debugProtocol/events/responses/ListBreakpointsResponse.d.ts +35 -0
- package/dist/debugProtocol/events/responses/ListBreakpointsResponse.js +68 -0
- package/dist/debugProtocol/events/responses/ListBreakpointsResponse.js.map +1 -0
- package/dist/debugProtocol/events/responses/RemoveBreakpointsResponse.js.map +1 -0
- package/dist/debugProtocol/events/responses/StackTraceResponse.d.ts +24 -0
- package/dist/debugProtocol/events/responses/StackTraceResponse.js +72 -0
- package/dist/debugProtocol/events/responses/StackTraceResponse.js.map +1 -0
- package/dist/debugProtocol/events/responses/StackTraceV3Response.d.ts +37 -0
- package/dist/debugProtocol/events/responses/StackTraceV3Response.js +67 -0
- package/dist/debugProtocol/events/responses/StackTraceV3Response.js.map +1 -0
- package/dist/debugProtocol/events/responses/ThreadsResponse.d.ts +54 -0
- package/dist/debugProtocol/events/responses/ThreadsResponse.js +80 -0
- package/dist/debugProtocol/events/responses/ThreadsResponse.js.map +1 -0
- package/dist/debugProtocol/events/responses/VariablesResponse.d.ts +117 -0
- package/dist/debugProtocol/events/responses/VariablesResponse.js +335 -0
- package/dist/debugProtocol/events/responses/VariablesResponse.js.map +1 -0
- package/dist/debugProtocol/events/updates/AllThreadsStoppedUpdate.d.ts +35 -0
- package/dist/debugProtocol/events/updates/AllThreadsStoppedUpdate.js +58 -0
- package/dist/debugProtocol/events/updates/AllThreadsStoppedUpdate.js.map +1 -0
- package/dist/debugProtocol/events/updates/BreakpointErrorUpdate.d.ts +42 -0
- package/dist/debugProtocol/events/updates/BreakpointErrorUpdate.js +97 -0
- package/dist/debugProtocol/events/updates/BreakpointErrorUpdate.js.map +1 -0
- package/dist/debugProtocol/events/updates/BreakpointVerifiedUpdate.d.ts +41 -0
- package/dist/debugProtocol/events/updates/BreakpointVerifiedUpdate.js +74 -0
- package/dist/debugProtocol/events/updates/BreakpointVerifiedUpdate.js.map +1 -0
- package/dist/debugProtocol/events/updates/CompileErrorUpdate.d.ts +60 -0
- package/dist/debugProtocol/events/updates/CompileErrorUpdate.js +89 -0
- package/dist/debugProtocol/events/updates/CompileErrorUpdate.js.map +1 -0
- package/dist/debugProtocol/events/updates/IOPortOpenedUpdate.d.ts +23 -0
- package/dist/debugProtocol/events/updates/IOPortOpenedUpdate.js +49 -0
- package/dist/debugProtocol/events/updates/IOPortOpenedUpdate.js.map +1 -0
- package/dist/debugProtocol/events/updates/ThreadAttachedUpdate.d.ts +26 -0
- package/dist/debugProtocol/events/updates/ThreadAttachedUpdate.js +50 -0
- package/dist/debugProtocol/events/updates/ThreadAttachedUpdate.js.map +1 -0
- package/dist/debugProtocol/server/DebugProtocolServer.d.ts +110 -0
- package/dist/debugProtocol/server/DebugProtocolServer.js +306 -0
- package/dist/debugProtocol/server/DebugProtocolServer.js.map +1 -0
- package/dist/debugProtocol/server/DebugProtocolServerPlugin.d.ts +41 -0
- package/dist/debugProtocol/server/DebugProtocolServerPlugin.js +3 -0
- package/dist/debugProtocol/server/DebugProtocolServerPlugin.js.map +1 -0
- package/dist/debugSession/BrightScriptDebugSession.d.ts +9 -1
- package/dist/debugSession/BrightScriptDebugSession.js +178 -89
- package/dist/debugSession/BrightScriptDebugSession.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/logging.d.ts +1 -0
- package/dist/logging.js +4 -2
- package/dist/logging.js.map +1 -1
- package/dist/managers/ActionQueue.d.ts +7 -1
- package/dist/managers/ActionQueue.js +27 -5
- package/dist/managers/ActionQueue.js.map +1 -1
- package/dist/managers/BreakpointManager.d.ts +82 -27
- package/dist/managers/BreakpointManager.js +168 -63
- package/dist/managers/BreakpointManager.js.map +1 -1
- package/dist/managers/ProjectManager.d.ts +3 -0
- package/dist/managers/ProjectManager.js +42 -36
- package/dist/managers/ProjectManager.js.map +1 -1
- package/dist/util.d.ts +8 -6
- package/dist/util.js +36 -19
- package/dist/util.js.map +1 -1
- package/package.json +15 -6
- package/roku-debug-0.20.7.tgz +0 -0
- package/dist/debugProtocol/Debugger.d.ts +0 -161
- package/dist/debugProtocol/Debugger.js +0 -635
- package/dist/debugProtocol/Debugger.js.map +0 -1
- package/dist/debugProtocol/responses/AddBreakpointsResponse.js.map +0 -1
- package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.d.ts +0 -32
- package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.js +0 -67
- package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.js.map +0 -1
- package/dist/debugProtocol/responses/BreakpointVerifiedUpdateResponse.d.ts +0 -32
- package/dist/debugProtocol/responses/BreakpointVerifiedUpdateResponse.js +0 -56
- package/dist/debugProtocol/responses/BreakpointVerifiedUpdateResponse.js.map +0 -1
- package/dist/debugProtocol/responses/ConnectIOPortResponse.d.ts +0 -10
- package/dist/debugProtocol/responses/ConnectIOPortResponse.js +0 -39
- package/dist/debugProtocol/responses/ConnectIOPortResponse.js.map +0 -1
- package/dist/debugProtocol/responses/ExecuteResponseV3.d.ts +0 -23
- package/dist/debugProtocol/responses/ExecuteResponseV3.js +0 -54
- package/dist/debugProtocol/responses/ExecuteResponseV3.js.map +0 -1
- package/dist/debugProtocol/responses/HandshakeResponse.d.ts +0 -12
- package/dist/debugProtocol/responses/HandshakeResponse.js +0 -39
- package/dist/debugProtocol/responses/HandshakeResponse.js.map +0 -1
- package/dist/debugProtocol/responses/HandshakeResponseV3.d.ts +0 -14
- package/dist/debugProtocol/responses/HandshakeResponseV3.js +0 -47
- package/dist/debugProtocol/responses/HandshakeResponseV3.js.map +0 -1
- package/dist/debugProtocol/responses/ListBreakpointsResponse.d.ts +0 -25
- package/dist/debugProtocol/responses/ListBreakpointsResponse.js +0 -65
- package/dist/debugProtocol/responses/ListBreakpointsResponse.js.map +0 -1
- package/dist/debugProtocol/responses/ProtocolEvent.d.ts +0 -11
- package/dist/debugProtocol/responses/ProtocolEvent.js +0 -38
- package/dist/debugProtocol/responses/ProtocolEvent.js.map +0 -1
- package/dist/debugProtocol/responses/ProtocolEventV3.d.ts +0 -11
- package/dist/debugProtocol/responses/ProtocolEventV3.js +0 -42
- package/dist/debugProtocol/responses/ProtocolEventV3.js.map +0 -1
- package/dist/debugProtocol/responses/RemoveBreakpointsResponse.js.map +0 -1
- package/dist/debugProtocol/responses/StackTraceResponse.d.ts +0 -18
- package/dist/debugProtocol/responses/StackTraceResponse.js +0 -58
- package/dist/debugProtocol/responses/StackTraceResponse.js.map +0 -1
- package/dist/debugProtocol/responses/StackTraceResponseV3.d.ts +0 -18
- package/dist/debugProtocol/responses/StackTraceResponseV3.js +0 -58
- package/dist/debugProtocol/responses/StackTraceResponseV3.js.map +0 -1
- package/dist/debugProtocol/responses/ThreadsResponse.d.ts +0 -22
- package/dist/debugProtocol/responses/ThreadsResponse.js +0 -63
- package/dist/debugProtocol/responses/ThreadsResponse.js.map +0 -1
- package/dist/debugProtocol/responses/UndefinedResponse.d.ts +0 -10
- package/dist/debugProtocol/responses/UndefinedResponse.js +0 -39
- package/dist/debugProtocol/responses/UndefinedResponse.js.map +0 -1
- package/dist/debugProtocol/responses/UpdateThreadsResponse.d.ts +0 -25
- package/dist/debugProtocol/responses/UpdateThreadsResponse.js +0 -91
- package/dist/debugProtocol/responses/UpdateThreadsResponse.js.map +0 -1
- package/dist/debugProtocol/responses/VariableResponse.d.ts +0 -27
- package/dist/debugProtocol/responses/VariableResponse.js +0 -141
- package/dist/debugProtocol/responses/VariableResponse.js.map +0 -1
- package/dist/debugProtocol/responses/index.d.ts +0 -11
- package/dist/debugProtocol/responses/index.js +0 -24
- package/dist/debugProtocol/responses/index.js.map +0 -1
- package/roku-debug-0.20.5.tgz +0 -0
- /package/dist/debugProtocol/{responses → events/responses}/AddBreakpointsResponse.d.ts +0 -0
- /package/dist/debugProtocol/{responses → events/responses}/AddBreakpointsResponse.js +0 -0
- /package/dist/debugProtocol/{responses → events/responses}/RemoveBreakpointsResponse.d.ts +0 -0
- /package/dist/debugProtocol/{responses → events/responses}/RemoveBreakpointsResponse.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
## [0.20.7](https://github.com/rokucommunity/roku-debug/compare/v0.20.6...v0.20.7) - 2023-10-16
|
|
10
|
+
### Changed
|
|
11
|
+
- Debug Protocol Enhancements ([#107](https://github.com/rokucommunity/roku-debug/pull/107))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [0.20.6](https://github.com/rokucommunity/roku-debug/compare/v0.20.5...v0.20.6) - 2023-10-06
|
|
16
|
+
### Changed
|
|
17
|
+
- upgrade to [brighterscript@0.65.8](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0658---2023-10-06). Notable changes since 0.65.7:
|
|
18
|
+
- Bump postcss from 8.2.15 to 8.4.31 ([brighterscript#928](https://github.com/rokucommunity/brighterscript/pull/928))
|
|
19
|
+
- Add interface parameter support ([brighterscript#924](https://github.com/rokucommunity/brighterscript/pull/924))
|
|
20
|
+
- Better typing for `Deferred` ([brighterscript#923](https://github.com/rokucommunity/brighterscript/pull/923))
|
|
21
|
+
### Fixed
|
|
22
|
+
- bug with telnet getting stuck ([#163](https://github.com/rokucommunity/roku-debug/pull/163))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
9
26
|
## [0.20.5](https://github.com/rokucommunity/roku-debug/compare/v0.20.4...v0.20.5) - 2023-09-28
|
|
10
27
|
### Changed
|
|
11
28
|
- upgrade to [brighterscript@0.65.7](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0657---2023-09-28). Notable changes since 0.65.5:
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { Diagnostic } from 'vscode-languageserver-protocol/node';
|
|
3
|
+
import { DiagnosticSeverity } from 'brighterscript';
|
|
3
4
|
export declare class CompileErrorProcessor {
|
|
4
5
|
private logger;
|
|
5
6
|
status: CompileStatus;
|
|
@@ -63,8 +64,8 @@ export declare class CompileErrorProcessor {
|
|
|
63
64
|
sanitizeCompilePath(debuggerPath: string): string;
|
|
64
65
|
resetCompileErrorTimer(isRunning: any): any;
|
|
65
66
|
onCompileErrorTimer(): void;
|
|
66
|
-
private
|
|
67
|
-
private
|
|
67
|
+
private isStartingCompilingLine;
|
|
68
|
+
private isEndCompilingLine;
|
|
68
69
|
/**
|
|
69
70
|
* Look through the given responseText for a compiler error
|
|
70
71
|
* @param responseText
|
|
@@ -83,6 +84,10 @@ export interface BSDebugDiagnostic extends Diagnostic {
|
|
|
83
84
|
* main app.
|
|
84
85
|
*/
|
|
85
86
|
componentLibraryName?: string;
|
|
87
|
+
/**
|
|
88
|
+
* The diagnostic's severity.
|
|
89
|
+
*/
|
|
90
|
+
severity: DiagnosticSeverity;
|
|
86
91
|
}
|
|
87
92
|
export declare enum CompileStatus {
|
|
88
93
|
none = "none",
|
|
@@ -25,52 +25,47 @@ class CompileErrorProcessor {
|
|
|
25
25
|
emit(eventName, data) {
|
|
26
26
|
//emit these events on next tick, otherwise they will be processed immediately which could cause issues
|
|
27
27
|
setTimeout(() => {
|
|
28
|
+
var _a, _b;
|
|
28
29
|
//in rare cases, this event is fired after the debugger has closed, so make sure the event emitter still exists
|
|
29
|
-
|
|
30
|
-
this.emitter.emit(eventName, data);
|
|
31
|
-
}
|
|
30
|
+
(_b = (_a = this.emitter) === null || _a === void 0 ? void 0 : _a.emit) === null || _b === void 0 ? void 0 : _b.call(_a, eventName, data);
|
|
32
31
|
}, 0);
|
|
33
32
|
}
|
|
34
33
|
processUnhandledLines(responseText) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
34
|
+
let lines = responseText.split(/\r?\n/g);
|
|
35
|
+
for (const line of lines) {
|
|
36
|
+
switch (this.status) {
|
|
37
|
+
case CompileStatus.compiling:
|
|
38
|
+
case CompileStatus.compileError:
|
|
39
|
+
if (this.isEndCompilingLine(line)) {
|
|
40
|
+
this.logger.debug('[processUnhandledLines] entering state CompileStatus.running');
|
|
41
|
+
this.status = CompileStatus.running;
|
|
42
|
+
this.resetCompileErrorTimer(false);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.compilingLines.push(line);
|
|
46
|
+
if (this.status === CompileStatus.compiling) {
|
|
47
|
+
//check to see if we've entered an error scenario
|
|
48
|
+
let hasError = /\berror\b/gi.test(line);
|
|
49
|
+
if (hasError) {
|
|
50
|
+
this.logger.debug('[processUnhandledLines] entering state CompileStatus.compileError');
|
|
51
|
+
this.status = CompileStatus.compileError;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (this.status === CompileStatus.compileError) {
|
|
55
|
+
//every input line while in error status will reset the stale timer, so we can wait for more errors to roll in.
|
|
56
|
+
this.resetCompileErrorTimer(true);
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
break;
|
|
60
|
+
case CompileStatus.none:
|
|
61
|
+
case CompileStatus.running:
|
|
62
|
+
if (this.isStartingCompilingLine(line)) {
|
|
63
|
+
this.logger.debug('[processUnhandledLines] entering state CompileStatus.compiling');
|
|
64
|
+
this.status = CompileStatus.compiling;
|
|
60
65
|
this.resetCompileErrorTimer(true);
|
|
61
66
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
case CompileStatus.none:
|
|
65
|
-
this.startCompilingLine = this.getStartingCompilingLine(newLines);
|
|
66
|
-
this.compilingLines = this.compilingLines.concat(newLines);
|
|
67
|
-
if (this.startCompilingLine !== -1) {
|
|
68
|
-
this.logger.debug('[processUnhandledLines] entering state CompileStatus.compiling');
|
|
69
|
-
newLines.splice(0, this.startCompilingLine);
|
|
70
|
-
this.status = CompileStatus.compiling;
|
|
71
|
-
this.resetCompileErrorTimer(true);
|
|
72
|
-
}
|
|
73
|
-
break;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
74
69
|
}
|
|
75
70
|
}
|
|
76
71
|
sendErrors() {
|
|
@@ -83,14 +78,14 @@ class CompileErrorProcessor {
|
|
|
83
78
|
});
|
|
84
79
|
}
|
|
85
80
|
getErrors(lines) {
|
|
86
|
-
|
|
81
|
+
let diagnostics = [];
|
|
87
82
|
//clone the lines so the parsers can manipulate them
|
|
88
83
|
lines = [...lines];
|
|
89
84
|
while (lines.length > 0) {
|
|
90
85
|
const startLength = lines.length;
|
|
91
86
|
const line = lines[0];
|
|
92
87
|
if (line) {
|
|
93
|
-
|
|
88
|
+
diagnostics.push(...[
|
|
94
89
|
this.processMultiLineErrors(lines),
|
|
95
90
|
this.parseComponentDefinedInFileError(lines),
|
|
96
91
|
this.parseGenericXmlError(line),
|
|
@@ -103,10 +98,16 @@ class CompileErrorProcessor {
|
|
|
103
98
|
lines.shift();
|
|
104
99
|
}
|
|
105
100
|
}
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
//throw out $livecompile errors (those are generated by REPL/eval code)
|
|
102
|
+
const result = diagnostics.filter(x => {
|
|
108
103
|
return x.path && !x.path.toLowerCase().includes('$livecompile');
|
|
109
|
-
|
|
104
|
+
//dedupe compile errors that have the same information
|
|
105
|
+
}).reduce((map, d) => {
|
|
106
|
+
var _a, _b;
|
|
107
|
+
map.set(`${d.path}:${(_a = d.range) === null || _a === void 0 ? void 0 : _a.start.line}:${(_b = d.range) === null || _b === void 0 ? void 0 : _b.start.character}-${d.message}-${d.severity}-${d.source}`, d);
|
|
108
|
+
return map;
|
|
109
|
+
}, new Map());
|
|
110
|
+
return [...result].map(x => x[1]);
|
|
110
111
|
}
|
|
111
112
|
/**
|
|
112
113
|
* Parse generic xml errors with no further context below
|
|
@@ -127,7 +128,8 @@ class CompileErrorProcessor {
|
|
|
127
128
|
path: this.sanitizeCompilePath(filePath),
|
|
128
129
|
range: brighterscript_1.util.createRange(0, 0, 0, 999),
|
|
129
130
|
message: this.buildMessage(message),
|
|
130
|
-
code: undefined
|
|
131
|
+
code: undefined,
|
|
132
|
+
severity: brighterscript_1.DiagnosticSeverity.Error
|
|
131
133
|
}))
|
|
132
134
|
.filter(x => !!x);
|
|
133
135
|
}
|
|
@@ -149,7 +151,8 @@ class CompileErrorProcessor {
|
|
|
149
151
|
path: this.sanitizeCompilePath(filePath),
|
|
150
152
|
message: this.buildMessage(message, context),
|
|
151
153
|
range: this.getRange(lineNumber),
|
|
152
|
-
code: code
|
|
154
|
+
code: code,
|
|
155
|
+
severity: brighterscript_1.DiagnosticSeverity.Error
|
|
153
156
|
}];
|
|
154
157
|
}
|
|
155
158
|
}
|
|
@@ -180,7 +183,8 @@ class CompileErrorProcessor {
|
|
|
180
183
|
path: filePath,
|
|
181
184
|
range: this.getRange(lineNumber),
|
|
182
185
|
message: this.buildMessage(message),
|
|
183
|
-
code: undefined
|
|
186
|
+
code: undefined,
|
|
187
|
+
severity: brighterscript_1.DiagnosticSeverity.Error
|
|
184
188
|
});
|
|
185
189
|
}
|
|
186
190
|
else {
|
|
@@ -212,7 +216,8 @@ class CompileErrorProcessor {
|
|
|
212
216
|
message: this.buildMessage(message),
|
|
213
217
|
path: this.sanitizeCompilePath(filePath),
|
|
214
218
|
range: this.getRange(),
|
|
215
|
-
code: undefined
|
|
219
|
+
code: undefined,
|
|
220
|
+
severity: brighterscript_1.DiagnosticSeverity.Error
|
|
216
221
|
}];
|
|
217
222
|
}
|
|
218
223
|
}
|
|
@@ -231,7 +236,9 @@ class CompileErrorProcessor {
|
|
|
231
236
|
return [{
|
|
232
237
|
path: 'pkg:/manifest',
|
|
233
238
|
range: brighterscript_1.util.createRange(0, 0, 0, 999),
|
|
234
|
-
message: this.buildMessage(message)
|
|
239
|
+
message: this.buildMessage(message),
|
|
240
|
+
code: undefined,
|
|
241
|
+
severity: brighterscript_1.DiagnosticSeverity.Error
|
|
235
242
|
}];
|
|
236
243
|
}
|
|
237
244
|
}
|
|
@@ -273,7 +280,7 @@ class CompileErrorProcessor {
|
|
|
273
280
|
}
|
|
274
281
|
resetCompileErrorTimer(isRunning) {
|
|
275
282
|
if (this.compileErrorTimer) {
|
|
276
|
-
|
|
283
|
+
clearTimeout(this.compileErrorTimer);
|
|
277
284
|
this.compileErrorTimer = undefined;
|
|
278
285
|
}
|
|
279
286
|
if (isRunning) {
|
|
@@ -289,27 +296,15 @@ class CompileErrorProcessor {
|
|
|
289
296
|
this.resetCompileErrorTimer(false);
|
|
290
297
|
this.reportErrors();
|
|
291
298
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
for
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
if (/------\s+compiling.*------/i.exec(line)) {
|
|
298
|
-
lastIndex = i;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
return lastIndex;
|
|
299
|
+
isStartingCompilingLine(line) {
|
|
300
|
+
//https://regex101.com/r/8W2wuZ/1
|
|
301
|
+
// We need to start scanning for compile errors earlier than the ---compiling--- message, so look for the [scrpt.cmpl] message.
|
|
302
|
+
// keep the ---compiling--- as well, since it doesn't hurt to remain in compile mode
|
|
303
|
+
return /(------\s+compiling.*------)|(\[scrpt.cmpl]\s+compiling\s+'.*?'\s*,\s*id\s*'.*?')/i.test(line);
|
|
302
304
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
let line = lines[i];
|
|
307
|
-
// if this line looks like the compiling line
|
|
308
|
-
if (/------\s+Running.*------/i.exec(line)) {
|
|
309
|
-
lastIndex = i;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
return lastIndex;
|
|
305
|
+
isEndCompilingLine(line) {
|
|
306
|
+
// if this line looks like the compiling line
|
|
307
|
+
return /------\s+Running.*------/i.test(line);
|
|
313
308
|
}
|
|
314
309
|
/**
|
|
315
310
|
* Look through the given responseText for a compiler error
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompileErrorProcessor.js","sourceRoot":"","sources":["../src/CompileErrorProcessor.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAEtC,uCAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"CompileErrorProcessor.js","sourceRoot":"","sources":["../src/CompileErrorProcessor.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAEtC,uCAAmC;AACnC,mDAAqE;AAErE,MAAa,qBAAqB;IAAlC;QAEY,WAAM,GAAG,gBAAM,CAAC,YAAY,CAAC,IAAI,qBAAqB,CAAC,IAAI,GAAG,CAAC,CAAC;QACjE,WAAM,GAAkB,aAAa,CAAC,IAAI,CAAC;QAC3C,uBAAkB,GAAG,CAAC,CAAC,CAAC;QACxB,qBAAgB,GAAG,CAAC,CAAC,CAAC;QACtB,mBAAc,GAAG,EAAc,CAAC;QAChC,0BAAqB,GAAG,IAAI,CAAC;QAC5B,YAAO,GAAG,IAAI,qBAAY,EAAE,CAAC;IA0VzC,CAAC;IAtVU,EAAE,CAAC,SAAiB,EAAE,OAA+B;QACxD,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACpC,OAAO,GAAG,EAAE;YACR,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;gBAC5B,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;aACnD;QACL,CAAC,CAAC;IACN,CAAC;IAEO,IAAI,CAAC,SAA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AAC;gBAC/B,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;aAClC;SACJ;IACL,CAAC;IAEM,mBAAmB;QACtB,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAEO,uBAAuB,CAAC,IAAY;QACxC,iCAAiC;QACjC,+HAA+H;QAC/H,oFAAoF;QACpF,OAAO,oFAAoF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3G,CAAC;IAEO,kBAAkB,CAAC,IAAY;QACnC,6CAA6C;QAC7C,OAAO,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACK,YAAY;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACnD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YACnB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;SACpC;IACL,CAAC;IAEM,OAAO;QACV,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;SACrC;IACL,CAAC;CACJ;AAlWD,sDAkWC;AAmBD,IAAY,aAKX;AALD,WAAY,aAAa;IACrB,8BAAa,CAAA;IACb,wCAAuB,CAAA;IACvB,8CAA6B,CAAA;IAC7B,oCAAmB,CAAA;AACvB,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB"}
|
package/dist/DeviceInfo.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { ConstructorOptions, ProtocolVersionDetails } from '../debugProtocol/Debugger';
|
|
2
1
|
import type { BSDebugDiagnostic } from '../CompileErrorProcessor';
|
|
3
|
-
import type { RendezvousTracker } from '../RendezvousTracker';
|
|
2
|
+
import type { RendezvousHistory, RendezvousTracker } from '../RendezvousTracker';
|
|
4
3
|
import type { ChanperfData } from '../ChanperfTracker';
|
|
5
4
|
import type { AdapterOptions, HighLevelType, RokuAdapterEvaluateResponse } from '../interfaces';
|
|
6
5
|
import type { BreakpointManager } from '../managers/BreakpointManager';
|
|
7
6
|
import type { ProjectManager } from '../managers/ProjectManager';
|
|
8
|
-
import type {
|
|
7
|
+
import type { BreakpointsVerifiedEvent, ConstructorOptions, ProtocolVersionDetails } from '../debugProtocol/client/DebugProtocolClient';
|
|
8
|
+
import type { TelnetAdapter } from './TelnetAdapter';
|
|
9
|
+
import type { DeviceInfo } from '../DeviceInfo';
|
|
9
10
|
/**
|
|
10
11
|
* A class that connects to a Roku device over telnet debugger port and provides a standardized way of interacting with it.
|
|
11
12
|
*/
|
|
@@ -14,7 +15,8 @@ export declare class DebugProtocolAdapter {
|
|
|
14
15
|
private projectManager;
|
|
15
16
|
private breakpointManager;
|
|
16
17
|
private rendezvousTracker;
|
|
17
|
-
|
|
18
|
+
private deviceInfo;
|
|
19
|
+
constructor(options: AdapterOptions & ConstructorOptions, projectManager: ProjectManager, breakpointManager: BreakpointManager, rendezvousTracker: RendezvousTracker, deviceInfo: DeviceInfo);
|
|
18
20
|
private logger;
|
|
19
21
|
/**
|
|
20
22
|
* Indicates whether the adapter has successfully established a connection with the device
|
|
@@ -39,12 +41,29 @@ export declare class DebugProtocolAdapter {
|
|
|
39
41
|
*/
|
|
40
42
|
get activeProtocolVersion(): string;
|
|
41
43
|
readonly supportsMultipleRuns = false;
|
|
44
|
+
/**
|
|
45
|
+
* Subscribe to an event exactly once
|
|
46
|
+
* @param eventName
|
|
47
|
+
*/
|
|
48
|
+
once(eventName: 'cannot-continue'): Promise<void>;
|
|
49
|
+
once(eventname: 'chanperf'): Promise<ChanperfData>;
|
|
50
|
+
once(eventName: 'close'): Promise<void>;
|
|
51
|
+
once(eventName: 'app-exit'): Promise<void>;
|
|
52
|
+
once(eventName: 'diagnostics'): Promise<BSDebugDiagnostic>;
|
|
53
|
+
once(eventName: 'connected'): Promise<boolean>;
|
|
54
|
+
once(eventname: 'console-output'): Promise<string>;
|
|
55
|
+
once(eventname: 'protocol-version'): Promise<ProtocolVersionDetails>;
|
|
56
|
+
once(eventname: 'rendezvous'): Promise<RendezvousHistory>;
|
|
57
|
+
once(eventName: 'runtime-error'): Promise<BrightScriptRuntimeError>;
|
|
58
|
+
once(eventName: 'suspend'): Promise<void>;
|
|
59
|
+
once(eventName: 'start'): Promise<void>;
|
|
60
|
+
once(eventname: 'unhandled-console-output'): Promise<string>;
|
|
42
61
|
/**
|
|
43
62
|
* Subscribe to various events
|
|
44
63
|
* @param eventName
|
|
45
64
|
* @param handler
|
|
46
65
|
*/
|
|
47
|
-
on(eventName: 'breakpoints-verified', handler: (
|
|
66
|
+
on(eventName: 'breakpoints-verified', handler: (event: BreakpointsVerifiedEvent) => void): any;
|
|
48
67
|
on(eventName: 'cannot-continue', handler: () => void): any;
|
|
49
68
|
on(eventname: 'chanperf', handler: (output: ChanperfData) => void): any;
|
|
50
69
|
on(eventName: 'close', handler: () => void): any;
|
|
@@ -83,21 +102,25 @@ export declare class DebugProtocolAdapter {
|
|
|
83
102
|
*/
|
|
84
103
|
connect(): Promise<unknown>;
|
|
85
104
|
private beginAppExit;
|
|
105
|
+
/**
|
|
106
|
+
* Determines if the current version of the debug protocol supports emitting compile error updates.
|
|
107
|
+
*/
|
|
108
|
+
get supportsCompileErrorReporting(): boolean;
|
|
86
109
|
watchCompileOutput(): Promise<unknown>;
|
|
87
110
|
/**
|
|
88
111
|
* Send command to step over
|
|
89
112
|
*/
|
|
90
|
-
stepOver(threadId: number): Promise<import("
|
|
91
|
-
stepInto(threadId: number): Promise<import("
|
|
92
|
-
stepOut(threadId: number): Promise<import("
|
|
113
|
+
stepOver(threadId: number): Promise<import("../debugProtocol/events/responses/GenericResponse").GenericResponse>;
|
|
114
|
+
stepInto(threadId: number): Promise<import("../debugProtocol/events/responses/GenericResponse").GenericResponse>;
|
|
115
|
+
stepOut(threadId: number): Promise<import("../debugProtocol/events/responses/GenericResponse").GenericResponse>;
|
|
93
116
|
/**
|
|
94
117
|
* Tell the brightscript program to continue (i.e. resume program)
|
|
95
118
|
*/
|
|
96
|
-
continue(): Promise<import("
|
|
119
|
+
continue(): Promise<import("../debugProtocol/events/responses/GenericResponse").GenericResponse>;
|
|
97
120
|
/**
|
|
98
121
|
* Tell the brightscript program to pause (fall into debug mode)
|
|
99
122
|
*/
|
|
100
|
-
pause(): Promise<import("
|
|
123
|
+
pause(): Promise<import("../debugProtocol/events/responses/GenericResponse").GenericResponse>;
|
|
101
124
|
/**
|
|
102
125
|
* Clears the state, which means that everything will be retrieved fresh next time it is requested
|
|
103
126
|
*/
|
|
@@ -108,14 +131,29 @@ export declare class DebugProtocolAdapter {
|
|
|
108
131
|
* @returns the output of the command (if possible)
|
|
109
132
|
*/
|
|
110
133
|
evaluate(command: string, frameId?: number): Promise<RokuAdapterEvaluateResponse>;
|
|
111
|
-
getStackTrace(
|
|
134
|
+
getStackTrace(threadIndex?: number): Promise<StackFrame[]>;
|
|
112
135
|
private getStackFrameById;
|
|
113
136
|
private cleanUpFunctionName;
|
|
114
137
|
/**
|
|
115
|
-
*
|
|
116
|
-
* @param expression
|
|
138
|
+
* Get info about the specified variable.
|
|
139
|
+
* @param expression the expression for the specified variable (i.e. `m`, `someVar.value`, `arr[1][2].three`). If empty string/undefined is specified, all local variables are retrieved instead
|
|
140
|
+
*/
|
|
141
|
+
private getVariablesResponse;
|
|
142
|
+
/**
|
|
143
|
+
* Get the variable for the specified expression.
|
|
117
144
|
*/
|
|
118
|
-
getVariable(expression: string, frameId: number
|
|
145
|
+
getVariable(expression: string, frameId: number): Promise<EvaluateContainer>;
|
|
146
|
+
/**
|
|
147
|
+
* Get the list of local variables
|
|
148
|
+
*/
|
|
149
|
+
getLocalVariables(frameId: number): Promise<EvaluateContainer>;
|
|
150
|
+
/**
|
|
151
|
+
* Create an EvaluateContainer for the given variable. If the variable has children, those are created and attached as well
|
|
152
|
+
* @param variable a Variable object from the debug protocol debugger
|
|
153
|
+
* @param name the name of this variable. For example, `alpha.beta.charlie`, this value would be `charlie`. For local vars, this is the root variable name (i.e. `alpha`)
|
|
154
|
+
* @param parentEvaluateName the string used to derive the parent, _excluding_ this variable's name (i.e. `alpha.beta` or `alpha[0]`)
|
|
155
|
+
*/
|
|
156
|
+
private createEvaluateContainer;
|
|
119
157
|
/**
|
|
120
158
|
* Cache items by a unique key
|
|
121
159
|
* @param expression
|
|
@@ -128,6 +166,11 @@ export declare class DebugProtocolAdapter {
|
|
|
128
166
|
getThreads(): Promise<Thread[]>;
|
|
129
167
|
private getThreadByThreadId;
|
|
130
168
|
removeAllListeners(): void;
|
|
169
|
+
/**
|
|
170
|
+
* Indicates whether this class had `.destroy()` called at least once. Mostly used for checking externally to see if
|
|
171
|
+
* the whole debug session has been terminated or is in a bad state.
|
|
172
|
+
*/
|
|
173
|
+
isDestroyed: boolean;
|
|
131
174
|
/**
|
|
132
175
|
* Disconnect from the telnet session and unset all objects
|
|
133
176
|
*/
|
|
@@ -145,8 +188,9 @@ export declare class DebugProtocolAdapter {
|
|
|
145
188
|
* Sends a call to the ChanperfTracker to clear the current chanperf history
|
|
146
189
|
*/
|
|
147
190
|
clearChanperfHistory(): void;
|
|
191
|
+
private syncBreakpointsPromise;
|
|
148
192
|
syncBreakpoints(): Promise<void>;
|
|
149
|
-
|
|
193
|
+
_syncBreakpoints(): Promise<void>;
|
|
150
194
|
}
|
|
151
195
|
export interface StackFrame {
|
|
152
196
|
frameId: number;
|
|
@@ -162,10 +206,9 @@ export declare enum EventName {
|
|
|
162
206
|
export interface EvaluateContainer {
|
|
163
207
|
name: string;
|
|
164
208
|
evaluateName: string;
|
|
165
|
-
variablePath: string[];
|
|
166
209
|
type: string;
|
|
167
210
|
value: string;
|
|
168
|
-
keyType
|
|
211
|
+
keyType?: KeyType;
|
|
169
212
|
elementCount: number;
|
|
170
213
|
highLevelType: HighLevelType;
|
|
171
214
|
children: EvaluateContainer[];
|
|
@@ -178,6 +221,9 @@ export declare enum KeyType {
|
|
|
178
221
|
}
|
|
179
222
|
export interface Thread {
|
|
180
223
|
isSelected: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* The 1-based line number for the thread
|
|
226
|
+
*/
|
|
181
227
|
lineNumber: number;
|
|
182
228
|
filePath: string;
|
|
183
229
|
functionName: string;
|
|
@@ -188,4 +234,5 @@ interface BrightScriptRuntimeError {
|
|
|
188
234
|
message: string;
|
|
189
235
|
errorCode: string;
|
|
190
236
|
}
|
|
237
|
+
export declare function isDebugProtocolAdapter(adapter: TelnetAdapter | DebugProtocolAdapter): adapter is DebugProtocolAdapter;
|
|
191
238
|
export {};
|