brighterscript 0.71.1 → 0.72.1

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 (121) hide show
  1. package/bsconfig.schema.json +75 -0
  2. package/dist/BsConfig.d.ts +90 -5
  3. package/dist/CodeActionUtil.d.ts +17 -0
  4. package/dist/CodeActionUtil.js.map +1 -1
  5. package/dist/CommentFlagProcessor.d.ts +16 -12
  6. package/dist/CommentFlagProcessor.js +141 -59
  7. package/dist/CommentFlagProcessor.js.map +1 -1
  8. package/dist/DiagnosticMessages.d.ts +32 -1
  9. package/dist/DiagnosticMessages.js +37 -2
  10. package/dist/DiagnosticMessages.js.map +1 -1
  11. package/dist/LanguageServer.d.ts +15 -2
  12. package/dist/LanguageServer.js +100 -7
  13. package/dist/LanguageServer.js.map +1 -1
  14. package/dist/Program.d.ts +80 -1
  15. package/dist/Program.js +217 -2
  16. package/dist/Program.js.map +1 -1
  17. package/dist/ProgramBuilder.d.ts +1 -8
  18. package/dist/ProgramBuilder.js +31 -11
  19. package/dist/ProgramBuilder.js.map +1 -1
  20. package/dist/Scope.d.ts +53 -7
  21. package/dist/Scope.js +28 -66
  22. package/dist/Scope.js.map +1 -1
  23. package/dist/ScopeNamespaceLookup.d.ts +73 -0
  24. package/dist/ScopeNamespaceLookup.js +240 -0
  25. package/dist/ScopeNamespaceLookup.js.map +1 -0
  26. package/dist/SymbolTable.d.ts +9 -2
  27. package/dist/SymbolTable.js +10 -5
  28. package/dist/SymbolTable.js.map +1 -1
  29. package/dist/bscPlugin/BscPlugin.d.ts +3 -1
  30. package/dist/bscPlugin/BscPlugin.js +8 -0
  31. package/dist/bscPlugin/BscPlugin.js.map +1 -1
  32. package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +38 -0
  33. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +259 -18
  34. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
  35. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +360 -10
  36. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
  37. package/dist/bscPlugin/codeActions/FixAllCodeActionsProcessor.d.ts +17 -0
  38. package/dist/bscPlugin/codeActions/FixAllCodeActionsProcessor.js +66 -0
  39. package/dist/bscPlugin/codeActions/FixAllCodeActionsProcessor.js.map +1 -0
  40. package/dist/bscPlugin/codeActions/codeActionHelpers.d.ts +18 -0
  41. package/dist/bscPlugin/codeActions/codeActionHelpers.js +29 -0
  42. package/dist/bscPlugin/codeActions/codeActionHelpers.js.map +1 -0
  43. package/dist/bscPlugin/selectionRanges/SelectionRangesProcessor.d.ts +7 -0
  44. package/dist/bscPlugin/selectionRanges/SelectionRangesProcessor.js +74 -0
  45. package/dist/bscPlugin/selectionRanges/SelectionRangesProcessor.js.map +1 -0
  46. package/dist/bscPlugin/selectionRanges/SelectionRangesProcessor.spec.d.ts +1 -0
  47. package/dist/bscPlugin/selectionRanges/SelectionRangesProcessor.spec.js +298 -0
  48. package/dist/bscPlugin/selectionRanges/SelectionRangesProcessor.spec.js.map +1 -0
  49. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.d.ts +2 -0
  50. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js +49 -4
  51. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +1 -1
  52. package/dist/bscPlugin/validation/BrsFileValidator.d.ts +13 -0
  53. package/dist/bscPlugin/validation/BrsFileValidator.js +55 -0
  54. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
  55. package/dist/bscPlugin/validation/BrsFileValidator.spec.js +316 -0
  56. package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
  57. package/dist/bscPlugin/validation/ScopeValidator.d.ts +11 -0
  58. package/dist/bscPlugin/validation/ScopeValidator.js +69 -0
  59. package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
  60. package/dist/cli.js +13 -0
  61. package/dist/cli.js.map +1 -1
  62. package/dist/diagnosticUtils.d.ts +51 -1
  63. package/dist/diagnosticUtils.js +222 -1
  64. package/dist/diagnosticUtils.js.map +1 -1
  65. package/dist/files/BrsFile.d.ts +15 -0
  66. package/dist/files/BrsFile.js +92 -7
  67. package/dist/files/BrsFile.js.map +1 -1
  68. package/dist/files/BrsFile.spec.js +347 -3
  69. package/dist/files/BrsFile.spec.js.map +1 -1
  70. package/dist/files/XmlFile.js +2 -1
  71. package/dist/files/XmlFile.js.map +1 -1
  72. package/dist/files/XmlFile.spec.js +50 -0
  73. package/dist/files/XmlFile.spec.js.map +1 -1
  74. package/dist/interfaces.d.ts +66 -2
  75. package/dist/lexer/TokenKind.d.ts +8 -0
  76. package/dist/lexer/TokenKind.js +21 -1
  77. package/dist/lexer/TokenKind.js.map +1 -1
  78. package/dist/lsp/DocumentManager.spec.js +1 -1
  79. package/dist/lsp/DocumentManager.spec.js.map +1 -1
  80. package/dist/lsp/LspProject.d.ts +49 -1
  81. package/dist/lsp/Project.d.ts +33 -1
  82. package/dist/lsp/Project.js +107 -3
  83. package/dist/lsp/Project.js.map +1 -1
  84. package/dist/lsp/Project.spec.js +146 -9
  85. package/dist/lsp/Project.spec.js.map +1 -1
  86. package/dist/lsp/ProjectManager.d.ts +38 -2
  87. package/dist/lsp/ProjectManager.js +131 -5
  88. package/dist/lsp/ProjectManager.js.map +1 -1
  89. package/dist/lsp/ProjectManager.spec.js +272 -1
  90. package/dist/lsp/ProjectManager.spec.js.map +1 -1
  91. package/dist/lsp/worker/WorkerThreadProject.d.ts +27 -2
  92. package/dist/lsp/worker/WorkerThreadProject.js +16 -0
  93. package/dist/lsp/worker/WorkerThreadProject.js.map +1 -1
  94. package/dist/lsp/worker/WorkerThreadProject.spec.js +2 -1
  95. package/dist/lsp/worker/WorkerThreadProject.spec.js.map +1 -1
  96. package/dist/parser/Parser.d.ts +22 -0
  97. package/dist/parser/Parser.js +57 -16
  98. package/dist/parser/Parser.js.map +1 -1
  99. package/dist/parser/Parser.spec.js +239 -0
  100. package/dist/parser/Parser.spec.js.map +1 -1
  101. package/dist/parser/TranspileState.d.ts +4 -2
  102. package/dist/parser/TranspileState.js +3 -3
  103. package/dist/parser/TranspileState.js.map +1 -1
  104. package/dist/parser/tests/controlFlow/For.spec.js +47 -0
  105. package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
  106. package/dist/parser/tests/controlFlow/ForEach.spec.js +37 -0
  107. package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
  108. package/dist/parser/tests/controlFlow/While.spec.js +49 -0
  109. package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
  110. package/dist/parser/tests/expression/Call.spec.js +4 -5
  111. package/dist/parser/tests/expression/Call.spec.js.map +1 -1
  112. package/dist/parser/tests/expression/Function.spec.js +2 -2
  113. package/dist/parser/tests/expression/Function.spec.js.map +1 -1
  114. package/dist/parser/tests/statement/ConstStatement.spec.js +218 -1
  115. package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
  116. package/dist/parser/tests/statement/Enum.spec.js +2 -0
  117. package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
  118. package/dist/util.d.ts +26 -0
  119. package/dist/util.js +87 -8
  120. package/dist/util.js.map +1 -1
  121. package/package.json +4 -2
@@ -8,6 +8,53 @@
8
8
  "password"
9
9
  ]
10
10
  },
11
+ "definitions": {
12
+ "diagnosticReporterValue": {
13
+ "oneOf": [
14
+ {
15
+ "type": "string",
16
+ "description": "Either a preset name ('detailed' or 'github-actions') or a custom template string containing at least one known placeholder."
17
+ },
18
+ {
19
+ "type": "object",
20
+ "required": ["type"],
21
+ "properties": {
22
+ "type": {
23
+ "type": "string",
24
+ "enum": ["detailed"]
25
+ }
26
+ },
27
+ "additionalProperties": false
28
+ },
29
+ {
30
+ "type": "object",
31
+ "required": ["type"],
32
+ "properties": {
33
+ "type": {
34
+ "type": "string",
35
+ "enum": ["github-actions"]
36
+ }
37
+ },
38
+ "additionalProperties": false
39
+ },
40
+ {
41
+ "type": "object",
42
+ "required": ["type", "format"],
43
+ "properties": {
44
+ "type": {
45
+ "type": "string",
46
+ "enum": ["custom"]
47
+ },
48
+ "format": {
49
+ "type": "string",
50
+ "description": "Template string. Supported placeholders: {file}, {line}, {col}, {endLine}, {endCol}, {severity}, {severityCode}, {code}, {message}, {source}."
51
+ }
52
+ },
53
+ "additionalProperties": false
54
+ }
55
+ ]
56
+ }
57
+ },
11
58
  "properties": {
12
59
  "extends": {
13
60
  "description": "Relative or absolute path to another bsconfig.json file that this file should use as a base and then override. Prefix with a question mark (?) to prevent throwing an exception if the file does not exist.",
@@ -99,6 +146,11 @@
99
146
  "type": "boolean",
100
147
  "default": false
101
148
  },
149
+ "relativeSourceMaps": {
150
+ "description": "If true, source file paths in generated sourcemaps will be relative to the map file location instead of absolute. This makes sourcemaps portable across different machines and environments.",
151
+ "type": "boolean",
152
+ "default": false
153
+ },
102
154
  "copyToStaging": {
103
155
  "description": "If true, the files are copied to staging. This setting is ignored when deploy is enabled or if createPackage is enabled",
104
156
  "type": "boolean"
@@ -295,10 +347,33 @@
295
347
  "error"
296
348
  ]
297
349
  },
350
+ "diagnosticReporters": {
351
+ "description": "Specify how diagnostics are reported to the console. Accepts a single value or an array; each diagnostic is rendered once per entry. Each value is either a preset name ('detailed', 'github-actions'), a custom template string containing at least one known placeholder ({file}, {line}, {col}, {endLine}, {endCol}, {severity}, {severityCode}, {code}, {message}, {source}), or an object with explicit `type`. Defaults to 'detailed'.",
352
+ "default": "detailed",
353
+ "oneOf": [
354
+ {
355
+ "$ref": "#/definitions/diagnosticReporterValue"
356
+ },
357
+ {
358
+ "type": "array",
359
+ "items": {
360
+ "$ref": "#/definitions/diagnosticReporterValue"
361
+ }
362
+ }
363
+ ]
364
+ },
298
365
  "allowBrighterScriptInBrightScript": {
299
366
  "description": "Allow brighterscript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.",
300
367
  "type": "boolean",
301
368
  "default": false
369
+ },
370
+ "minFirmwareVersion": {
371
+ "description": "The minimum Roku firmware version required to run this project. When set, BrightScript (.brs) files will be validated to ensure they only use language features available in that firmware version or earlier. BrighterScript (.bs) files are always allowed to use all features since they are transpiled. Should be a semver-compatible string (e.g. \"11.0.0\").",
372
+ "type": "string",
373
+ "examples": [
374
+ "11.0.0",
375
+ "12.0.0"
376
+ ]
302
377
  }
303
378
  }
304
379
  }
@@ -129,6 +129,28 @@ export interface BsConfig {
129
129
  * Specify what diagnostic types should be printed to the console. Defaults to 'warn'
130
130
  */
131
131
  diagnosticLevel?: 'info' | 'hint' | 'warn' | 'error';
132
+ /**
133
+ * Specify how diagnostics should be reported to the console.
134
+ * Accepts a single value or an array. When given an array, each diagnostic is rendered
135
+ * once per entry (so you can, for example, get both detailed terminal output and
136
+ * github-actions PR annotations from a single run).
137
+ *
138
+ * Each value may be a preset name ('detailed', 'github-actions'), a custom template string
139
+ * (any string containing a `{` placeholder), or an object with explicit `type`.
140
+ *
141
+ * Custom templates support the following placeholders, replaced per diagnostic:
142
+ * {file}, {line}, {col}, {endLine}, {endCol}, {severity}, {code}, {message}, {source}
143
+ *
144
+ * Examples:
145
+ * "detailed"
146
+ * "github-actions"
147
+ * "{file}:{line}:{col} {severity} {code}: {message}"
148
+ * { type: "custom", format: "{file}:{line}: {message}" }
149
+ * ["detailed", "github-actions"]
150
+ *
151
+ * @default "detailed"
152
+ */
153
+ diagnosticReporters?: DiagnosticReporter | DiagnosticReporter[];
132
154
  /**
133
155
  * A list of scripts or modules to add extra diagnostics or transform the AST
134
156
  */
@@ -154,10 +176,16 @@ export interface BsConfig {
154
176
  */
155
177
  logLevel?: LogLevel | 'error' | 'warn' | 'log' | 'info' | 'debug' | 'trace' | 'off';
156
178
  /**
157
- * Override the path to source files in source maps. Use this if you have a preprocess step and want
158
- * to ensure the source maps point to the original location.
159
- * This will only alter source maps for files within rootDir. Any files found outside of rootDir will not
160
- * have their source maps changed. This option also affects the `SOURCE_FILE_PATH` and `SOURCE_LOCATION` source literals.
179
+ * Overrides where source files appear to live, in both sourcemaps and the `SOURCE_FILE_PATH` /
180
+ * `SOURCE_LOCATION` runtime literals. Only applies to files within `rootDir`.
181
+ *
182
+ * When `relativeSourceMaps` is false (default): the `rootDir` portion of each source path is
183
+ * replaced with `sourceRoot` directly in `sources[]`. The map's `sourceRoot` field is not written.
184
+ *
185
+ * When `relativeSourceMaps` is true: the map's `sourceRoot` field is set to this value, and
186
+ * `sources[]` entries are relative to `sourceRoot` (per the sourcemap spec).
187
+ *
188
+ * In both modes, `SOURCE_FILE_PATH` and `SOURCE_LOCATION` reflect the `sourceRoot`-substituted path.
161
189
  */
162
190
  sourceRoot?: string;
163
191
  /**
@@ -170,6 +198,20 @@ export interface BsConfig {
170
198
  * @default true
171
199
  */
172
200
  sourceMap?: boolean;
201
+ /**
202
+ * If true, file paths in sourcemap `sources[]` will be written as relative paths instead of absolute.
203
+ * Only has an effect when `sourceMap` is true.
204
+ *
205
+ * When false (default): `sources[]` contains absolute paths. If `sourceRoot` is set, the `rootDir`
206
+ * portion is replaced with `sourceRoot` in-place; the map's `sourceRoot` field is never written.
207
+ *
208
+ * When true: `sources[]` entries are relative to the map file's directory, making sourcemaps
209
+ * portable across machines. If `sourceRoot` is also set, the map's `sourceRoot` field is written
210
+ * and `sources[]` entries are instead relative to `sourceRoot` (per the sourcemap spec — consumers
211
+ * reconstruct the full path as `path.resolve(sourceRoot, sources[0])`).
212
+ * @default false
213
+ */
214
+ relativeSourceMaps?: boolean;
173
215
  /**
174
216
  * Excludes empty files from being included in the output. Some Brighterscript files
175
217
  * are left empty or with only comments after transpilation to Brightscript.
@@ -191,7 +233,50 @@ export interface BsConfig {
191
233
  * scripts inside `source` that depend on bslib.brs. Defaults to `source`.
192
234
  */
193
235
  bslibDestinationDir?: string;
236
+ /**
237
+ * The minimum Roku firmware version required to run this project.
238
+ * When set, BrightScript (.brs) files are always validated against the version restriction.
239
+ * BrighterScript (.bs) files are only validated for features that BrighterScript does not
240
+ * transpile — for example, optional chaining is emitted as-is, so it is subject to the
241
+ * restriction. Features that BrighterScript fully transpiles (such as classes) are not
242
+ * restricted, since the transpiled output is compatible with older firmware.
243
+ * Should be a semver-compatible string (e.g. "11.0.0").
244
+ */
245
+ minFirmwareVersion?: string;
246
+ /**
247
+ * When set to false, validation is skipped entirely. This can speed up builds when diagnostics
248
+ * are not needed (e.g. when using the VSCode extension which already surfaces diagnostics in the
249
+ * editor). Note that skipping validation may cause transpilation to fail or produce incorrect
250
+ * output if the project contains errors that would normally be caught during validation.
251
+ * @default true
252
+ */
253
+ validate?: boolean;
194
254
  }
195
- declare type OptionalBsConfigFields = '_ancestors' | 'sourceRoot' | 'project' | 'manifest' | 'noProject' | 'extends' | 'host' | 'password' | 'require' | 'stagingFolderPath' | 'diagnosticLevel' | 'rootDir' | 'stagingDir';
255
+ /**
256
+ * Discriminated union describing how diagnostics are rendered to the console.
257
+ * - String shorthand: a preset name ('detailed' | 'github-actions') or a template string
258
+ * (any string containing a `{` is treated as a custom template).
259
+ * - Object form: explicit `type` so config files can stay strictly typed.
260
+ */
261
+ export declare type DiagnosticReporter = 'detailed' | 'github-actions' | (string & {}) | {
262
+ type: 'detailed';
263
+ } | {
264
+ type: 'github-actions';
265
+ } | {
266
+ type: 'custom';
267
+ format: string;
268
+ };
269
+ /**
270
+ * Object form of `DiagnosticReporter` after string shorthand has been resolved.
271
+ */
272
+ export declare type NormalizedDiagnosticReporter = {
273
+ type: 'detailed';
274
+ } | {
275
+ type: 'github-actions';
276
+ } | {
277
+ type: 'custom';
278
+ format: string;
279
+ };
280
+ declare type OptionalBsConfigFields = '_ancestors' | 'sourceRoot' | 'project' | 'manifest' | 'noProject' | 'extends' | 'host' | 'password' | 'require' | 'stagingFolderPath' | 'diagnosticLevel' | 'rootDir' | 'stagingDir' | 'minFirmwareVersion' | 'diagnosticReporters';
196
281
  export declare type FinalizedBsConfig = Omit<Required<BsConfig>, OptionalBsConfigFields> & Pick<BsConfig, OptionalBsConfigFields>;
197
282
  export {};
@@ -19,6 +19,23 @@ export interface CodeActionShorthand {
19
19
  isPreferred?: boolean;
20
20
  changes: Array<InsertChange | ReplaceChange | DeleteChange>;
21
21
  }
22
+ /**
23
+ * Represents a single named "source fix all" action that a plugin contributes.
24
+ * Each action becomes a separate entry in VS Code's Source Actions menu.
25
+ * Plugins are responsible for merging all their changes into the `changes` array.
26
+ */
27
+ export interface SourceFixAllCodeAction {
28
+ title: string;
29
+ /**
30
+ * The LSP code action kind. Should start with `source.fixAll`.
31
+ * Use a sub-kind like `source.fixAll.brighterscript.imports` to create
32
+ * a distinct named entry in the Source Actions menu.
33
+ * Defaults to `source.fixAll.brighterscript`.
34
+ */
35
+ kind?: string;
36
+ isPreferred?: boolean;
37
+ changes: Array<InsertChange | ReplaceChange | DeleteChange>;
38
+ }
22
39
  export interface InsertChange {
23
40
  filePath: string;
24
41
  newText: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CodeActionUtil.js","sourceRoot":"","sources":["../src/CodeActionUtil.ts"],"names":[],"mappings":";;;AACA,iEAA6E;AAgDpE,+FAhDA,sCAAc,OAgDA;AA/CvB,2CAAiC;AAEjC,MAAa,cAAc;IAEhB,gBAAgB,CAAC,GAAwB;QAC5C,MAAM,IAAI,GAAG;YACT,OAAO,EAAE,EAAE;SACG,CAAC;QACnB,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE;YAC9B,MAAM,GAAG,GAAG,gBAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;YAEjD,4CAA4C;YAC5C,IAAI,CAAC,IAAI,CAAC,OAAQ,CAAC,GAAG,CAAC,EAAE;gBACrB,IAAI,CAAC,OAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;aAC3B;YACD,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE;gBAC1B,IAAI,CAAC,OAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CACnB,gCAAQ,CAAC,MA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AI,CAAC,CAAC;QAC5D,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;QACrC,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACnE,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,uBAAuB,CAAC,WAAqC;QAChE,OAAO,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC,CAAC;YACzF,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,OAAO;YAChB,kBAAkB,EAAE,kBAAkB;SACzC,CAAC,CAAC,CAAC;IACR,CAAC;CACJ;AA3CD,wCA2CC;AAmDY,QAAA,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC"}
@@ -13,10 +13,6 @@ export declare class CommentFlagProcessor {
13
13
  * Valid diagnostic codes. Codes NOT in this list will be flagged
14
14
  */
15
15
  diagnosticCodes: DiagnosticCode[];
16
- /**
17
- * Diagnostic codes to never filter (these codes will always be flagged)
18
- */
19
- ignoreDiagnosticCodes: DiagnosticCode[];
20
16
  constructor(
21
17
  /**
22
18
  * The file this processor applies to
@@ -29,11 +25,7 @@ export declare class CommentFlagProcessor {
29
25
  /**
30
26
  * Valid diagnostic codes. Codes NOT in this list will be flagged
31
27
  */
32
- diagnosticCodes?: DiagnosticCode[],
33
- /**
34
- * Diagnostic codes to never filter (these codes will always be flagged)
35
- */
36
- ignoreDiagnosticCodes?: DiagnosticCode[]);
28
+ diagnosticCodes?: DiagnosticCode[]);
37
29
  /**
38
30
  * List of comment flags generated during processing
39
31
  */
@@ -43,12 +35,24 @@ export declare class CommentFlagProcessor {
43
35
  */
44
36
  diagnostics: BsDiagnostic[];
45
37
  /**
46
- * A list of all codes EXCEPT the ones in `ignoreDiagnosticCodes`
38
+ * Block-level `bs:disable` / `bs:enable` directives, recorded in source order
39
+ * by `tryAdd` and resolved into `CommentFlag`s by `finalize()`.
47
40
  */
48
- allCodesExceptIgnores: DiagnosticCode[];
41
+ private blockDirectives;
49
42
  tryAdd(text: string, range: Range): void;
50
43
  /**
51
- * Small tokenizer for bs:disable comments
44
+ * Resolve any pending `bs:disable` / `bs:enable` block directives into `CommentFlag`s.
45
+ * Must be called after the file's comment tokens have been fed through `tryAdd`.
46
+ */
47
+ finalize(): void;
48
+ /**
49
+ * Resolve a list of `{ code, range }` tokens into validated diagnostic codes.
50
+ * Pushes diagnostics for any unknown numeric codes. Returns `null` when no codes were specified
51
+ * (i.e. a bare `bs:disable` / `bs:enable`), and an array otherwise.
52
+ */
53
+ private collectCodes;
54
+ /**
55
+ * Small tokenizer for `bs:` directive comments.
52
56
  */
53
57
  private tokenize;
54
58
  /**
@@ -16,15 +16,10 @@ class CommentFlagProcessor {
16
16
  /**
17
17
  * Valid diagnostic codes. Codes NOT in this list will be flagged
18
18
  */
19
- diagnosticCodes = [],
20
- /**
21
- * Diagnostic codes to never filter (these codes will always be flagged)
22
- */
23
- ignoreDiagnosticCodes = []) {
19
+ diagnosticCodes = []) {
24
20
  this.file = file;
25
21
  this.commentStarters = commentStarters;
26
22
  this.diagnosticCodes = diagnosticCodes;
27
- this.ignoreDiagnosticCodes = ignoreDiagnosticCodes;
28
23
  /**
29
24
  * List of comment flags generated during processing
30
25
  */
@@ -33,73 +28,149 @@ class CommentFlagProcessor {
33
28
  * List of diagnostics generated during processing
34
29
  */
35
30
  this.diagnostics = [];
36
- this.allCodesExceptIgnores = this.diagnosticCodes.filter(x => !this.ignoreDiagnosticCodes.includes(x));
31
+ /**
32
+ * Block-level `bs:disable` / `bs:enable` directives, recorded in source order
33
+ * by `tryAdd` and resolved into `CommentFlag`s by `finalize()`.
34
+ */
35
+ this.blockDirectives = [];
37
36
  }
38
37
  tryAdd(text, range) {
39
- var _a, _b;
40
38
  const tokenized = this.tokenize(text, range);
41
39
  if (!tokenized) {
42
40
  return;
43
41
  }
44
- let affectedRange;
45
- if (tokenized.disableType === 'line') {
46
- affectedRange = util_1.util.createRange(range.start.line, 0, range.start.line, range.start.character);
47
- }
48
- else {
49
- // tokenized.disableType must be 'next-line'
50
- affectedRange = util_1.util.createRange(range.start.line + 1, 0, range.start.line + 1, Number.MAX_SAFE_INTEGER);
42
+ //queue block directives with their raw code tokens; finalize() validates and resolves them
43
+ if (tokenized.directive === 'disable' || tokenized.directive === 'enable') {
44
+ this.blockDirectives.push({
45
+ kind: tokenized.directive,
46
+ rawCodes: tokenized.codes,
47
+ range: range
48
+ });
49
+ return;
51
50
  }
52
- let commentFlag = null;
53
- //statement to disable EVERYTHING
51
+ //line-level directives emit a flag inline
52
+ const affectedRange = tokenized.directive === 'line'
53
+ ? util_1.util.createRange(range.start.line, 0, range.start.line, range.start.character)
54
+ : util_1.util.createRange(range.start.line + 1, 0, range.start.line + 1, Number.MAX_SAFE_INTEGER);
54
55
  if (tokenized.codes.length === 0) {
55
- commentFlag = {
56
+ //bare `bs:disable-line` / `bs:disable-next-line` suppresses everything
57
+ this.commentFlags.push({
56
58
  file: this.file,
57
- //null means all codes
58
59
  codes: null,
59
60
  range: range,
60
61
  affectedRange: affectedRange
61
- };
62
- //disable specific diagnostic codes
62
+ });
63
+ return;
63
64
  }
64
- else {
65
- let codes = [];
66
- for (let codeToken of tokenized.codes) {
67
- let codeInt = parseInt(codeToken.code);
68
- //is a plugin-contributed or non-numeric code
69
- if (isNaN(codeInt)) {
70
- codes.push((_b = (_a = codeToken.code) === null || _a === void 0 ? void 0 : _a.toString()) === null || _b === void 0 ? void 0 : _b.toLowerCase());
71
- //validate numeric codes against the list of known bsc codes
72
- }
73
- else if (this.diagnosticCodes.includes(codeInt)) {
74
- codes.push(codeInt);
75
- //add a warning for unknown codes
65
+ const codes = this.collectCodes(tokenized.codes);
66
+ if (codes && codes.length > 0) {
67
+ this.commentFlags.push({
68
+ file: this.file,
69
+ codes: codes,
70
+ range: range,
71
+ affectedRange: affectedRange
72
+ });
73
+ }
74
+ }
75
+ /**
76
+ * Resolve any pending `bs:disable` / `bs:enable` block directives into `CommentFlag`s.
77
+ * Must be called after the file's comment tokens have been fed through `tryAdd`.
78
+ */
79
+ finalize() {
80
+ if (this.blockDirectives.length === 0) {
81
+ return;
82
+ }
83
+ //state across the file: which codes are suppressed within the current block
84
+ let allSuppressed = false;
85
+ const carveOuts = new Set();
86
+ for (let i = 0; i < this.blockDirectives.length; i++) {
87
+ const directive = this.blockDirectives[i];
88
+ const codes = this.collectCodes(directive.rawCodes);
89
+ //apply this directive to the running state
90
+ if (codes === null) {
91
+ //bare `bs:disable` / `bs:enable` resets state
92
+ allSuppressed = directive.kind === 'disable';
93
+ carveOuts.clear();
94
+ }
95
+ else if (directive.kind === 'disable') {
96
+ //in disable-all mode, "disable: X" cancels a prior carve-out for X
97
+ //in enable-all mode, "disable: X" adds X to the suppressed set
98
+ for (const code of codes) {
99
+ if (allSuppressed) {
100
+ carveOuts.delete(code);
101
+ }
102
+ else {
103
+ carveOuts.add(code);
104
+ }
76
105
  }
77
- else {
78
- this.diagnostics.push(Object.assign(Object.assign({}, DiagnosticMessages_1.DiagnosticMessages.unknownDiagnosticCode(codeInt)), { file: this.file, range: codeToken.range }));
106
+ }
107
+ else {
108
+ //'enable' with specific codes does the opposite of the disable branch above
109
+ for (const code of codes) {
110
+ if (allSuppressed) {
111
+ carveOuts.add(code);
112
+ }
113
+ else {
114
+ carveOuts.delete(code);
115
+ }
79
116
  }
80
117
  }
81
- if (codes.length > 0) {
82
- commentFlag = {
118
+ //affectedRange runs from the line after this directive to just before the next block directive (or EOF)
119
+ const next = this.blockDirectives[i + 1];
120
+ const startLine = directive.range.start.line + 1;
121
+ const endLine = next ? next.range.start.line - 1 : Number.MAX_SAFE_INTEGER;
122
+ if (endLine < startLine) {
123
+ continue;
124
+ }
125
+ const affectedRange = util_1.util.createRange(startLine, 0, endLine, Number.MAX_SAFE_INTEGER);
126
+ //emit a flag only when the current state actually suppresses something
127
+ if (allSuppressed) {
128
+ this.commentFlags.push({
83
129
  file: this.file,
84
- codes: codes,
85
- range: range,
130
+ codes: null,
131
+ enableCodes: carveOuts.size > 0 ? [...carveOuts] : undefined,
132
+ range: directive.range,
86
133
  affectedRange: affectedRange
87
- };
134
+ });
135
+ }
136
+ else if (carveOuts.size > 0) {
137
+ this.commentFlags.push({
138
+ file: this.file,
139
+ codes: [...carveOuts],
140
+ range: directive.range,
141
+ affectedRange: affectedRange
142
+ });
88
143
  }
89
144
  }
90
- if (commentFlag) {
91
- this.commentFlags.push(commentFlag);
92
- //add an ignore for everything in this comment except for Unknown_diagnostic_code_1014
93
- this.commentFlags.push({
94
- affectedRange: commentFlag.range,
95
- range: commentFlag.range,
96
- codes: this.allCodesExceptIgnores,
97
- file: this.file
98
- });
145
+ }
146
+ /**
147
+ * Resolve a list of `{ code, range }` tokens into validated diagnostic codes.
148
+ * Pushes diagnostics for any unknown numeric codes. Returns `null` when no codes were specified
149
+ * (i.e. a bare `bs:disable` / `bs:enable`), and an array otherwise.
150
+ */
151
+ collectCodes(rawCodes) {
152
+ var _a, _b;
153
+ if (rawCodes.length === 0) {
154
+ return null;
99
155
  }
156
+ const codes = [];
157
+ for (const codeToken of rawCodes) {
158
+ const codeInt = parseInt(codeToken.code);
159
+ if (isNaN(codeInt)) {
160
+ //plugin-contributed or non-numeric code
161
+ codes.push((_b = (_a = codeToken.code) === null || _a === void 0 ? void 0 : _a.toString()) === null || _b === void 0 ? void 0 : _b.toLowerCase());
162
+ }
163
+ else if (this.diagnosticCodes.includes(codeInt)) {
164
+ codes.push(codeInt);
165
+ }
166
+ else {
167
+ this.diagnostics.push(Object.assign(Object.assign({}, DiagnosticMessages_1.DiagnosticMessages.unknownDiagnosticCode(codeInt)), { file: this.file, range: codeToken.range }));
168
+ }
169
+ }
170
+ return codes;
100
171
  }
101
172
  /**
102
- * Small tokenizer for bs:disable comments
173
+ * Small tokenizer for `bs:` directive comments.
103
174
  */
104
175
  tokenize(text, range) {
105
176
  let lowerText = text.toLowerCase();
@@ -113,20 +184,31 @@ class CommentFlagProcessor {
113
184
  break;
114
185
  }
115
186
  }
116
- let disableType;
117
- //trim leading/trailing whitespace
118
- let len = lowerText.length;
187
+ //trim leading whitespace
188
+ const len = lowerText.length;
119
189
  lowerText = lowerText.trimLeft();
120
190
  offset += len - lowerText.length;
191
+ //match longest-prefix first so `bs:disable-line` doesn't get parsed as `bs:disable`
192
+ let directive;
121
193
  if (lowerText.startsWith('bs:disable-line')) {
122
194
  lowerText = lowerText.substring('bs:disable-line'.length);
123
195
  offset += 'bs:disable-line'.length;
124
- disableType = 'line';
196
+ directive = 'line';
125
197
  }
126
198
  else if (lowerText.startsWith('bs:disable-next-line')) {
127
199
  lowerText = lowerText.substring('bs:disable-next-line'.length);
128
200
  offset += 'bs:disable-next-line'.length;
129
- disableType = 'next-line';
201
+ directive = 'next-line';
202
+ }
203
+ else if (lowerText.startsWith('bs:disable')) {
204
+ lowerText = lowerText.substring('bs:disable'.length);
205
+ offset += 'bs:disable'.length;
206
+ directive = 'disable';
207
+ }
208
+ else if (lowerText.startsWith('bs:enable')) {
209
+ lowerText = lowerText.substring('bs:enable'.length);
210
+ offset += 'bs:enable'.length;
211
+ directive = 'enable';
130
212
  }
131
213
  else {
132
214
  return null;
@@ -136,9 +218,9 @@ class CommentFlagProcessor {
136
218
  lowerText = lowerText.substring(1);
137
219
  offset += 1;
138
220
  }
139
- let items = this.tokenizeByWhitespace(lowerText);
140
- let codes = [];
141
- for (let item of items) {
221
+ const items = this.tokenizeByWhitespace(lowerText);
222
+ const codes = [];
223
+ for (const item of items) {
142
224
  codes.push({
143
225
  code: item.text,
144
226
  range: util_1.util.createRange(range.start.line, range.start.character + offset + item.startIndex, range.start.line, range.start.character + offset + item.startIndex + item.text.length)
@@ -146,7 +228,7 @@ class CommentFlagProcessor {
146
228
  }
147
229
  return {
148
230
  commentTokenText: commentTokenText,
149
- disableType: disableType,
231
+ directive: directive,
150
232
  codes: codes
151
233
  };
152
234
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CommentFlagProcessor.js","sourceRoot":"","sources":["../src/CommentFlagProcessor.ts"],"names":[],"mappings":";;;AACA,6DAA0D;AAE1D,iCAA8B;AAE9B,MAAa,oBAAoB;IAC7B;IACI;;OAEG;IACI,IAAa;IACpB;;OAEG;IACI,kBAAkB,EAAc;IACvC;;OAEG;IACI,kBAAkB,EAAsB;IAC/C;;OAEG;IACI,wBAAwB,EAAsB;QAZ9C,SAAI,GAAJ,IAAI,CAAS;QAIb,oBAAe,GAAf,eAAe,CAAiB;QAIhC,oBAAe,GAAf,eAAe,CAAyB;QAIxC,0BAAqB,GAArB,qBAAqB,CAAyB;QAOzD;;WAEG;QACI,iBAAY,GAAG,EAAmB,CAAC;QAE1C;;WAEG;QACI,gBAAW,GAAG,EAAoB,CAAC;QAZtC,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3G,CAAC;IAiBM,MAAM,CAAC,IAAY,EAAE,KAAY;;QACpC,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,SAAS,EAAE;YACZ,OAAO;SACV;QAED,IAAI,aAAoB,CAAC;QACzB,IAAI,SAAS,CAAC,WAAW,KAAK,MAAM,EAAE;YAClC,aAAa,GAAG,WAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;SAClG;aAAM;YACH,4CAA4C;YAC5C,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