roku-debug 0.14.2 → 0.16.0

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/CompileErrorProcessor.d.ts +60 -21
  3. package/dist/CompileErrorProcessor.js +175 -177
  4. package/dist/CompileErrorProcessor.js.map +1 -1
  5. package/dist/RendezvousTracker.js +13 -9
  6. package/dist/RendezvousTracker.js.map +1 -1
  7. package/dist/adapters/DebugProtocolAdapter.d.ts +2 -4
  8. package/dist/adapters/DebugProtocolAdapter.js +3 -2
  9. package/dist/adapters/DebugProtocolAdapter.js.map +1 -1
  10. package/dist/adapters/TelnetAdapter.d.ts +2 -4
  11. package/dist/adapters/TelnetAdapter.js +3 -7
  12. package/dist/adapters/TelnetAdapter.js.map +1 -1
  13. package/dist/debugProtocol/Constants.d.ts +12 -1
  14. package/dist/debugProtocol/Constants.js +11 -0
  15. package/dist/debugProtocol/Constants.js.map +1 -1
  16. package/dist/debugProtocol/Debugger.d.ts +13 -0
  17. package/dist/debugProtocol/Debugger.js +92 -51
  18. package/dist/debugProtocol/Debugger.js.map +1 -1
  19. package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.d.ts +32 -0
  20. package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.js +67 -0
  21. package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.js.map +1 -0
  22. package/dist/debugProtocol/responses/VariableResponse.js +5 -0
  23. package/dist/debugProtocol/responses/VariableResponse.js.map +1 -1
  24. package/dist/debugSession/BrightScriptDebugSession.d.ts +4 -0
  25. package/dist/debugSession/BrightScriptDebugSession.js +36 -35
  26. package/dist/debugSession/BrightScriptDebugSession.js.map +1 -1
  27. package/dist/debugSession/Events.d.ts +102 -43
  28. package/dist/debugSession/Events.js +120 -30
  29. package/dist/debugSession/Events.js.map +1 -1
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.js +1 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/util.d.ts +9 -16
  34. package/dist/util.js +26 -42
  35. package/dist/util.js.map +1 -1
  36. package/package.json +3 -3
  37. package/roku-debug-0.16.0.tgz +0 -0
  38. package/roku-debug-0.14.2.tgz +0 -0
package/CHANGELOG.md CHANGED
@@ -6,6 +6,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
 
8
8
 
9
+ ## [0.16.0](https://github.com/rokucommunity/roku-debug/compare/v0.15.0...0.16.0) - 2022-10-17
10
+ ### Changed
11
+ - Emit device diagnostics instead of compile errors ([#104](https://github.com/rokucommunity/roku-debug/pull/104))
12
+ - Standardize custom events, add is* helpers ([#103](https://github.com/rokucommunity/roku-debug/pull/103))
13
+ - upgrade to [brighterscript@0.60.0](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0600---2022-10-10). Notable changes since 0.56.0:
14
+ - upgrade to [roku-deploy@3.9.2](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#392---2022-10-03). Notable changes since 3.7.1:
15
+ - Replace minimatch with picomatch ([roku-deploy#101](https://github.com/rokucommunity/roku-deploy/pull/101))
16
+ - Sync retainStagingFolder, stagingFolderPath with options. ([roku-deploy#100](https://github.com/rokucommunity/roku-deploy/pull/100))
17
+ - Add stagingDir and retainStagingDir. ([roku-deploy#99](https://github.com/rokucommunity/roku-deploy/pull/99))
18
+ - Remotedebug connect early ([roku-deploy#97](https://github.com/rokucommunity/roku-deploy/pull/97))
19
+ - Better compile error handling ([roku-deploy#96](https://github.com/rokucommunity/roku-deploy/pull/96))
20
+ ### Fixed
21
+ - crash in rendezvous parser for missing files ([#108](https://github.com/rokucommunity/roku-debug/pull/108))
22
+ - better debug protocol launch handling ([#102](https://github.com/rokucommunity/roku-debug/pull/102))
23
+
24
+
25
+
26
+ ## [0.15.0](https://github.com/rokucommunity/roku-debug/compare/v0.14.2...0.15.0) - 2022-08-23
27
+ ### Added
28
+ - support for conditional breakpoints over the debug protocol([#97](https://github.com/rokucommunity/roku-debug/pull/97))
29
+ ### Changed
30
+ - upgrade to [brighterscript@0.56.0](https://github.com/rokucommunity/brighterscript/blob/master/CHANGELOG.md#0560---2022-08-23). Notable changes since 0.55.1:
31
+ - Fix compile crash for scope-less files ([brighterscript#674](https://github.com/rokucommunity/brighterscript/pull/674))
32
+ - Allow const as variable name ([brighterscript#670](https://github.com/rokucommunity/brighterscript/pull/670))
33
+ ### Fixed
34
+ - `stopOnEntry` bug with `deepLinkUrl`. ([#100](https://github.com/rokucommunity/roku-debug/pull/100))
35
+ - bug that was omitting `invalid` data types over the debug protocol ([#99](https://github.com/rokucommunity/roku-debug/pull/99))
36
+
37
+
38
+
9
39
  ## [0.14.2](https://github.com/rokucommunity/roku-debug/compare/v0.14.1...0.14.2) - 2022-08-12
10
40
  ### Changed
11
41
  - Support complib breakpoints on 11.5.0 ([#96](https://github.com/rokucommunity/roku-debug/pull/96))
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- export declare const GENERAL_XML_ERROR = "General XML compilation error";
2
+ import type { Diagnostic } from 'vscode-languageserver-protocol/node';
3
3
  export declare class CompileErrorProcessor {
4
4
  private logger;
5
5
  status: CompileStatus;
@@ -9,23 +9,57 @@ export declare class CompileErrorProcessor {
9
9
  compileErrorTimeoutMs: number;
10
10
  private emitter;
11
11
  compileErrorTimer: NodeJS.Timeout;
12
- on(eventName: 'compile-errors', handler: (params: BrightScriptDebugCompileError[]) => void): any;
12
+ on(eventName: 'diagnostics', handler: (params: BSDebugDiagnostic[]) => void): any;
13
13
  private emit;
14
14
  processUnhandledLines(responseText: string): void;
15
15
  sendErrors(): Promise<void>;
16
- private getErrors;
17
- /**
18
- * Runs a regex to get the content between telnet commands
19
- * @param value
20
- */
21
- private getSyntaxErrorDetails;
22
- getSyntaxErrors(lines: string[]): BrightScriptDebugCompileError[];
23
- getCompileErrors(lines: string[]): BrightScriptDebugCompileError[];
24
- getLineErrors(path: string, fileErrorText: string): BrightScriptDebugCompileError[];
25
- getSingleFileXmlError(lines: string[]): BrightScriptDebugCompileError[];
26
- getSingleFileXmlComponentError(lines: string[]): BrightScriptDebugCompileError[];
27
- getMultipleFileXmlError(lines: string[]): BrightScriptDebugCompileError[];
28
- getMissingManifestError(lines: string[]): BrightScriptDebugCompileError[];
16
+ getErrors(lines: string[]): BSDebugDiagnostic[];
17
+ /**
18
+ * Parse generic xml errors with no further context below
19
+ */
20
+ parseGenericXmlError(line: string): BSDebugDiagnostic[];
21
+ /**
22
+ * Parse the standard syntax and compile error format
23
+ */
24
+ private parseSyntaxAndCompileErrors;
25
+ /**
26
+ * Handles when an error lists the filename on the first line, then subsequent lines each have 1 error.
27
+ * Stops on the first line that doesn't have an error line. Like this:
28
+ * ```
29
+ * Found 3 parse errors in XML file Foo.xml
30
+ * --- Line 2: Unexpected data found inside a <component> element (first 10 characters are "aaa")
31
+ * --- Line 3: Some unique error message
32
+ * --- Line 5: message with Line 4 inside it
33
+ */
34
+ private processMultiLineErrors;
35
+ /**
36
+ * Parse errors that look like this:
37
+ * ```
38
+ * Error in XML component RedButton defined in file pkg:/components/RedButton.xml
39
+ * -- Extends type does not exist: "ColoredButton"
40
+ */
41
+ private parseComponentDefinedInFileError;
42
+ /**
43
+ * Parse error messages that look like this:
44
+ * ```
45
+ * ------->No manifest. Invalid package.
46
+ * ```
47
+ */
48
+ private parseMissingManifestError;
49
+ /**
50
+ * Exec the regexp, and if there's a match, trim every group
51
+ */
52
+ private execAndTrim;
53
+ private buildMessage;
54
+ /**
55
+ * Given a text-based line number, convert it to a number and return a range.
56
+ * Defaults to line number 1 (1-based) if unable to parse.
57
+ * @returns a zero-based vscode `Range` object
58
+ */
59
+ private getRange;
60
+ /**
61
+ * Trim all leading junk up to the `pkg:/` in this string
62
+ */
29
63
  sanitizeCompilePath(debuggerPath: string): string;
30
64
  resetCompileErrorTimer(isRunning: any): any;
31
65
  onCompileErrorTimer(): void;
@@ -36,14 +70,19 @@ export declare class CompileErrorProcessor {
36
70
  * @param responseText
37
71
  */
38
72
  private reportErrors;
73
+ destroy(): void;
39
74
  }
40
- export interface BrightScriptDebugCompileError {
75
+ export interface BSDebugDiagnostic extends Diagnostic {
76
+ /**
77
+ * Path to the file in question. When emitted from a Roku device, this will be a full pkgPath (i.e. `pkg:/source/main.brs`).
78
+ * As it flows through the program, this may be modified to represent a source location (i.e. `C:/projects/app/source/main.brs`)
79
+ */
41
80
  path: string;
42
- lineNumber: number;
43
- message: string;
44
- errorText: string;
45
- charStart: number;
46
- charEnd: number;
81
+ /**
82
+ * The name of the component library this diagnostic was emitted from. Should be undefined if diagnostic originated from the
83
+ * main app.
84
+ */
85
+ componentLibraryName?: string;
47
86
  }
48
87
  export declare enum CompileStatus {
49
88
  none = "none",
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CompileStatus = exports.CompileErrorProcessor = exports.GENERAL_XML_ERROR = void 0;
3
+ exports.CompileStatus = exports.CompileErrorProcessor = void 0;
4
4
  const events_1 = require("events");
5
5
  const logging_1 = require("./logging");
6
- exports.GENERAL_XML_ERROR = 'General XML compilation error';
6
+ const brighterscript_1 = require("brighterscript");
7
7
  class CompileErrorProcessor {
8
8
  constructor() {
9
9
  this.logger = logging_1.logger.createLogger(`[${CompileErrorProcessor.name}]`);
@@ -82,204 +82,202 @@ class CompileErrorProcessor {
82
82
  setTimeout(resolve, 500);
83
83
  });
84
84
  }
85
- getErrors() {
86
- return [
87
- ...this.getSyntaxErrors(this.compilingLines),
88
- ...this.getCompileErrors(this.compilingLines),
89
- ...this.getMultipleFileXmlError(this.compilingLines),
90
- ...this.getSingleFileXmlError(this.compilingLines),
91
- ...this.getSingleFileXmlComponentError(this.compilingLines),
92
- ...this.getMissingManifestError(this.compilingLines)
93
- ];
85
+ getErrors(lines) {
86
+ const result = [];
87
+ //clone the lines so the parsers can manipulate them
88
+ lines = [...lines];
89
+ while (lines.length > 0) {
90
+ const startLength = lines.length;
91
+ const line = lines[0];
92
+ if (line) {
93
+ result.push(...[
94
+ this.processMultiLineErrors(lines),
95
+ this.parseComponentDefinedInFileError(lines),
96
+ this.parseGenericXmlError(line),
97
+ this.parseSyntaxAndCompileErrors(line),
98
+ this.parseMissingManifestError(line)
99
+ ].flat().filter(x => !!x));
100
+ }
101
+ //if none of the parsers consumed a line, remove the first line
102
+ if (lines.length === startLength) {
103
+ lines.shift();
104
+ }
105
+ }
106
+ return result.filter(x => {
107
+ //throw out $livecompile errors (those are generated by REPL/eval code)
108
+ return x.path && !x.path.toLowerCase().includes('$livecompile');
109
+ });
110
+ }
111
+ /**
112
+ * Parse generic xml errors with no further context below
113
+ */
114
+ parseGenericXmlError(line) {
115
+ var _a;
116
+ let [, message, files] = (_a = this.execAndTrim(
117
+ // https://regex101.com/r/LDUyww/3
118
+ /^(?:-+\>)?\s*(Error parsing (?:multiple )?XML component[s]?)\s+\(?(.+\.xml)\)?.*$/igm, line)) !== null && _a !== void 0 ? _a : [];
119
+ if (message && typeof files === 'string') {
120
+ //use the singular xml parse message since the plural doesn't make much sense when attached to a single file
121
+ if (message.toLowerCase() === 'error parsing multiple xml components') {
122
+ message = 'Error parsing XML component';
123
+ }
124
+ //there can be 1 or more file paths, so add a distinct error for each one
125
+ return files.split(',')
126
+ .map(filePath => ({
127
+ path: this.sanitizeCompilePath(filePath),
128
+ range: brighterscript_1.util.createRange(0, 0, 0, 999),
129
+ message: this.buildMessage(message),
130
+ code: undefined
131
+ }))
132
+ .filter(x => !!x);
133
+ }
94
134
  }
95
135
  /**
96
- * Runs a regex to get the content between telnet commands
97
- * @param value
136
+ * Parse the standard syntax and compile error format
98
137
  */
99
- getSyntaxErrorDetails(value) {
100
- return /(syntax|compile) error.* in (.*)\((\d+)\)(.*)/gim.exec(value);
138
+ parseSyntaxAndCompileErrors(line) {
139
+ var _a, _b;
140
+ let [, message, errorType, code, trailingInfo] = (_a = this.execAndTrim(
141
+ // https://regex101.com/r/HHZ6dE/3
142
+ /(.*?)(?:\(((?:syntax|compile)\s+error)\s+(&h[\w\d]+)?\s*\))\s*in\b\s+(.+)/ig, line)) !== null && _a !== void 0 ? _a : [];
143
+ if (message) {
144
+ //split the file path, line number, and trailing context if available.
145
+ let [, filePath, lineNumber, context] = (_b = this.execAndTrim(/(.+)\((\d+)?\)(.*)/ig, trailingInfo
146
+ //default the `filePath` var to the whole `trailingInfo` string
147
+ )) !== null && _b !== void 0 ? _b : [null, trailingInfo, null, null];
148
+ return [{
149
+ path: this.sanitizeCompilePath(filePath),
150
+ message: this.buildMessage(message, context),
151
+ range: this.getRange(lineNumber),
152
+ code: code
153
+ }];
154
+ }
101
155
  }
102
- getSyntaxErrors(lines) {
103
- let errors = [];
104
- let match;
105
- // let syntaxRegEx = /(syntax|compile) error.* in (.*)\((\d+)\)/gim;
106
- for (const line of lines) {
107
- match = this.getSyntaxErrorDetails(line);
108
- if (match) {
109
- let path = this.sanitizeCompilePath(match[2]);
110
- let lineNumber = parseInt(match[3]); //1-based
111
- //FIXME
112
- //if this match is a livecompile error, throw out all prior errors because that means we are re-running
113
- if (!path.toLowerCase().includes('$livecompile')) {
156
+ /**
157
+ * Handles when an error lists the filename on the first line, then subsequent lines each have 1 error.
158
+ * Stops on the first line that doesn't have an error line. Like this:
159
+ * ```
160
+ * Found 3 parse errors in XML file Foo.xml
161
+ * --- Line 2: Unexpected data found inside a <component> element (first 10 characters are "aaa")
162
+ * --- Line 3: Some unique error message
163
+ * --- Line 5: message with Line 4 inside it
164
+ */
165
+ processMultiLineErrors(lines) {
166
+ var _a, _b;
167
+ const errors = [];
168
+ let [, count, filePath] = (_a = this.execAndTrim(
169
+ // https://regex101.com/r/wBMp8B/1
170
+ /found (\d+).*error[s]? in.*?file(.*)/gmi, lines[0])) !== null && _a !== void 0 ? _a : [];
171
+ filePath = this.sanitizeCompilePath(filePath);
172
+ if (filePath) {
173
+ let i = 0;
174
+ //parse each line that looks like it's an error.
175
+ for (i = 1; i < lines.length; i++) {
176
+ //example: `Line 1: Unexpected data found inside a <component> element (first 10 characters are "aaa")`)
177
+ const [, lineNumber, message] = (_b = this.execAndTrim(/^[\-\s]*line (\d*):(.*)$/gim, lines[i])) !== null && _b !== void 0 ? _b : [];
178
+ if (lineNumber && message) {
114
179
  errors.push({
115
- path: path,
116
- lineNumber: lineNumber,
117
- errorText: line,
118
- message: match[0].trim(),
119
- charStart: 0,
120
- charEnd: 999 //TODO
180
+ path: filePath,
181
+ range: this.getRange(lineNumber),
182
+ message: this.buildMessage(message),
183
+ code: undefined
121
184
  });
122
185
  }
186
+ else {
187
+ //assume there are no more errors for this file
188
+ break;
189
+ }
123
190
  }
191
+ //remove the lines we consumed
192
+ lines.splice(0, i);
124
193
  }
125
194
  return errors;
126
195
  }
127
- getCompileErrors(lines) {
128
- let errors = [];
129
- let responseText = lines.join('\n');
130
- const filesWithErrors = responseText.split('=================================================================');
131
- if (filesWithErrors.length < 2) {
132
- return [];
133
- }
134
- let getFileInfoRegEx = /Found(?:.*)file (.*)$/im;
135
- for (let index = 1; index < filesWithErrors.length - 1; index++) {
136
- const fileErrorText = filesWithErrors[index];
137
- //TODO - for now just a simple parse - later on someone can improve with proper line checks + all parse/compile types
138
- //don't have time to do this now; just doing what keeps me productive.
139
- let match = getFileInfoRegEx.exec(fileErrorText);
140
- if (!match) {
141
- continue;
142
- }
143
- let path = this.sanitizeCompilePath(match[1]);
144
- let lineNumber = 1; //TODO this should iterate over all line numbers found in a file
145
- let errorText = 'ERR_COMPILE:';
146
- let message = fileErrorText.trim();
147
- let error = {
148
- path: path,
149
- lineNumber: lineNumber,
150
- errorText: errorText,
151
- message: message,
152
- charStart: 0,
153
- charEnd: 999 //TODO
154
- };
155
- //now iterate over the lines, to see if there's any errors we can extract
156
- let lineErrors = this.getLineErrors(path, fileErrorText);
157
- if (lineErrors.length > 0) {
158
- errors.push(...lineErrors);
159
- }
160
- else {
161
- errors.push(error);
196
+ /**
197
+ * Parse errors that look like this:
198
+ * ```
199
+ * Error in XML component RedButton defined in file pkg:/components/RedButton.xml
200
+ * -- Extends type does not exist: "ColoredButton"
201
+ */
202
+ parseComponentDefinedInFileError(lines) {
203
+ var _a;
204
+ let [, message, filePath] = (_a = this.execAndTrim(/(Error in XML component [a-z0-9_-]+) defined in file (.*)/i, lines[0])) !== null && _a !== void 0 ? _a : [];
205
+ if (filePath) {
206
+ lines.shift();
207
+ //assume the next line includes the actual error message
208
+ if (lines[0]) {
209
+ message = lines.shift();
162
210
  }
211
+ return [{
212
+ message: this.buildMessage(message),
213
+ path: this.sanitizeCompilePath(filePath),
214
+ range: this.getRange(),
215
+ code: undefined
216
+ }];
163
217
  }
164
- return errors;
165
- }
166
- getLineErrors(path, fileErrorText) {
167
- let errors = [];
168
- let getFileInfoRegEx = /^--- Line (\d*): (.*)$/gim;
169
- let match;
170
- while ((match = getFileInfoRegEx.exec(fileErrorText))) {
171
- let lineNumber = parseInt(match[1]); // 1-based
172
- let errorText = 'ERR_COMPILE:';
173
- let message = this.sanitizeCompilePath(match[2]);
174
- errors.push({
175
- path: path,
176
- lineNumber: lineNumber,
177
- errorText: errorText,
178
- message: message,
179
- charStart: 0,
180
- charEnd: 999 //TODO
181
- });
182
- }
183
- return errors;
184
218
  }
185
- getSingleFileXmlError(lines) {
186
- let errors = [];
187
- let getFileInfoRegEx = /^-------> Error parsing XML component (.*).*$/i;
188
- for (let line of lines) {
189
- let match = getFileInfoRegEx.exec(line);
190
- if (match) {
191
- let errorText = 'ERR_COMPILE:';
192
- let path = this.sanitizeCompilePath(match[1]);
193
- errors.push({
194
- path: path,
195
- lineNumber: 1,
196
- errorText: errorText,
197
- message: exports.GENERAL_XML_ERROR,
198
- charStart: 0,
199
- charEnd: 999 //TODO
200
- });
201
- }
219
+ /**
220
+ * Parse error messages that look like this:
221
+ * ```
222
+ * ------->No manifest. Invalid package.
223
+ * ```
224
+ */
225
+ parseMissingManifestError(line) {
226
+ var _a;
227
+ let [, message] = (_a = this.execAndTrim(
228
+ // https://regex101.com/r/ANr5xd/1
229
+ /^(?:-+)>(No manifest\. Invalid package\.)/i, line)) !== null && _a !== void 0 ? _a : [];
230
+ if (message) {
231
+ return [{
232
+ path: 'pkg:/manifest',
233
+ range: brighterscript_1.util.createRange(0, 0, 0, 999),
234
+ message: this.buildMessage(message)
235
+ }];
202
236
  }
203
- return errors;
204
237
  }
205
- getSingleFileXmlComponentError(lines) {
238
+ /**
239
+ * Exec the regexp, and if there's a match, trim every group
240
+ */
241
+ execAndTrim(pattern, text) {
206
242
  var _a;
207
- let errors = [];
208
- let getFileInfoRegEx = /Error in XML component [a-z0-9_-]+ defined in file (.*)/i;
209
- for (let i = 0; i < lines.length; i++) {
210
- const line = lines[i];
211
- let match = getFileInfoRegEx.exec(line);
212
- if (match) {
213
- let errorText = 'ERR_COMPILE:';
214
- let path = match[1];
215
- errors.push({
216
- path: path,
217
- lineNumber: 1,
218
- errorText: errorText,
219
- message: `${line}\n${(_a = lines[i + 1]) !== null && _a !== void 0 ? _a : ''}`,
220
- charStart: 0,
221
- charEnd: 999 //TODO
222
- });
223
- }
224
- }
225
- return errors;
243
+ return (_a = pattern.exec(text)) === null || _a === void 0 ? void 0 : _a.map(x => x === null || x === void 0 ? void 0 : x.trim());
226
244
  }
227
- getMultipleFileXmlError(lines) {
228
- let errors = [];
229
- let getFileInfoRegEx = /^-------> Error parsing multiple XML components \((.*)\)/i;
230
- for (const line of lines) {
231
- let match = getFileInfoRegEx.exec(line);
232
- if (match) {
233
- let errorText = 'ERR_COMPILE:';
234
- let filePaths = match[1].split(',');
235
- for (const path of filePaths) {
236
- errors.push({
237
- path: this.sanitizeCompilePath(path.trim()),
238
- lineNumber: 1,
239
- errorText: errorText,
240
- message: exports.GENERAL_XML_ERROR,
241
- charStart: 0,
242
- charEnd: 999 //TODO
243
- });
244
- }
245
- }
245
+ buildMessage(message, context) {
246
+ //remove any leading dashes or whitespace
247
+ message = message.replace(/^[ \t\-]+/g, '');
248
+ //append context to end of message (if available)
249
+ if ((context === null || context === void 0 ? void 0 : context.length) > 0) {
250
+ message += ' ' + context;
246
251
  }
247
- return errors;
252
+ //remove trailing period from message
253
+ message = message.replace(/[\s.]+$/, '');
254
+ return message;
248
255
  }
249
- getMissingManifestError(lines) {
250
- let errors = [];
251
- let getMissingManifestErrorRegEx = /^(?:-+)>(No manifest\. Invalid package\.)/i;
252
- for (const line of lines) {
253
- let match = getMissingManifestErrorRegEx.exec(line);
254
- if (match) {
255
- errors.push({
256
- path: 'manifest',
257
- lineNumber: 1,
258
- errorText: 'ERR_COMPILE:',
259
- message: match[1],
260
- charStart: 0,
261
- charEnd: 999 //TODO
262
- });
263
- }
264
- }
265
- return errors;
256
+ /**
257
+ * Given a text-based line number, convert it to a number and return a range.
258
+ * Defaults to line number 1 (1-based) if unable to parse.
259
+ * @returns a zero-based vscode `Range` object
260
+ */
261
+ getRange(lineNumberText) {
262
+ //convert the line number to an integer (if applicable)
263
+ let lineNumber = parseInt(lineNumberText); //1-based
264
+ lineNumber = isNaN(lineNumber) ? 1 : lineNumber;
265
+ return brighterscript_1.util.createRange(lineNumber - 1, 0, lineNumber - 1, 999);
266
266
  }
267
+ /**
268
+ * Trim all leading junk up to the `pkg:/` in this string
269
+ */
267
270
  sanitizeCompilePath(debuggerPath) {
268
- let protocolIndex = debuggerPath.indexOf('pkg:/');
269
- if (protocolIndex > 0) {
270
- return debuggerPath.slice(protocolIndex);
271
- }
272
- return debuggerPath;
271
+ var _a;
272
+ return (_a = debuggerPath === null || debuggerPath === void 0 ? void 0 : debuggerPath.replace(/.*?(?=pkg:\/)/, '')) === null || _a === void 0 ? void 0 : _a.trim();
273
273
  }
274
274
  resetCompileErrorTimer(isRunning) {
275
- // console.debug('resetCompileErrorTimer isRunning' + isRunning);
276
275
  if (this.compileErrorTimer) {
277
276
  clearInterval(this.compileErrorTimer);
278
277
  this.compileErrorTimer = undefined;
279
278
  }
280
279
  if (isRunning) {
281
280
  if (this.status === CompileStatus.compileError) {
282
- // console.debug('resetting resetCompileErrorTimer');
283
281
  this.compileErrorTimer = setTimeout(() => {
284
282
  this.onCompileErrorTimer();
285
283
  }, this.compileErrorTimeoutMs);
@@ -287,7 +285,6 @@ class CompileErrorProcessor {
287
285
  }
288
286
  }
289
287
  onCompileErrorTimer() {
290
- console.debug('onCompileErrorTimer: timer complete. should\'ve caught all errors ');
291
288
  this.status = CompileStatus.compileError;
292
289
  this.resetCompileErrorTimer(false);
293
290
  this.reportErrors();
@@ -319,13 +316,14 @@ class CompileErrorProcessor {
319
316
  * @param responseText
320
317
  */
321
318
  reportErrors() {
322
- console.debug('reportErrors');
323
- const errors = this.getErrors().filter((e) => {
324
- const path = e.path.toLowerCase();
325
- return path.endsWith('.brs') || path.endsWith('.xml') || path === 'manifest';
326
- });
319
+ const errors = this.getErrors(this.compilingLines);
327
320
  if (errors.length > 0) {
328
- this.emit('compile-errors', errors);
321
+ this.emit('diagnostics', errors);
322
+ }
323
+ }
324
+ destroy() {
325
+ if (this.emitter) {
326
+ this.emitter.removeAllListeners();
329
327
  }
330
328
  }
331
329
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CompileErrorProcessor.js","sourceRoot":"","sources":["../src/CompileErrorProcessor.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AACtC,uCAAmC;AAEtB,QAAA,iBAAiB,GAAG,+BAA+B,CAAC;AAEjE,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;IAkWzC,CAAC;IA9VU,EAAE,CAAC,SAAiB,EAAE,OAA+B;QACxD,IAAI,CAAC,OAAO,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