utils/node_modules/@microsoft/api-extractor/lib/collector/MessageRouter.js.map
2024-02-07 01:33:07 -05:00

1 line
35 KiB
Plaintext

{"version":3,"file":"MessageRouter.js","sourceRoot":"","sources":["../../src/collector/MessageRouter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,oDAA4B;AAC5B,+CAAiC;AAEjC,oEAAmE;AAEnE,+DAA4D;AAE5D,8DAKiC;AACjC,kEAA4F;AA4B5F,MAAa,aAAa;IA0CxB,YAAmB,OAA8B;QAzBjD,yEAAyE;QACjE,8BAAyB,GAAgC,IAAI,GAAG,EAA0B,CAAC;QAC3F,yBAAoB,GAAmB;YAC7C,QAAQ,qCAAwB;YAChC,kBAAkB,EAAE,KAAK;SAC1B,CAAC;QACM,0BAAqB,GAAmB;YAC9C,QAAQ,qCAAwB;YAChC,kBAAkB,EAAE,KAAK;SAC1B,CAAC;QACM,sBAAiB,GAAmB,EAAE,QAAQ,qCAAwB,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;QAErG,eAAU,GAAW,CAAC,CAAC;QACvB,iBAAY,GAAW,CAAC,CAAC;QAa9B,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;QAC1D,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;QAEhD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,oCAAoC,GAAG,IAAI,GAAG,EAAsC,CAAC;QAC1F,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;QAC1C,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QAEtD,8CAA8C;QAC9C,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,IAAI,OAAO,CAAC,eAAe,CAAC;QAClF,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAE/C,IAA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IAAY,CAAC;YACjB,0BAA0B;YAC1B,IAAI,GAAG,wBAAI,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC;YAC/D,IAAI,IAAI,KAAK,CAAC,EAAE;gBACd,OAAO,IAAI,CAAC;aACb;YACD,2BAA2B;YAC3B,IAAI,GAAG,wBAAI,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC;YAC/D,IAAI,IAAI,KAAK,CAAC,EAAE;gBACd,OAAO,IAAI,CAAC;aACb;YACD,yBAAyB;YACzB,OAAO,wBAAI,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC;;AAnmBsB,8BAAgB,GACrC,8DAA8D,AADzB,CAC0B;AAFtD,sCAAa","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport colors from 'colors';\nimport * as ts from 'typescript';\nimport type * as tsdoc from '@microsoft/tsdoc';\nimport { Sort, InternalError } from '@rushstack/node-core-library';\n\nimport { AstDeclaration } from '../analyzer/AstDeclaration';\nimport type { AstSymbol } from '../analyzer/AstSymbol';\nimport {\n ExtractorMessage,\n ExtractorMessageCategory,\n type IExtractorMessageOptions,\n type IExtractorMessageProperties\n} from '../api/ExtractorMessage';\nimport { type ExtractorMessageId, allExtractorMessageIds } from '../api/ExtractorMessageId';\nimport type { IExtractorMessagesConfig, IConfigMessageReportingRule } from '../api/IConfigFile';\nimport type { ISourceLocation, SourceMapper } from './SourceMapper';\nimport { ExtractorLogLevel } from '../api/ExtractorLogLevel';\nimport { ConsoleMessageId } from '../api/ConsoleMessageId';\n\ninterface IReportingRule {\n logLevel: ExtractorLogLevel;\n addToApiReportFile: boolean;\n}\n\nexport interface IMessageRouterOptions {\n workingPackageFolder: string | undefined;\n messageCallback: ((message: ExtractorMessage) => void) | undefined;\n messagesConfig: IExtractorMessagesConfig;\n showVerboseMessages: boolean;\n showDiagnostics: boolean;\n tsdocConfiguration: tsdoc.TSDocConfiguration;\n sourceMapper: SourceMapper;\n}\n\nexport interface IBuildJsonDumpObjectOptions {\n /**\n * {@link MessageRouter.buildJsonDumpObject} will omit any objects keys with these names.\n */\n keyNamesToOmit?: string[];\n}\n\nexport class MessageRouter {\n public static readonly DIAGNOSTICS_LINE: string =\n '============================================================';\n\n private readonly _workingPackageFolder: string | undefined;\n private readonly _messageCallback: ((message: ExtractorMessage) => void) | undefined;\n\n // All messages\n private readonly _messages: ExtractorMessage[];\n\n // For each AstDeclaration, the messages associated with it. This is used when addToApiReportFile=true\n private readonly _associatedMessagesForAstDeclaration: Map<AstDeclaration, ExtractorMessage[]>;\n\n private readonly _sourceMapper: SourceMapper;\n\n private readonly _tsdocConfiguration: tsdoc.TSDocConfiguration;\n\n // Normalized representation of the routing rules from api-extractor.json\n private _reportingRuleByMessageId: Map<string, IReportingRule> = new Map<string, IReportingRule>();\n private _compilerDefaultRule: IReportingRule = {\n logLevel: ExtractorLogLevel.None,\n addToApiReportFile: false\n };\n private _extractorDefaultRule: IReportingRule = {\n logLevel: ExtractorLogLevel.None,\n addToApiReportFile: false\n };\n private _tsdocDefaultRule: IReportingRule = { logLevel: ExtractorLogLevel.None, addToApiReportFile: false };\n\n public errorCount: number = 0;\n public warningCount: number = 0;\n\n /**\n * See {@link IExtractorInvokeOptions.showVerboseMessages}\n */\n public readonly showVerboseMessages: boolean;\n\n /**\n * See {@link IExtractorInvokeOptions.showDiagnostics}\n */\n public readonly showDiagnostics: boolean;\n\n public constructor(options: IMessageRouterOptions) {\n this._workingPackageFolder = options.workingPackageFolder;\n this._messageCallback = options.messageCallback;\n\n this._messages = [];\n this._associatedMessagesForAstDeclaration = new Map<AstDeclaration, ExtractorMessage[]>();\n this._sourceMapper = options.sourceMapper;\n this._tsdocConfiguration = options.tsdocConfiguration;\n\n // showDiagnostics implies showVerboseMessages\n this.showVerboseMessages = options.showVerboseMessages || options.showDiagnostics;\n this.showDiagnostics = options.showDiagnostics;\n\n this._applyMessagesConfig(options.messagesConfig);\n }\n\n /**\n * Read the api-extractor.json configuration and build up the tables of routing rules.\n */\n private _applyMessagesConfig(messagesConfig: IExtractorMessagesConfig): void {\n if (messagesConfig.compilerMessageReporting) {\n for (const messageId of Object.getOwnPropertyNames(messagesConfig.compilerMessageReporting)) {\n const reportingRule: IReportingRule = MessageRouter._getNormalizedRule(\n messagesConfig.compilerMessageReporting[messageId]\n );\n\n if (messageId === 'default') {\n this._compilerDefaultRule = reportingRule;\n } else if (!/^TS[0-9]+$/.test(messageId)) {\n throw new Error(\n `Error in API Extractor config: The messages.compilerMessageReporting table contains` +\n ` an invalid entry \"${messageId}\". The identifier format is \"TS\" followed by an integer.`\n );\n } else {\n this._reportingRuleByMessageId.set(messageId, reportingRule);\n }\n }\n }\n\n if (messagesConfig.extractorMessageReporting) {\n for (const messageId of Object.getOwnPropertyNames(messagesConfig.extractorMessageReporting)) {\n const reportingRule: IReportingRule = MessageRouter._getNormalizedRule(\n messagesConfig.extractorMessageReporting[messageId]\n );\n\n if (messageId === 'default') {\n this._extractorDefaultRule = reportingRule;\n } else if (!/^ae-/.test(messageId)) {\n throw new Error(\n `Error in API Extractor config: The messages.extractorMessageReporting table contains` +\n ` an invalid entry \"${messageId}\". The name should begin with the \"ae-\" prefix.`\n );\n } else if (!allExtractorMessageIds.has(messageId)) {\n throw new Error(\n `Error in API Extractor config: The messages.extractorMessageReporting table contains` +\n ` an unrecognized identifier \"${messageId}\". Is it spelled correctly?`\n );\n } else {\n this._reportingRuleByMessageId.set(messageId, reportingRule);\n }\n }\n }\n\n if (messagesConfig.tsdocMessageReporting) {\n for (const messageId of Object.getOwnPropertyNames(messagesConfig.tsdocMessageReporting)) {\n const reportingRule: IReportingRule = MessageRouter._getNormalizedRule(\n messagesConfig.tsdocMessageReporting[messageId]\n );\n\n if (messageId === 'default') {\n this._tsdocDefaultRule = reportingRule;\n } else if (!/^tsdoc-/.test(messageId)) {\n throw new Error(\n `Error in API Extractor config: The messages.tsdocMessageReporting table contains` +\n ` an invalid entry \"${messageId}\". The name should begin with the \"tsdoc-\" prefix.`\n );\n } else if (!this._tsdocConfiguration.isKnownMessageId(messageId)) {\n throw new Error(\n `Error in API Extractor config: The messages.tsdocMessageReporting table contains` +\n ` an unrecognized identifier \"${messageId}\". Is it spelled correctly?`\n );\n } else {\n this._reportingRuleByMessageId.set(messageId, reportingRule);\n }\n }\n }\n }\n\n private static _getNormalizedRule(rule: IConfigMessageReportingRule): IReportingRule {\n return {\n logLevel: rule.logLevel || 'none',\n addToApiReportFile: rule.addToApiReportFile || false\n };\n }\n\n public get messages(): ReadonlyArray<ExtractorMessage> {\n return this._messages;\n }\n\n /**\n * Add a diagnostic message reported by the TypeScript compiler\n */\n public addCompilerDiagnostic(diagnostic: ts.Diagnostic): void {\n switch (diagnostic.category) {\n case ts.DiagnosticCategory.Suggestion:\n case ts.DiagnosticCategory.Message:\n return; // ignore noise\n }\n\n const messageText: string = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\\n');\n const options: IExtractorMessageOptions = {\n category: ExtractorMessageCategory.Compiler,\n messageId: `TS${diagnostic.code}`,\n text: messageText\n };\n\n if (diagnostic.file) {\n // NOTE: Since compiler errors pertain to issues specific to the .d.ts files,\n // we do not apply source mappings for them.\n const sourceFile: ts.SourceFile = diagnostic.file;\n const sourceLocation: ISourceLocation = this._sourceMapper.getSourceLocation({\n sourceFile,\n pos: diagnostic.start || 0,\n useDtsLocation: true\n });\n options.sourceFilePath = sourceLocation.sourceFilePath;\n options.sourceFileLine = sourceLocation.sourceFileLine;\n options.sourceFileColumn = sourceLocation.sourceFileColumn;\n }\n\n this._messages.push(new ExtractorMessage(options));\n }\n\n /**\n * Add a message from the API Extractor analysis\n */\n public addAnalyzerIssue(\n messageId: ExtractorMessageId,\n messageText: string,\n astDeclarationOrSymbol: AstDeclaration | AstSymbol,\n properties?: IExtractorMessageProperties\n ): void {\n let astDeclaration: AstDeclaration;\n if (astDeclarationOrSymbol instanceof AstDeclaration) {\n astDeclaration = astDeclarationOrSymbol;\n } else {\n astDeclaration = astDeclarationOrSymbol.astDeclarations[0];\n }\n\n const extractorMessage: ExtractorMessage = this.addAnalyzerIssueForPosition(\n messageId,\n messageText,\n astDeclaration.declaration.getSourceFile(),\n astDeclaration.declaration.getStart(),\n properties\n );\n\n this._associateMessageWithAstDeclaration(extractorMessage, astDeclaration);\n }\n\n /**\n * Add all messages produced from an invocation of the TSDoc parser, assuming they refer to\n * code in the specified source file.\n */\n public addTsdocMessages(\n parserContext: tsdoc.ParserContext,\n sourceFile: ts.SourceFile,\n astDeclaration?: AstDeclaration\n ): void {\n for (const message of parserContext.log.messages) {\n const options: IExtractorMessageOptions = {\n category: ExtractorMessageCategory.TSDoc,\n messageId: message.messageId,\n text: message.unformattedText\n };\n\n const sourceLocation: ISourceLocation = this._sourceMapper.getSourceLocation({\n sourceFile,\n pos: message.textRange.pos\n });\n options.sourceFilePath = sourceLocation.sourceFilePath;\n options.sourceFileLine = sourceLocation.sourceFileLine;\n options.sourceFileColumn = sourceLocation.sourceFileColumn;\n\n const extractorMessage: ExtractorMessage = new ExtractorMessage(options);\n\n if (astDeclaration) {\n this._associateMessageWithAstDeclaration(extractorMessage, astDeclaration);\n }\n\n this._messages.push(extractorMessage);\n }\n }\n\n /**\n * Recursively collects the primitive members (numbers, strings, arrays, etc) into an object that\n * is JSON serializable. This is used by the \"--diagnostics\" feature to dump the state of configuration objects.\n *\n * @returns a JSON serializable object (possibly including `null` values)\n * or `undefined` if the input cannot be represented as JSON\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public static buildJsonDumpObject(input: any, options?: IBuildJsonDumpObjectOptions): any | undefined {\n if (!options) {\n options = {};\n }\n\n const keyNamesToOmit: Set<string> = new Set(options.keyNamesToOmit);\n\n return MessageRouter._buildJsonDumpObject(input, keyNamesToOmit);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private static _buildJsonDumpObject(input: any, keyNamesToOmit: Set<string>): any | undefined {\n if (input === null || input === undefined) {\n return null; // JSON uses null instead of undefined\n }\n\n switch (typeof input) {\n case 'boolean':\n case 'number':\n case 'string':\n return input;\n case 'object':\n if (Array.isArray(input)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const outputArray: any[] = [];\n for (const element of input) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const serializedElement: any = MessageRouter._buildJsonDumpObject(element, keyNamesToOmit);\n if (serializedElement !== undefined) {\n outputArray.push(serializedElement);\n }\n }\n return outputArray;\n }\n\n const outputObject: object = {};\n for (const key of Object.getOwnPropertyNames(input)) {\n if (keyNamesToOmit.has(key)) {\n continue;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const value: any = input[key];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const serializedValue: any = MessageRouter._buildJsonDumpObject(value, keyNamesToOmit);\n\n if (serializedValue !== undefined) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (outputObject as any)[key] = serializedValue;\n }\n }\n return outputObject;\n }\n\n return undefined;\n }\n\n /**\n * Record this message in _associatedMessagesForAstDeclaration\n */\n private _associateMessageWithAstDeclaration(\n extractorMessage: ExtractorMessage,\n astDeclaration: AstDeclaration\n ): void {\n let associatedMessages: ExtractorMessage[] | undefined =\n this._associatedMessagesForAstDeclaration.get(astDeclaration);\n\n if (!associatedMessages) {\n associatedMessages = [];\n this._associatedMessagesForAstDeclaration.set(astDeclaration, associatedMessages);\n }\n associatedMessages.push(extractorMessage);\n }\n\n /**\n * Add a message for a location in an arbitrary source file.\n */\n public addAnalyzerIssueForPosition(\n messageId: ExtractorMessageId,\n messageText: string,\n sourceFile: ts.SourceFile,\n pos: number,\n properties?: IExtractorMessageProperties\n ): ExtractorMessage {\n const options: IExtractorMessageOptions = {\n category: ExtractorMessageCategory.Extractor,\n messageId,\n text: messageText,\n properties\n };\n\n const sourceLocation: ISourceLocation = this._sourceMapper.getSourceLocation({\n sourceFile,\n pos\n });\n options.sourceFilePath = sourceLocation.sourceFilePath;\n options.sourceFileLine = sourceLocation.sourceFileLine;\n options.sourceFileColumn = sourceLocation.sourceFileColumn;\n\n const extractorMessage: ExtractorMessage = new ExtractorMessage(options);\n\n this._messages.push(extractorMessage);\n return extractorMessage;\n }\n\n /**\n * This is used when writing the API report file. It looks up any messages that were configured to get emitted\n * in the API report file and returns them. It also records that they were emitted, which suppresses them from\n * being shown on the console.\n */\n public fetchAssociatedMessagesForReviewFile(astDeclaration: AstDeclaration): ExtractorMessage[] {\n const messagesForApiReportFile: ExtractorMessage[] = [];\n\n const associatedMessages: ExtractorMessage[] =\n this._associatedMessagesForAstDeclaration.get(astDeclaration) || [];\n for (const associatedMessage of associatedMessages) {\n // Make sure we didn't already report this message for some reason\n if (!associatedMessage.handled) {\n // Is this message type configured to go in the API report file?\n const reportingRule: IReportingRule = this._getRuleForMessage(associatedMessage);\n if (reportingRule.addToApiReportFile) {\n // Include it in the result, and record that it went to the API report file\n messagesForApiReportFile.push(associatedMessage);\n associatedMessage.handled = true;\n }\n }\n }\n\n this._sortMessagesForOutput(messagesForApiReportFile);\n return messagesForApiReportFile;\n }\n\n /**\n * This returns all remaining messages that were flagged with `addToApiReportFile`, but which were not\n * retreieved using `fetchAssociatedMessagesForReviewFile()`.\n */\n public fetchUnassociatedMessagesForReviewFile(): ExtractorMessage[] {\n const messagesForApiReportFile: ExtractorMessage[] = [];\n\n for (const unassociatedMessage of this.messages) {\n // Make sure we didn't already report this message for some reason\n if (!unassociatedMessage.handled) {\n // Is this message type configured to go in the API report file?\n const reportingRule: IReportingRule = this._getRuleForMessage(unassociatedMessage);\n if (reportingRule.addToApiReportFile) {\n // Include it in the result, and record that it went to the API report file\n messagesForApiReportFile.push(unassociatedMessage);\n unassociatedMessage.handled = true;\n }\n }\n }\n\n this._sortMessagesForOutput(messagesForApiReportFile);\n return messagesForApiReportFile;\n }\n\n /**\n * This returns the list of remaining messages that were not already processed by\n * `fetchAssociatedMessagesForReviewFile()` or `fetchUnassociatedMessagesForReviewFile()`.\n * These messages will be shown on the console.\n */\n public handleRemainingNonConsoleMessages(): void {\n const messagesForLogger: ExtractorMessage[] = [];\n\n for (const message of this.messages) {\n // Make sure we didn't already report this message\n if (!message.handled) {\n messagesForLogger.push(message);\n }\n }\n\n this._sortMessagesForOutput(messagesForLogger);\n\n for (const message of messagesForLogger) {\n this._handleMessage(message);\n }\n }\n\n public logError(\n messageId: ConsoleMessageId,\n message: string,\n properties?: IExtractorMessageProperties\n ): void {\n this._handleMessage(\n new ExtractorMessage({\n category: ExtractorMessageCategory.Console,\n messageId,\n text: message,\n properties,\n logLevel: ExtractorLogLevel.Error\n })\n );\n }\n\n public logWarning(\n messageId: ConsoleMessageId,\n message: string,\n properties?: IExtractorMessageProperties\n ): void {\n this._handleMessage(\n new ExtractorMessage({\n category: ExtractorMessageCategory.Console,\n messageId,\n text: message,\n properties,\n logLevel: ExtractorLogLevel.Warning\n })\n );\n }\n\n public logInfo(\n messageId: ConsoleMessageId,\n message: string,\n properties?: IExtractorMessageProperties\n ): void {\n this._handleMessage(\n new ExtractorMessage({\n category: ExtractorMessageCategory.Console,\n messageId,\n text: message,\n properties,\n logLevel: ExtractorLogLevel.Info\n })\n );\n }\n\n public logVerbose(\n messageId: ConsoleMessageId,\n message: string,\n properties?: IExtractorMessageProperties\n ): void {\n this._handleMessage(\n new ExtractorMessage({\n category: ExtractorMessageCategory.Console,\n messageId,\n text: message,\n properties,\n logLevel: ExtractorLogLevel.Verbose\n })\n );\n }\n\n public logDiagnosticHeader(title: string): void {\n this.logDiagnostic(MessageRouter.DIAGNOSTICS_LINE);\n this.logDiagnostic(`DIAGNOSTIC: ` + title);\n this.logDiagnostic(MessageRouter.DIAGNOSTICS_LINE);\n }\n\n public logDiagnosticFooter(): void {\n this.logDiagnostic(MessageRouter.DIAGNOSTICS_LINE + '\\n');\n }\n\n public logDiagnostic(message: string): void {\n if (this.showDiagnostics) {\n this.logVerbose(ConsoleMessageId.Diagnostics, message);\n }\n }\n\n /**\n * Give the calling application a chance to handle the `ExtractorMessage`, and if not, display it on the console.\n */\n private _handleMessage(message: ExtractorMessage): void {\n // Don't tally messages that were already \"handled\" by writing them into the API report\n if (message.handled) {\n return;\n }\n\n // Assign the ExtractorMessage.logLevel; the message callback may adjust it below\n if (message.category === ExtractorMessageCategory.Console) {\n // Console messages have their category log level assigned via logInfo(), logVerbose(), etc.\n } else {\n const reportingRule: IReportingRule = this._getRuleForMessage(message);\n message.logLevel = reportingRule.logLevel;\n }\n\n // If there is a callback, allow it to modify and/or handle the message\n if (this._messageCallback) {\n this._messageCallback(message);\n }\n\n // Update the statistics\n switch (message.logLevel) {\n case ExtractorLogLevel.Error:\n ++this.errorCount;\n break;\n case ExtractorLogLevel.Warning:\n ++this.warningCount;\n break;\n }\n\n if (message.handled) {\n return;\n }\n\n // The messageCallback did not handle the message, so perform default handling\n message.handled = true;\n\n if (message.logLevel === ExtractorLogLevel.None) {\n return;\n }\n\n let messageText: string;\n if (message.category === ExtractorMessageCategory.Console) {\n messageText = message.text;\n } else {\n messageText = message.formatMessageWithLocation(this._workingPackageFolder);\n }\n\n switch (message.logLevel) {\n case ExtractorLogLevel.Error:\n console.error(colors.red('Error: ' + messageText));\n break;\n case ExtractorLogLevel.Warning:\n console.warn(colors.yellow('Warning: ' + messageText));\n break;\n case ExtractorLogLevel.Info:\n console.log(messageText);\n break;\n case ExtractorLogLevel.Verbose:\n if (this.showVerboseMessages) {\n console.log(colors.cyan(messageText));\n }\n break;\n default:\n throw new Error(`Invalid logLevel value: ${JSON.stringify(message.logLevel)}`);\n }\n }\n\n /**\n * For a given message, determine the IReportingRule based on the rule tables.\n */\n private _getRuleForMessage(message: ExtractorMessage): IReportingRule {\n const reportingRule: IReportingRule | undefined = this._reportingRuleByMessageId.get(message.messageId);\n if (reportingRule) {\n return reportingRule;\n }\n switch (message.category) {\n case ExtractorMessageCategory.Compiler:\n return this._compilerDefaultRule;\n case ExtractorMessageCategory.Extractor:\n return this._extractorDefaultRule;\n case ExtractorMessageCategory.TSDoc:\n return this._tsdocDefaultRule;\n case ExtractorMessageCategory.Console:\n throw new InternalError('ExtractorMessageCategory.Console is not supported with IReportingRule');\n }\n }\n\n /**\n * Sorts an array of messages according to a reasonable ordering\n */\n private _sortMessagesForOutput(messages: ExtractorMessage[]): void {\n messages.sort((a, b) => {\n let diff: number;\n // First sort by file name\n diff = Sort.compareByValue(a.sourceFilePath, b.sourceFilePath);\n if (diff !== 0) {\n return diff;\n }\n // Then sort by line number\n diff = Sort.compareByValue(a.sourceFileLine, b.sourceFileLine);\n if (diff !== 0) {\n return diff;\n }\n // Then sort by messageId\n return Sort.compareByValue(a.messageId, b.messageId);\n });\n }\n}\n"]}