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Message,\r\n TextRange,\r\n IParserMessageParameters,\r\n ITSDocTagDefinitionParameters,\r\n} from '@microsoft/tsdoc';\r\nimport * as fs from 'fs';\r\nimport * as resolve from 'resolve';\r\nimport * as path from 'path';\r\nimport Ajv from 'ajv';\r\nimport * as jju from 'jju';\r\n\r\nconst ajv: Ajv.Ajv = new Ajv({ verbose: true });\r\n\r\nfunction initializeSchemaValidator(): Ajv.ValidateFunction {\r\n const jsonSchemaPath: string = resolve.sync('@microsoft/tsdoc/schemas/tsdoc.schema.json', { basedir: __dirname });\r\n const jsonSchemaContent: string = fs.readFileSync(jsonSchemaPath).toString();\r\n const jsonSchema: object = jju.parse(jsonSchemaContent, { mode: 'cjson' });\r\n return ajv.compile(jsonSchema);\r\n}\r\n\r\n// Warning: AJV has a fairly strange API. Each time this function is called, the function object's\r\n// properties get overwritten with the results of the latest validation. Thus we need to be careful\r\n// to read the properties before a subsequent call may occur.\r\nconst tsdocSchemaValidator: Ajv.ValidateFunction = initializeSchemaValidator();\r\n\r\ninterface ITagConfigJson {\r\n tagName: string;\r\n syntaxKind: 'inline' | 'block' | 'modifier';\r\n allowMultiple?: boolean;\r\n}\r\n\r\ninterface IConfigJson {\r\n $schema: string;\r\n extends?: string[];\r\n noStandardTags?: boolean;\r\n tagDefinitions?: ITagConfigJson[];\r\n supportForTags?: { [tagName: string]: boolean };\r\n supportedHtmlElements?: string[];\r\n reportUnsupportedHtmlElements?: boolean;\r\n}\r\n\r\n/**\r\n * Represents an individual `tsdoc.json` file.\r\n *\r\n * @public\r\n */\r\nexport class TSDocConfigFile {\r\n public static readonly FILENAME: string = 'tsdoc.json';\r\n public static readonly CURRENT_SCHEMA_URL: string =\r\n 'https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json';\r\n\r\n /**\r\n * A queryable log that reports warnings and error messages that occurred during parsing.\r\n */\r\n public readonly log: ParserMessageLog;\r\n\r\n private readonly _extendsFiles: TSDocConfigFile[];\r\n private _filePath: string;\r\n private _fileNotFound: boolean;\r\n private _fileMTime: number;\r\n private _hasErrors: boolean;\r\n private _tsdocSchema: string;\r\n private readonly _extendsPaths: string[];\r\n private _noStandardTags: boolean | undefined;\r\n private readonly _tagDefinitions: TSDocTagDefinition[];\r\n private readonly _tagDefinitionNames: Set;\r\n private readonly _supportForTags: Map;\r\n private _supportedHtmlElements: Set | undefined;\r\n private _reportUnsupportedHtmlElements: boolean | undefined;\r\n\r\n private constructor() {\r\n this.log = new ParserMessageLog();\r\n\r\n this._extendsFiles = [];\r\n this._filePath = '';\r\n this._fileNotFound = false;\r\n this._hasErrors = false;\r\n this._fileMTime = 0;\r\n this._tsdocSchema = '';\r\n this._extendsPaths = [];\r\n this._noStandardTags = undefined;\r\n this._tagDefinitions = [];\r\n this._tagDefinitionNames = new Set();\r\n this._supportForTags = new Map();\r\n }\r\n\r\n /**\r\n * Other config files that this file extends from.\r\n */\r\n public get extendsFiles(): ReadonlyArray {\r\n return this._extendsFiles;\r\n }\r\n\r\n /**\r\n * The full path of the file that was attempted to load, or an empty string if the configuration was\r\n * loaded from a source that is not a file.\r\n */\r\n public get filePath(): string {\r\n return this._filePath;\r\n }\r\n\r\n /**\r\n * If true, then the TSDocConfigFile object contains an empty state, because the `tsdoc.json` file\r\n * was not found by the loader.\r\n *\r\n * @remarks\r\n * A missing \"tsdoc.json\" file is not considered an error. It simply means that the defaults will be used.\r\n */\r\n public get fileNotFound(): boolean {\r\n return this._fileNotFound;\r\n }\r\n\r\n /**\r\n * If true, then at least one error was encountered while loading this file or one of its \"extends\" files.\r\n *\r\n * @remarks\r\n * You can use {@link TSDocConfigFile.getErrorSummary} to report these errors.\r\n *\r\n * The individual messages can be retrieved from the {@link TSDocConfigFile.log} property of each `TSDocConfigFile`\r\n * object (including the {@link TSDocConfigFile.extendsFiles} tree).\r\n */\r\n public get hasErrors(): boolean {\r\n return this._hasErrors;\r\n }\r\n\r\n /**\r\n * The `$schema` field from the `tsdoc.json` file.\r\n */\r\n public get tsdocSchema(): string {\r\n return this._tsdocSchema;\r\n }\r\n\r\n /**\r\n * The `extends` field from the `tsdoc.json` file. For the parsed file contents,\r\n * use the `extendsFiles` property instead.\r\n */\r\n public get extendsPaths(): ReadonlyArray {\r\n return this._extendsPaths;\r\n }\r\n\r\n /**\r\n * By default, the config file loader will predefine all of the standardized TSDoc tags. To disable this and\r\n * start with a completely empty configuration, set `noStandardTags` to true.\r\n *\r\n * @remarks\r\n * If a config file uses `\"extends\"` to include settings from base config files, then its setting will\r\n * override any settings from the base config files. If `\"noStandardTags\"` is not specified, then this\r\n * property will be `undefined`. The config files are applied in the order they are processed (a depth-first\r\n * traversal of the `\"extends\"` references), and files processed later can override earlier files.\r\n * If no config file specifies `noStandardTags` then the default value is `false`.\r\n */\r\n public get noStandardTags(): boolean | undefined {\r\n return this._noStandardTags;\r\n }\r\n\r\n public set noStandardTags(value: boolean | undefined) {\r\n this._noStandardTags = value;\r\n }\r\n\r\n public get tagDefinitions(): ReadonlyArray {\r\n return this._tagDefinitions;\r\n }\r\n\r\n public get supportForTags(): ReadonlyMap {\r\n return this._supportForTags;\r\n }\r\n\r\n public get supportedHtmlElements(): ReadonlyArray | undefined {\r\n return this._supportedHtmlElements && Array.from(this._supportedHtmlElements);\r\n }\r\n\r\n public get reportUnsupportedHtmlElements(): boolean | undefined {\r\n return this._reportUnsupportedHtmlElements;\r\n }\r\n\r\n public set reportUnsupportedHtmlElements(value: boolean | undefined) {\r\n this._reportUnsupportedHtmlElements = value;\r\n }\r\n\r\n /**\r\n * Removes all items from the `tagDefinitions` array.\r\n */\r\n public clearTagDefinitions(): void {\r\n this._tagDefinitions.length = 0;\r\n this._tagDefinitionNames.clear();\r\n }\r\n\r\n /**\r\n * Adds a new item to the `tagDefinitions` array.\r\n */\r\n public addTagDefinition(parameters: ITSDocTagDefinitionParameters): void {\r\n // This validates the tag name\r\n const tagDefinition: TSDocTagDefinition = new TSDocTagDefinition(parameters);\r\n\r\n if (this._tagDefinitionNames.has(tagDefinition.tagNameWithUpperCase)) {\r\n throw new Error(`A tag definition was already added with the tag name \"${parameters.tagName}\"`);\r\n }\r\n this._tagDefinitionNames.add(tagDefinition.tagName);\r\n\r\n this._tagDefinitions.push(tagDefinition);\r\n }\r\n\r\n // Similar to addTagDefinition() but reports errors using _reportError()\r\n private _addTagDefinitionForLoad(parameters: ITSDocTagDefinitionParameters): void {\r\n let tagDefinition: TSDocTagDefinition;\r\n try {\r\n // This validates the tag name\r\n tagDefinition = new TSDocTagDefinition(parameters);\r\n } catch (error) {\r\n this._reportError({\r\n messageId: TSDocMessageId.ConfigFileInvalidTagName,\r\n messageText: error.message,\r\n textRange: TextRange.empty,\r\n });\r\n return;\r\n }\r\n\r\n if (this._tagDefinitionNames.has(tagDefinition.tagNameWithUpperCase)) {\r\n this._reportError({\r\n messageId: TSDocMessageId.ConfigFileDuplicateTagName,\r\n messageText: `The \"tagDefinitions\" field specifies more than one tag with the name \"${parameters.tagName}\"`,\r\n textRange: TextRange.empty,\r\n });\r\n }\r\n this._tagDefinitionNames.add(tagDefinition.tagNameWithUpperCase);\r\n\r\n this._tagDefinitions.push(tagDefinition);\r\n }\r\n\r\n /**\r\n * Adds a new item to the `supportedHtmlElements` array.\r\n */\r\n public addSupportedHtmlElement(htmlElement: string): void {\r\n if (!this._supportedHtmlElements) {\r\n this._supportedHtmlElements = new Set();\r\n }\r\n this._supportedHtmlElements.add(htmlElement);\r\n }\r\n\r\n /**\r\n * Removes the explicit list of allowed html elements.\r\n */\r\n public clearSupportedHtmlElements(): void {\r\n this._supportedHtmlElements = undefined;\r\n }\r\n\r\n /**\r\n * Removes all entries from the \"supportForTags\" map.\r\n */\r\n public clearSupportForTags(): void {\r\n this._supportForTags.clear();\r\n }\r\n\r\n /**\r\n * Sets an entry in the \"supportForTags\" map.\r\n */\r\n public setSupportForTag(tagName: string, supported: boolean): void {\r\n TSDocTagDefinition.validateTSDocTagName(tagName);\r\n this._supportForTags.set(tagName, supported);\r\n }\r\n\r\n /**\r\n * This can be used for cache eviction. It returns true if the modification timestamp has changed for\r\n * any of the files that were read when loading this `TSDocConfigFile`, which indicates that the file should be\r\n * reloaded. It does not consider cases where `TSDocConfigFile.fileNotFound` was `true`.\r\n *\r\n * @remarks\r\n * This can be used for cache eviction. An example eviction strategy might be like this:\r\n *\r\n * - call `checkForModifiedFiles()` once per second, and reload the configuration if it returns true\r\n *\r\n * - otherwise, reload the configuration when it is more than 10 seconds old (to handle less common cases such\r\n * as creation of a missing file, or creation of a file at an earlier location in the search path).\r\n */\r\n public checkForModifiedFiles(): boolean {\r\n if (this._checkForModifiedFile()) {\r\n return true;\r\n }\r\n for (const extendsFile of this.extendsFiles) {\r\n if (extendsFile.checkForModifiedFiles()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Checks the last modification time for `TSDocConfigFile.filePath` and returns `true` if it has changed\r\n * since the file was loaded. If the file is missing, this returns `false`. If the timestamp cannot be read,\r\n * then this returns `true`.\r\n */\r\n private _checkForModifiedFile(): boolean {\r\n if (this._fileNotFound || !this._filePath) {\r\n return false;\r\n }\r\n\r\n try {\r\n const mtimeMs: number = fs.statSync(this._filePath).mtimeMs;\r\n return mtimeMs !== this._fileMTime;\r\n } catch (error) {\r\n return true;\r\n }\r\n }\r\n\r\n private _reportError(parserMessageParameters: IParserMessageParameters): void {\r\n this.log.addMessage(new ParserMessage(parserMessageParameters));\r\n this._hasErrors = true;\r\n }\r\n\r\n private _loadJsonObject(configJson: IConfigJson): void {\r\n if (configJson.$schema !== TSDocConfigFile.CURRENT_SCHEMA_URL) {\r\n this._reportError({\r\n messageId: TSDocMessageId.ConfigFileUnsupportedSchema,\r\n messageText: `Unsupported JSON \"$schema\" value; expecting \"${TSDocConfigFile.CURRENT_SCHEMA_URL}\"`,\r\n textRange: TextRange.empty,\r\n });\r\n return;\r\n }\r\n\r\n const success: boolean = tsdocSchemaValidator(configJson) as boolean;\r\n\r\n if (!success) {\r\n const description: string = ajv.errorsText(tsdocSchemaValidator.errors);\r\n\r\n this._reportError({\r\n messageId: TSDocMessageId.ConfigFileSchemaError,\r\n messageText: 'Error loading config file: ' + description,\r\n textRange: TextRange.empty,\r\n });\r\n return;\r\n }\r\n\r\n this._tsdocSchema = configJson.$schema;\r\n if (configJson.extends) {\r\n this._extendsPaths.push(...configJson.extends);\r\n }\r\n\r\n this.noStandardTags = configJson.noStandardTags;\r\n\r\n for (const jsonTagDefinition of configJson.tagDefinitions || []) {\r\n let syntaxKind: TSDocTagSyntaxKind;\r\n switch (jsonTagDefinition.syntaxKind) {\r\n case 'inline':\r\n syntaxKind = TSDocTagSyntaxKind.InlineTag;\r\n break;\r\n case 'block':\r\n syntaxKind = TSDocTagSyntaxKind.BlockTag;\r\n break;\r\n case 'modifier':\r\n syntaxKind = TSDocTagSyntaxKind.ModifierTag;\r\n break;\r\n default:\r\n // The JSON schema should have caught this error\r\n throw new Error('Unexpected tag kind');\r\n }\r\n\r\n this._addTagDefinitionForLoad({\r\n tagName: jsonTagDefinition.tagName,\r\n syntaxKind: syntaxKind,\r\n allowMultiple: jsonTagDefinition.allowMultiple,\r\n });\r\n }\r\n\r\n if (configJson.supportedHtmlElements) {\r\n this._supportedHtmlElements = new Set();\r\n for (const htmlElement of configJson.supportedHtmlElements) {\r\n this.addSupportedHtmlElement(htmlElement);\r\n }\r\n }\r\n\r\n this._reportUnsupportedHtmlElements = configJson.reportUnsupportedHtmlElements;\r\n\r\n if (configJson.supportForTags) {\r\n for (const tagName of Object.keys(configJson.supportForTags)) {\r\n const supported: boolean = configJson.supportForTags[tagName];\r\n\r\n this._supportForTags.set(tagName, supported);\r\n }\r\n }\r\n }\r\n\r\n private _loadWithExtends(\r\n configFilePath: string,\r\n referencingConfigFile: TSDocConfigFile | undefined,\r\n alreadyVisitedPaths: Set\r\n ): void {\r\n // In case an exception is thrown, start by assuming that the file was not found; we'll revise\r\n // this later upon success\r\n this._fileNotFound = true;\r\n\r\n if (!configFilePath) {\r\n this._reportError({\r\n messageId: TSDocMessageId.ConfigFileNotFound,\r\n messageText: 'File not found',\r\n textRange: TextRange.empty,\r\n });\r\n return;\r\n }\r\n\r\n this._filePath = path.resolve(configFilePath);\r\n\r\n if (!fs.existsSync(this._filePath)) {\r\n this._reportError({\r\n messageId: TSDocMessageId.ConfigFileNotFound,\r\n messageText: 'File not found',\r\n textRange: TextRange.empty,\r\n });\r\n return;\r\n }\r\n\r\n const configJsonContent: string = fs.readFileSync(this._filePath).toString();\r\n this._fileMTime = fs.statSync(this._filePath).mtimeMs;\r\n\r\n this._fileNotFound = false;\r\n\r\n const hashKey: string = fs.realpathSync(this._filePath);\r\n if (referencingConfigFile && alreadyVisitedPaths.has(hashKey)) {\r\n this._reportError({\r\n messageId: TSDocMessageId.ConfigFileCyclicExtends,\r\n messageText: `Circular reference encountered for \"extends\" field of \"${referencingConfigFile.filePath}\"`,\r\n textRange: TextRange.empty,\r\n });\r\n return;\r\n }\r\n alreadyVisitedPaths.add(hashKey);\r\n\r\n let configJson: IConfigJson;\r\n try {\r\n configJson = jju.parse(configJsonContent, { mode: 'cjson' });\r\n } catch (e) {\r\n this._reportError({\r\n messageId: TSDocMessageId.ConfigInvalidJson,\r\n messageText: 'Error parsing JSON input: ' + e.message,\r\n textRange: TextRange.empty,\r\n });\r\n return;\r\n }\r\n\r\n this._loadJsonObject(configJson);\r\n\r\n const configFileFolder: string = path.dirname(this.filePath);\r\n\r\n for (const extendsField of this.extendsPaths) {\r\n let resolvedExtendsPath: string;\r\n try {\r\n resolvedExtendsPath = resolve.sync(extendsField, { basedir: configFileFolder });\r\n } catch (e) {\r\n this._reportError({\r\n messageId: TSDocMessageId.ConfigFileUnresolvedExtends,\r\n messageText: `Unable to resolve \"extends\" reference to \"${extendsField}\": ` + e.message,\r\n textRange: TextRange.empty,\r\n });\r\n\r\n return;\r\n }\r\n\r\n const baseConfigFile: TSDocConfigFile = new TSDocConfigFile();\r\n\r\n baseConfigFile._loadWithExtends(resolvedExtendsPath, this, alreadyVisitedPaths);\r\n\r\n if (baseConfigFile.fileNotFound) {\r\n this._reportError({\r\n messageId: TSDocMessageId.ConfigFileUnresolvedExtends,\r\n messageText: `Unable to resolve \"extends\" reference to \"${extendsField}\"`,\r\n textRange: TextRange.empty,\r\n });\r\n }\r\n\r\n this._extendsFiles.push(baseConfigFile);\r\n\r\n if (baseConfigFile.hasErrors) {\r\n this._hasErrors = true;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * For the given folder, look for the relevant tsdoc.json file (if any), and return its path.\r\n *\r\n * @param folderPath - the path to a folder where the search should start\r\n * @returns the (possibly relative) path to tsdoc.json, or an empty string if not found\r\n */\r\n public static findConfigPathForFolder(folderPath: string): string {\r\n if (folderPath) {\r\n let foundFolder: string = folderPath;\r\n for (;;) {\r\n const tsconfigJsonPath: string = path.join(foundFolder, 'tsconfig.json');\r\n if (fs.existsSync(tsconfigJsonPath)) {\r\n // Stop when we reach a folder containing tsconfig.json\r\n return path.join(foundFolder, TSDocConfigFile.FILENAME);\r\n }\r\n const packageJsonPath: string = path.join(foundFolder, 'package.json');\r\n if (fs.existsSync(packageJsonPath)) {\r\n // Stop when we reach a folder containing package.json; this avoids crawling out of the current package\r\n return path.join(foundFolder, TSDocConfigFile.FILENAME);\r\n }\r\n\r\n const previousFolder: string = foundFolder;\r\n foundFolder = path.dirname(foundFolder);\r\n\r\n if (!foundFolder || foundFolder === previousFolder) {\r\n // Give up if we reach the filesystem root directory\r\n break;\r\n }\r\n }\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Calls `TSDocConfigFile.findConfigPathForFolder()` to find the relevant tsdoc.json config file, if one exists.\r\n * Then calls `TSDocConfigFile.findConfigPathForFolder()` to return the loaded result.\r\n *\r\n * @remarks\r\n * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check\r\n * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log},\r\n * or {@link TSDocConfigFile.getErrorSummary}.\r\n *\r\n * @param folderPath - the path to a folder where the search should start\r\n */\r\n public static loadForFolder(folderPath: string): TSDocConfigFile {\r\n const rootConfigPath: string = TSDocConfigFile.findConfigPathForFolder(folderPath);\r\n return TSDocConfigFile.loadFile(rootConfigPath);\r\n }\r\n\r\n /**\r\n * Loads the specified tsdoc.json and any base files that it refers to using the \"extends\" option.\r\n *\r\n * @remarks\r\n * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check\r\n * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log},\r\n * or {@link TSDocConfigFile.getErrorSummary}.\r\n *\r\n * @param tsdocJsonFilePath - the path to the tsdoc.json config file\r\n */\r\n public static loadFile(tsdocJsonFilePath: string): TSDocConfigFile {\r\n const configFile: TSDocConfigFile = new TSDocConfigFile();\r\n const alreadyVisitedPaths: Set = new Set();\r\n configFile._loadWithExtends(tsdocJsonFilePath, undefined, alreadyVisitedPaths);\r\n return configFile;\r\n }\r\n\r\n /**\r\n * Loads the object state from a JSON-serializable object as produced by {@link TSDocConfigFile.saveToObject}.\r\n *\r\n * @remarks\r\n * The serialized object has the same structure as `tsdoc.json`; however the `\"extends\"` field is not allowed.\r\n *\r\n * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check\r\n * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log},\r\n * or {@link TSDocConfigFile.getErrorSummary}.\r\n */\r\n public static loadFromObject(jsonObject: unknown): TSDocConfigFile {\r\n const configFile: TSDocConfigFile = new TSDocConfigFile();\r\n\r\n configFile._loadJsonObject(jsonObject as IConfigJson);\r\n\r\n if (configFile.extendsPaths.length > 0) {\r\n throw new Error('The \"extends\" field cannot be used with TSDocConfigFile.loadFromObject()');\r\n }\r\n\r\n return configFile;\r\n }\r\n\r\n /**\r\n * Initializes a TSDocConfigFile object using the state from the provided `TSDocConfiguration` object.\r\n *\r\n * @remarks\r\n * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check\r\n * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log},\r\n * or {@link TSDocConfigFile.getErrorSummary}.\r\n */\r\n public static loadFromParser(configuration: TSDocConfiguration): TSDocConfigFile {\r\n const configFile: TSDocConfigFile = new TSDocConfigFile();\r\n\r\n // The standard tags will be mixed together with custom definitions,\r\n // so set noStandardTags=true to avoid defining them twice.\r\n configFile.noStandardTags = true;\r\n\r\n for (const tagDefinition of configuration.tagDefinitions) {\r\n configFile.addTagDefinition({\r\n syntaxKind: tagDefinition.syntaxKind,\r\n tagName: tagDefinition.tagName,\r\n allowMultiple: tagDefinition.allowMultiple,\r\n });\r\n }\r\n\r\n for (const tagDefinition of configuration.supportedTagDefinitions) {\r\n configFile.setSupportForTag(tagDefinition.tagName, true);\r\n }\r\n\r\n for (const htmlElement of configuration.supportedHtmlElements) {\r\n configFile.addSupportedHtmlElement(htmlElement);\r\n }\r\n\r\n configFile.reportUnsupportedHtmlElements = configuration.validation.reportUnsupportedHtmlElements;\r\n\r\n return configFile;\r\n }\r\n\r\n /**\r\n * Writes the config file content to a JSON file with the specified file path.\r\n */\r\n public saveFile(jsonFilePath: string): void {\r\n const jsonObject: unknown = this.saveToObject();\r\n const jsonContent: string = JSON.stringify(jsonObject, undefined, 2);\r\n fs.writeFileSync(jsonFilePath, jsonContent);\r\n }\r\n\r\n /**\r\n * Writes the object state into a JSON-serializable object.\r\n */\r\n public saveToObject(): unknown {\r\n const configJson: IConfigJson = {\r\n $schema: TSDocConfigFile.CURRENT_SCHEMA_URL,\r\n };\r\n\r\n if (this.noStandardTags !== undefined) {\r\n configJson.noStandardTags = this.noStandardTags;\r\n }\r\n\r\n if (this.tagDefinitions.length > 0) {\r\n configJson.tagDefinitions = [];\r\n for (const tagDefinition of this.tagDefinitions) {\r\n configJson.tagDefinitions.push(TSDocConfigFile._serializeTagDefinition(tagDefinition));\r\n }\r\n }\r\n\r\n if (this.supportForTags.size > 0) {\r\n configJson.supportForTags = {};\r\n this.supportForTags.forEach((supported, tagName) => {\r\n configJson.supportForTags![tagName] = supported;\r\n });\r\n }\r\n\r\n if (this.supportedHtmlElements) {\r\n configJson.supportedHtmlElements = [...this.supportedHtmlElements];\r\n }\r\n\r\n if (this._reportUnsupportedHtmlElements !== undefined) {\r\n configJson.reportUnsupportedHtmlElements = this._reportUnsupportedHtmlElements;\r\n }\r\n\r\n return configJson;\r\n }\r\n\r\n private static _serializeTagDefinition(tagDefinition: TSDocTagDefinition): ITagConfigJson {\r\n let syntaxKind: 'inline' | 'block' | 'modifier' | undefined;\r\n switch (tagDefinition.syntaxKind) {\r\n case TSDocTagSyntaxKind.InlineTag:\r\n syntaxKind = 'inline';\r\n break;\r\n case TSDocTagSyntaxKind.BlockTag:\r\n syntaxKind = 'block';\r\n break;\r\n case TSDocTagSyntaxKind.ModifierTag:\r\n syntaxKind = 'modifier';\r\n break;\r\n default:\r\n throw new Error('Unimplemented TSDocTagSyntaxKind');\r\n }\r\n\r\n const tagConfigJson: ITagConfigJson = {\r\n tagName: tagDefinition.tagName,\r\n syntaxKind,\r\n };\r\n if (tagDefinition.allowMultiple) {\r\n tagConfigJson.allowMultiple = true;\r\n }\r\n return tagConfigJson;\r\n }\r\n\r\n /**\r\n * Returns a report of any errors that occurred while attempting to load this file or any files\r\n * referenced via the \"extends\" field.\r\n *\r\n * @remarks\r\n * Use {@link TSDocConfigFile.hasErrors} to determine whether any errors occurred.\r\n */\r\n public getErrorSummary(): string {\r\n if (!this._hasErrors) {\r\n return 'No errors.';\r\n }\r\n\r\n let result: string = '';\r\n\r\n if (this.log.messages.length > 0) {\r\n const errorNoun: string = this.log.messages.length > 1 ? 'Errors' : 'Error';\r\n if (this.filePath) {\r\n result += `${errorNoun} encountered for ${this.filePath}:\\n`;\r\n } else {\r\n result += `${errorNoun} encountered when loading TSDoc configuration:\\n`;\r\n }\r\n\r\n for (const message of this.log.messages) {\r\n result += ` ${message.text}\\n`;\r\n }\r\n }\r\n\r\n for (const extendsFile of this.extendsFiles) {\r\n if (extendsFile.hasErrors) {\r\n if (result !== '') {\r\n result += '\\n';\r\n }\r\n result += extendsFile.getErrorSummary();\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Applies the settings from this config file to a TSDoc parser configuration.\r\n * Any `extendsFile` settings will also applied.\r\n *\r\n * @remarks\r\n * Additional validation is performed during this operation. The caller is expected to check for errors\r\n * using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, or {@link TSDocConfigFile.getErrorSummary}.\r\n */\r\n public configureParser(configuration: TSDocConfiguration): void {\r\n if (this._getNoStandardTagsWithExtends()) {\r\n // Do not define standard tags\r\n configuration.clear(true);\r\n } else {\r\n // Define standard tags (the default behavior)\r\n configuration.clear(false);\r\n }\r\n\r\n this.updateParser(configuration);\r\n }\r\n\r\n /**\r\n * This is the same as {@link configureParser}, but it preserves any previous state.\r\n *\r\n * @remarks\r\n * Additional validation is performed during this operation. The caller is expected to check for errors\r\n * using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, or {@link TSDocConfigFile.getErrorSummary}.\r\n */\r\n public updateParser(configuration: TSDocConfiguration): void {\r\n // First apply the base config files\r\n for (const extendsFile of this.extendsFiles) {\r\n extendsFile.updateParser(configuration);\r\n }\r\n\r\n // Then apply this one\r\n for (const tagDefinition of this.tagDefinitions) {\r\n configuration.addTagDefinition(tagDefinition);\r\n }\r\n\r\n this.supportForTags.forEach((supported: boolean, tagName: string) => {\r\n const tagDefinition: TSDocTagDefinition | undefined = configuration.tryGetTagDefinition(tagName);\r\n if (tagDefinition) {\r\n // Note that setSupportForTag() automatically enables configuration.validation.reportUnsupportedTags\r\n configuration.setSupportForTag(tagDefinition, supported);\r\n } else {\r\n // Note that this validation may depend partially on the preexisting state of the TSDocConfiguration\r\n // object, so it cannot be performed during the TSConfigFile.loadFile() stage.\r\n this._reportError({\r\n messageId: TSDocMessageId.ConfigFileUndefinedTag,\r\n messageText: `The \"supportForTags\" field refers to an undefined tag ${JSON.stringify(tagName)}.`,\r\n textRange: TextRange.empty,\r\n });\r\n }\r\n });\r\n\r\n if (this.supportedHtmlElements) {\r\n configuration.setSupportedHtmlElements([...this.supportedHtmlElements]);\r\n }\r\n\r\n if (this._reportUnsupportedHtmlElements === false) {\r\n configuration.validation.reportUnsupportedHtmlElements = false;\r\n } else if (this._reportUnsupportedHtmlElements === true) {\r\n configuration.validation.reportUnsupportedHtmlElements = true;\r\n }\r\n }\r\n\r\n private _getNoStandardTagsWithExtends(): boolean {\r\n if (this.noStandardTags !== undefined) {\r\n return this.noStandardTags;\r\n }\r\n\r\n // This config file does not specify \"noStandardTags\", so consider any base files referenced using \"extends\"\r\n let result: boolean | undefined = undefined;\r\n for (const extendsFile of this.extendsFiles) {\r\n const extendedValue: boolean | undefined = extendsFile._getNoStandardTagsWithExtends();\r\n if (extendedValue !== undefined) {\r\n result = extendedValue;\r\n }\r\n }\r\n\r\n if (result === undefined) {\r\n // If no config file specifies noStandardTags, then it defaults to false\r\n result = false;\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n"]}