File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { TSDocTagDefinition } from './TSDocTagDefinition';
3
3
import { TSDocValidationConfiguration } from './TSDocValidationConfiguration' ;
4
4
import { DocNodeManager } from './DocNodeManager' ;
5
5
import { BuiltInDocNodes } from '../nodes/BuiltInDocNodes' ;
6
- import { TSDocMessageId , allTsdocMessageIds } from '../parser/TSDocMessageId' ;
6
+ import { TSDocMessageId , allTsdocMessageIds , allTsdocMessageIdsSet } from '../parser/TSDocMessageId' ;
7
7
8
8
/**
9
9
* Configuration for the TSDocParser.
@@ -170,7 +170,19 @@ export class TSDocConfiguration {
170
170
* of the TSDoc parser, we may provide a way to register custom message identifiers.
171
171
*/
172
172
public isKnownMessageId ( messageId : TSDocMessageId | string ) : boolean {
173
- return allTsdocMessageIds . has ( messageId ) ;
173
+ return allTsdocMessageIdsSet . has ( messageId ) ;
174
+ }
175
+
176
+ /**
177
+ * Returns the list of {@link TSDocMessageId} strings that are implemented by this release of the TSDoc parser.
178
+ *
179
+ * @privateRemarks
180
+ *
181
+ * Why this API is associated with TSDocConfiguration: In the future, if we enable support for custom extensions
182
+ * of the TSDoc parser, we may provide a way to register custom message identifiers.
183
+ */
184
+ public get allTsdocMessageIds ( ) : ReadonlyArray < TSDocMessageId > {
185
+ return allTsdocMessageIds as ReadonlyArray < TSDocMessageId > ;
174
186
}
175
187
176
188
private _requireTagToBeDefined ( tagDefinition : TSDocTagDefinition ) : void {
Original file line number Diff line number Diff line change @@ -336,8 +336,8 @@ export const enum TSDocMessageId {
336
336
CodeSpanMissingDelimiter = 'tsdoc-code-span-missing-delimiter'
337
337
}
338
338
339
- // Exposed via ParserMessage.isValidMessageId ()
340
- export const allTsdocMessageIds : Set < string > = new Set < string > ( [
339
+ // Exposed via TSDocConfiguration.allTsdocMessageIds ()
340
+ export const allTsdocMessageIds : string [ ] = [
341
341
'tsdoc-comment-not-found' ,
342
342
'tsdoc-comment-missing-opening-delimiter' ,
343
343
'tsdoc-comment-missing-closing-delimiter' ,
@@ -398,4 +398,7 @@ export const allTsdocMessageIds: Set<string> = new Set<string>([
398
398
'tsdoc-code-fence-closing-syntax' ,
399
399
'tsdoc-code-span-empty' ,
400
400
'tsdoc-code-span-missing-delimiter'
401
- ] ) ;
401
+ ] ;
402
+ allTsdocMessageIds . sort ( ) ;
403
+
404
+ export const allTsdocMessageIdsSet : ReadonlySet < string > = new Set < string > ( allTsdocMessageIds ) ;
You can’t perform that action at this time.
0 commit comments