roku-debug 0.21.18 → 0.21.20
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 +23 -0
- package/dist/LaunchConfiguration.d.ts +7 -0
- package/dist/adapters/DebugProtocolAdapter.d.ts +1 -1
- package/dist/adapters/DebugProtocolAdapter.js.map +1 -1
- package/dist/adapters/TelnetAdapter.d.ts +2 -0
- package/dist/adapters/TelnetAdapter.js +6 -0
- package/dist/adapters/TelnetAdapter.js.map +1 -1
- package/dist/adapters/customVariables/ifGetMessagePort.js +3 -2
- package/dist/adapters/customVariables/ifGetMessagePort.js.map +1 -1
- package/dist/adapters/customVariables/ifImageMetadata.js +4 -4
- package/dist/adapters/customVariables/ifImageMetadata.js.map +1 -1
- package/dist/adapters/customVariables/ifRegion.js +2 -2
- package/dist/adapters/customVariables/ifRegion.js.map +1 -1
- package/dist/adapters/customVariables/ifSGNodeChildren.js +1 -1
- package/dist/adapters/customVariables/ifSGNodeChildren.js.map +1 -1
- package/dist/adapters/customVariables/ifSGNodeField.js +1 -1
- package/dist/adapters/customVariables/ifSGNodeField.js.map +1 -1
- package/dist/adapters/customVariables/ifSGNodeHttpAgentAccess.js +3 -2
- package/dist/adapters/customVariables/ifSGNodeHttpAgentAccess.js.map +1 -1
- package/dist/adapters/customVariables/ifSGScreen.js +3 -3
- package/dist/adapters/customVariables/ifSGScreen.js.map +1 -1
- package/dist/adapters/customVariables/ifSocket.js +6 -6
- package/dist/adapters/customVariables/ifSocket.js.map +1 -1
- package/dist/adapters/customVariables/ifSprite.js +2 -2
- package/dist/adapters/customVariables/ifSprite.js.map +1 -1
- package/dist/adapters/customVariables/ifVideoPlayer.js +2 -2
- package/dist/adapters/customVariables/ifVideoPlayer.js.map +1 -1
- package/dist/adapters/customVariables/ifXMLElement.js +4 -4
- package/dist/adapters/customVariables/ifXMLElement.js.map +1 -1
- package/dist/adapters/customVariables/ifXMLList.js +4 -4
- package/dist/adapters/customVariables/ifXMLList.js.map +1 -1
- package/dist/bsc/BscProject.d.ts +27 -0
- package/dist/bsc/BscProject.js +50 -0
- package/dist/bsc/BscProject.js.map +1 -0
- package/dist/bsc/BscProjectThreaded.d.ts +45 -0
- package/dist/bsc/BscProjectThreaded.js +90 -0
- package/dist/bsc/BscProjectThreaded.js.map +1 -0
- package/dist/bsc/threading/BscProjectWorkerPool.d.ts +5 -0
- package/dist/bsc/threading/BscProjectWorkerPool.js +29 -0
- package/dist/bsc/threading/BscProjectWorkerPool.js.map +1 -0
- package/dist/bsc/threading/ThreadMessageHandler.d.ts +99 -0
- package/dist/bsc/threading/ThreadMessageHandler.js +138 -0
- package/dist/bsc/threading/ThreadMessageHandler.js.map +1 -0
- package/dist/bsc/threading/ThreadRunner.d.ts +30 -0
- package/dist/bsc/threading/ThreadRunner.js +50 -0
- package/dist/bsc/threading/ThreadRunner.js.map +1 -0
- package/dist/bsc/threading/WorkerPool.d.ts +38 -0
- package/dist/bsc/threading/WorkerPool.js +78 -0
- package/dist/bsc/threading/WorkerPool.js.map +1 -0
- package/dist/debugSession/BrightScriptDebugSession.d.ts +16 -0
- package/dist/debugSession/BrightScriptDebugSession.js +342 -23
- package/dist/debugSession/BrightScriptDebugSession.js.map +1 -1
- package/dist/debugSession/ecpRegistryUtils.d.ts +11 -0
- package/dist/debugSession/ecpRegistryUtils.js +168 -0
- package/dist/debugSession/ecpRegistryUtils.js.map +1 -0
- package/dist/interfaces.d.ts +12 -0
- package/dist/managers/BreakpointManager.d.ts +10 -0
- package/dist/managers/BreakpointManager.js +15 -5
- package/dist/managers/BreakpointManager.js.map +1 -1
- package/dist/managers/ProjectManager.d.ts +31 -12
- package/dist/managers/ProjectManager.js +61 -9
- package/dist/managers/ProjectManager.js.map +1 -1
- package/dist/util.d.ts +10 -1
- package/dist/util.js +36 -0
- package/dist/util.js.map +1 -1
- package/package.json +2 -2
- package/roku-debug-0.21.20.tgz +0 -0
- package/roku-debug-0.21.18.tgz +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThreadRunner = void 0;
|
|
4
|
+
const ThreadMessageHandler_1 = require("./ThreadMessageHandler");
|
|
5
|
+
/**
|
|
6
|
+
* Runner logic for Running a Project in a worker thread.
|
|
7
|
+
*/
|
|
8
|
+
class ThreadRunner {
|
|
9
|
+
constructor(subjectFactory) {
|
|
10
|
+
this.subjectFactory = subjectFactory;
|
|
11
|
+
//collection of interceptors that will be called when events are fired
|
|
12
|
+
this.requestInterceptors = {};
|
|
13
|
+
}
|
|
14
|
+
run(parentPort) {
|
|
15
|
+
this.messageHandler = new ThreadMessageHandler_1.ThreadMessageHandler({
|
|
16
|
+
name: 'WorkerThread',
|
|
17
|
+
port: parentPort,
|
|
18
|
+
onRequest: async (request) => {
|
|
19
|
+
var _a, _b, _c;
|
|
20
|
+
try {
|
|
21
|
+
//if we have a request interceptor registered for this event, call it
|
|
22
|
+
(_b = (_a = this.requestInterceptors)[request.name]) === null || _b === void 0 ? void 0 : _b.call(_a, request.data);
|
|
23
|
+
//only the LspProject interface method names will be passed as request names, so just call those functions on the Project class directly
|
|
24
|
+
let responseData = await this.subject[request.name](...(_c = request.data) !== null && _c !== void 0 ? _c : []);
|
|
25
|
+
this.messageHandler.sendResponse(request, { data: responseData });
|
|
26
|
+
//we encountered a runtime crash. Pass that error along as the response to this request
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
const error = e;
|
|
30
|
+
this.messageHandler.sendResponse(request, { error: error });
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
onUpdate: (update) => {
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
this.requestInterceptors.activate = this.onActivate.bind(this);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Fired anytime we get an `activate` request from the client. This allows us to clean up the previous project and make a new one
|
|
40
|
+
*/
|
|
41
|
+
onActivate() {
|
|
42
|
+
var _a;
|
|
43
|
+
//clean up any existing project
|
|
44
|
+
void ((_a = this.subject) === null || _a === void 0 ? void 0 : _a.dispose());
|
|
45
|
+
//make a new instance of the subject
|
|
46
|
+
this.subject = this.subjectFactory();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.ThreadRunner = ThreadRunner;
|
|
50
|
+
//# sourceMappingURL=ThreadRunner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreadRunner.js","sourceRoot":"","sources":["../../../src/bsc/threading/ThreadRunner.ts"],"names":[],"mappings":";;;AAEA,iEAA8D;AAE9D;;GAEG;AACH,MAAa,YAAY;IAErB,YACY,cAAuB;QAAvB,mBAAc,GAAd,cAAc,CAAS;QAKnC,sEAAsE;QAC9D,wBAAmB,GAAG,EAAgD,CAAC;IAH/E,CAAC;IAYM,GAAG,CAAC,UAAuB;QAC9B,IAAI,CAAC,cAAc,GAAG,IAAI,2CAAoB,CAAC;YAC3C,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,KAAK,EAAE,OAAsB,EAAE,EAAE;;gBACxC,IAAI;oBACA,qEAAqE;oBACrE,MAAA,MAAA,IAAI,CAAC,mBAAmB,EAAC,OAAO,CAAC,IAAI,CAAC,mDAAG,OAAO,CAAC,IAAI,CAAC,CAAC;oBAEvD,wIAAwI;oBACxI,IAAI,YAAY,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,MAAA,OAAO,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAC;oBAC3E,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;oBAElE,uFAAuF;iBAC1F;gBAAC,OAAO,CAAC,EAAE;oBACR,MAAM,KAAK,GAAU,CAAmB,CAAC;oBACzC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;iBAC/D;YACL,CAAC;YACD,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE;YAErB,CAAC;SACJ,CAAC,CAAC;QAEF,IAAI,CAAC,mBAA2B,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACK,UAAU;;QACd,+BAA+B;QAC/B,KAAK,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,EAAE,CAAA,CAAC;QAE7B,oCAAoC;QACpC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IACzC,CAAC;CACJ;AAvDD,oCAuDC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { Worker } from 'worker_threads';
|
|
3
|
+
export declare class WorkerPool {
|
|
4
|
+
private factory;
|
|
5
|
+
constructor(factory: () => Worker);
|
|
6
|
+
logger: import("@rokucommunity/logger/dist/Logger").Logger;
|
|
7
|
+
/**
|
|
8
|
+
* List of workers that are free to be used by a new task
|
|
9
|
+
*/
|
|
10
|
+
private freeWorkers;
|
|
11
|
+
/**
|
|
12
|
+
* List of all workers that we've ever created
|
|
13
|
+
*/
|
|
14
|
+
private allWorkers;
|
|
15
|
+
/**
|
|
16
|
+
* Ensure that there are ${count} workers available in the pool
|
|
17
|
+
* @param count the number of total free workers that should exist when this function exits
|
|
18
|
+
*/
|
|
19
|
+
preload(count: number): void;
|
|
20
|
+
/**
|
|
21
|
+
* Create a new worker
|
|
22
|
+
*/
|
|
23
|
+
private createWorker;
|
|
24
|
+
/**
|
|
25
|
+
* Get a worker from the pool, or create a new one if none are available
|
|
26
|
+
* @returns a worker
|
|
27
|
+
*/
|
|
28
|
+
getWorker(): Worker;
|
|
29
|
+
/**
|
|
30
|
+
* Give the worker back to the pool so it can be used by someone else
|
|
31
|
+
* @param worker the worker
|
|
32
|
+
*/
|
|
33
|
+
releaseWorker(worker: Worker): void;
|
|
34
|
+
/**
|
|
35
|
+
* Shut down all active worker pools
|
|
36
|
+
*/
|
|
37
|
+
dispose(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkerPool = void 0;
|
|
4
|
+
const logging_1 = require("../../logging");
|
|
5
|
+
class WorkerPool {
|
|
6
|
+
constructor(factory) {
|
|
7
|
+
this.factory = factory;
|
|
8
|
+
this.logger = (0, logging_1.createLogger)();
|
|
9
|
+
/**
|
|
10
|
+
* List of workers that are free to be used by a new task
|
|
11
|
+
*/
|
|
12
|
+
this.freeWorkers = [];
|
|
13
|
+
/**
|
|
14
|
+
* List of all workers that we've ever created
|
|
15
|
+
*/
|
|
16
|
+
this.allWorkers = [];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Ensure that there are ${count} workers available in the pool
|
|
20
|
+
* @param count the number of total free workers that should exist when this function exits
|
|
21
|
+
*/
|
|
22
|
+
preload(count) {
|
|
23
|
+
while (this.freeWorkers.length < count) {
|
|
24
|
+
this.freeWorkers.push(this.createWorker());
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a new worker
|
|
29
|
+
*/
|
|
30
|
+
createWorker() {
|
|
31
|
+
const worker = this.factory();
|
|
32
|
+
this.allWorkers.push(worker);
|
|
33
|
+
return worker;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get a worker from the pool, or create a new one if none are available
|
|
37
|
+
* @returns a worker
|
|
38
|
+
*/
|
|
39
|
+
getWorker() {
|
|
40
|
+
//we have no free workers. spin up a new one
|
|
41
|
+
if (this.freeWorkers.length === 0) {
|
|
42
|
+
this.logger.log('Creating new worker thread');
|
|
43
|
+
return this.createWorker();
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
//return an existing free worker
|
|
47
|
+
this.logger.log('Reusing existing worker thread');
|
|
48
|
+
return this.freeWorkers.pop();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Give the worker back to the pool so it can be used by someone else
|
|
53
|
+
* @param worker the worker
|
|
54
|
+
*/
|
|
55
|
+
releaseWorker(worker) {
|
|
56
|
+
//add this worker back to the free workers list (if it's not already in there)
|
|
57
|
+
if (!this.freeWorkers.includes(worker)) {
|
|
58
|
+
this.freeWorkers.push(worker);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Shut down all active worker pools
|
|
63
|
+
*/
|
|
64
|
+
dispose() {
|
|
65
|
+
for (const worker of this.allWorkers) {
|
|
66
|
+
try {
|
|
67
|
+
void worker.terminate().catch((e) => console.error(e));
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
console.error(e);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
this.allWorkers = [];
|
|
74
|
+
this.freeWorkers = [];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.WorkerPool = WorkerPool;
|
|
78
|
+
//# sourceMappingURL=WorkerPool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkerPool.js","sourceRoot":"","sources":["../../../src/bsc/threading/WorkerPool.ts"],"names":[],"mappings":";;;AACA,2CAA6C;AAE7C,MAAa,UAAU;IACnB,YACY,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;QAK1B,WAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;QAE/B;;WAEG;QACK,gBAAW,GAAa,EAAE,CAAC;QACnC;;WAEG;QACK,eAAU,GAAa,EAAE,CAAC;IAXlC,CAAC;IAaD;;;OAGG;IACI,OAAO,CAAC,KAAa;QACxB,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,KAAK,EAAE;YACpC,IAAI,CAAC,W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;AAhFD,gCAgFC"}
|
|
@@ -154,6 +154,13 @@ export declare class BrightScriptDebugSession extends BaseDebugSession {
|
|
|
154
154
|
evaluateRequest(response: DebugProtocol.EvaluateResponse, args: DebugProtocol.EvaluateArguments): Promise<void>;
|
|
155
155
|
private evaluateExpressionToTempVar;
|
|
156
156
|
private bulkEvaluateExpressionToTempVar;
|
|
157
|
+
protected completionsRequest(response: DebugProtocol.CompletionsResponse, args: DebugProtocol.CompletionsArguments, request?: DebugProtocol.Request): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Gets the closest completion details the incoming completion request.
|
|
160
|
+
*/
|
|
161
|
+
private getClosestCompletionDetails;
|
|
162
|
+
private findVariableByPath;
|
|
163
|
+
private debuggerVarTypeToRoType;
|
|
157
164
|
/**
|
|
158
165
|
* Called when the host stops debugging
|
|
159
166
|
* @param response
|
|
@@ -198,3 +205,12 @@ export declare class BrightScriptDebugSession extends BaseDebugSession {
|
|
|
198
205
|
shutdown(errorMessage?: string, modal?: boolean): Promise<void>;
|
|
199
206
|
private _shutdown;
|
|
200
207
|
}
|
|
208
|
+
export interface AugmentedVariable extends DebugProtocol.Variable {
|
|
209
|
+
childVariables?: AugmentedVariable[];
|
|
210
|
+
request_seq?: number;
|
|
211
|
+
frameId?: number;
|
|
212
|
+
/**
|
|
213
|
+
* only used for lazy variables
|
|
214
|
+
*/
|
|
215
|
+
isResolved?: boolean;
|
|
216
|
+
}
|