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lockTag,\r\n DocCodeSpan,\r\n DocFencedCode,\r\n DocDeclarationReference,\r\n DocErrorText,\r\n DocEscapedText,\r\n DocHtmlEndTag,\r\n DocHtmlStartTag,\r\n DocHtmlAttribute,\r\n DocInheritDocTag,\r\n DocInlineTagBase,\r\n DocInlineTag,\r\n DocLinkTag,\r\n DocMemberIdentifier,\r\n DocMemberReference,\r\n DocMemberSymbol,\r\n DocMemberSelector,\r\n DocParamBlock\r\n} from '../nodes';\r\nimport { IStringBuilder } from './StringBuilder';\r\nimport { DocNodeTransforms } from '../transforms/DocNodeTransforms';\r\nimport { StandardTags } from '../details/StandardTags';\r\nimport { DocParamCollection } from '../nodes/DocParamCollection';\r\n\r\nenum LineState {\r\n Closed,\r\n StartOfLine,\r\n MiddleOfLine\r\n}\r\n\r\n/**\r\n * Renders a DocNode tree as a code comment.\r\n */\r\nexport class TSDocEmitter {\r\n public readonly eol: string = '\\n';\r\n\r\n // Whether to emit the /** */ framing\r\n private _emitCommentFraming: boolean = true;\r\n\r\n private _output: IStringBuilder | undefined;\r\n\r\n // This state machine is used by the writer functions to generate the /** */ framing around the emitted lines\r\n private _lineState: LineState = LineState.Closed;\r\n\r\n // State for _ensureLineSkipped()\r\n private _previousLineHadContent: boolean = false;\r\n\r\n // Normally a paragraph is precede by a blank line (unless it's the first thing written).\r\n // But sometimes we want the paragraph to be attached to the previous element, e.g. when it's part of\r\n // an \"@param\" block. Setting _hangingParagraph=true accomplishes that.\r\n private _hangingParagraph: boolean = false;\r\n\r\n public renderComment(output: IStringBuilder, docComment: DocComment): void {\r\n this._emitCommentFraming = true;\r\n this._renderCompleteObject(output, docComment);\r\n }\r\n\r\n public renderHtmlTag(output: IStringBuilder, htmlTag: DocHtmlStartTag | DocHtmlEndTag): void {\r\n this._emitCommentFraming = false;\r\n this._renderCompleteObject(output, htmlTag);\r\n }\r\n\r\n public renderDeclarationReference(\r\n output: IStringBuilder,\r\n declarationReference: DocDeclarationReference\r\n ): void {\r\n this._emitCommentFraming = false;\r\n this._renderCompleteObject(output, declarationReference);\r\n }\r\n\r\n private _renderCompleteObject(output: IStringBuilder, docNode: DocNode): void {\r\n this._output = output;\r\n\r\n this._lineState = LineState.Closed;\r\n this._previousLineHadContent = false;\r\n this._hangingParagraph = false;\r\n\r\n this._renderNode(docNode);\r\n\r\n this._writeEnd();\r\n }\r\n\r\n private _renderNode(docNode: DocNode | undefined): void {\r\n if (docNode === undefined) {\r\n return;\r\n }\r\n\r\n switch (docNode.kind) {\r\n case DocNodeKind.Block:\r\n const docBlock: DocBlock = docNode as DocBlock;\r\n this._ensureLineSkipped();\r\n this._renderNode(docBlock.blockTag);\r\n\r\n if (docBlock.blockTag.tagNameWithUpperCase === StandardTags.returns.tagNameWithUpperCase) {\r\n this._writeContent(' ');\r\n this._hangingParagraph = true;\r\n }\r\n\r\n this._renderNode(docBlock.content);\r\n break;\r\n\r\n case DocNodeKind.BlockTag:\r\n const docBlockTag: DocBlockTag = docNode as DocBlockTag;\r\n if (this._lineState === LineState.MiddleOfLine) {\r\n this._writeContent(' ');\r\n }\r\n this._writeContent(docBlockTag.tagName);\r\n break;\r\n\r\n case DocNodeKind.CodeSpan:\r\n const docCodeSpan: DocCodeSpan = docNode as DocCodeSpan;\r\n this._writeContent('`');\r\n this._writeContent(docCodeSpan.code);\r\n this._writeContent('`');\r\n break;\r\n\r\n case DocNodeKind.Comment:\r\n const docComment: DocComment = docNode as DocComment;\r\n this._renderNodes([\r\n docComment.summarySection,\r\n docComment.remarksBlock,\r\n docComment.privateRemarks,\r\n docComment.deprecatedBlock,\r\n docComment.params,\r\n docComment.typeParams,\r\n docComment.returnsBlock,\r\n ...docComment.customBlocks,\r\n ...docComment.seeBlocks,\r\n docComment.inheritDocTag\r\n ]);\r\n if (docComment.modifierTagSet.nodes.length > 0) {\r\n this._ensureLineSkipped();\r\n this._renderNodes(docComment.modifierTagSet.nodes);\r\n }\r\n break;\r\n\r\n case DocNodeKind.DeclarationReference:\r\n const docDeclarationReference: DocDeclarationReference = docNode as DocDeclarationReference;\r\n this._writeContent(docDeclarationReference.packageName);\r\n this._writeContent(docDeclarationReference.importPath);\r\n if (\r\n docDeclarationReference.packageName !== undefined ||\r\n docDeclarationReference.importPath !== undefined\r\n ) {\r\n this._writeContent('#');\r\n }\r\n this._renderNodes(docDeclarationReference.memberReferences);\r\n break;\r\n\r\n case DocNodeKind.ErrorText:\r\n const docErrorText: DocErrorText = docNode as DocErrorText;\r\n this._writeContent(docErrorText.text);\r\n break;\r\n\r\n case DocNodeKind.EscapedText:\r\n const docEscapedText: DocEscapedText = docNode as DocEscapedText;\r\n this._writeContent(docEscapedText.encodedText);\r\n break;\r\n\r\n case DocNodeKind.FencedCode:\r\n const docFencedCode: DocFencedCode = docNode as DocFencedCode;\r\n\r\n this._ensureAtStartOfLine();\r\n\r\n this._writeContent('```');\r\n this._writeContent(docFencedCode.language);\r\n this._writeNewline();\r\n this._writeContent(docFencedCode.code);\r\n this._writeContent('```');\r\n this._writeNewline();\r\n this._writeNewline();\r\n break;\r\n\r\n case DocNodeKind.HtmlAttribute:\r\n const docHtmlAttribute: DocHtmlAttribute = docNode as DocHtmlAttribute;\r\n this._writeContent(docHtmlAttribute.name);\r\n this._writeContent(docHtmlAttribute.spacingAfterName);\r\n this._writeContent('=');\r\n this._writeContent(docHtmlAttribute.spacingAfterEquals);\r\n this._writeContent(docHtmlAttribute.value);\r\n this._writeContent(docHtmlAttribute.spacingAfterValue);\r\n break;\r\n\r\n case DocNodeKind.HtmlEndTag:\r\n const docHtmlEndTag: DocHtmlEndTag = docNode as DocHtmlEndTag;\r\n this._writeContent('</');\r\n this._writeContent(docHtmlEndTag.name);\r\n this._writeContent('>');\r\n break;\r\n\r\n case DocNodeKind.HtmlStartTag:\r\n const docHtmlStartTag: DocHtmlStartTag = docNode as DocHtmlStartTag;\r\n this._writeContent('<');\r\n this._writeContent(docHtmlStartTag.name);\r\n this._writeContent(docHtmlStartTag.spacingAfterName);\r\n\r\n let needsSpace: boolean =\r\n docHtmlStartTag.spacingAfterName === undefined || docHtmlStartTag.spacingAfterName.length === 0;\r\n\r\n for (const attribute of docHtmlStartTag.htmlAttributes) {\r\n if (needsSpace) {\r\n this._writeContent(' ');\r\n }\r\n this._renderNode(attribute);\r\n needsSpace = attribute.spacingAfterValue === undefined || attribute.spacingAfterValue.length === 0;\r\n }\r\n this._writeContent(docHtmlStartTag.selfClosingTag ? '/>' : '>');\r\n break;\r\n\r\n case DocNodeKind.InheritDocTag:\r\n const docInheritDocTag: DocInheritDocTag = docNode as DocInheritDocTag;\r\n this._renderInlineTag(docInheritDocTag, () => {\r\n if (docInheritDocTag.declarationReference) {\r\n this._writeContent(' ');\r\n this._renderNode(docInheritDocTag.declarationReference);\r\n }\r\n });\r\n break;\r\n\r\n case DocNodeKind.InlineTag:\r\n const docInlineTag: DocInlineTag = docNode as DocInlineTag;\r\n this._renderInlineTag(docInlineTag, () => {\r\n if (docInlineTag.tagContent.length > 0) {\r\n this._writeContent(' ');\r\n this._writeContent(docInlineTag.tagContent);\r\n }\r\n });\r\n break;\r\n\r\n case DocNodeKind.LinkTag:\r\n const docLinkTag: DocLinkTag = docNode as DocLinkTag;\r\n this._renderInlineTag(docLinkTag, () => {\r\n if (docLinkTag.urlDestination !== undefined || docLinkTag.codeDestination !== undefined) {\r\n if (docLinkTag.urlDestination !== undefined) {\r\n this._writeContent(' ');\r\n this._writeContent(docLinkTag.urlDestination);\r\n } else if (docLinkTag.codeDestination !== undefined) {\r\n this._writeContent(' ');\r\n this._renderNode(docLinkTag.codeDestination);\r\n }\r\n }\r\n if (docLinkTag.linkText !== undefined) {\r\n this._writeContent(' ');\r\n this._writeContent('|');\r\n this._writeContent(' ');\r\n this._writeContent(docLinkTag.linkText);\r\n }\r\n });\r\n break;\r\n\r\n case DocNodeKind.MemberIdentifier:\r\n const docMemberIdentifier: DocMemberIdentifier = docNode as DocMemberIdentifier;\r\n if (docMemberIdentifier.hasQuotes) {\r\n this._writeContent('\"');\r\n this._writeContent(docMemberIdentifier.identifier); // todo: encoding\r\n this._writeContent('\"');\r\n } else {\r\n this._writeContent(docMemberIdentifier.identifier);\r\n }\r\n break;\r\n\r\n case DocNodeKind.MemberReference:\r\n const docMemberReference: DocMemberReference = docNode as DocMemberReference;\r\n if (docMemberReference.hasDot) {\r\n this._writeContent('.');\r\n }\r\n\r\n if (docMemberReference.selector) {\r\n this._writeContent('(');\r\n }\r\n\r\n if (docMemberReference.memberSymbol) {\r\n this._renderNode(docMemberReference.memberSymbol);\r\n } else {\r\n this._renderNode(docMemberReference.memberIdentifier);\r\n }\r\n\r\n if (docMemberReference.selector) {\r\n this._writeContent(':');\r\n this._renderNode(docMemberReference.selector);\r\n this._writeContent(')');\r\n }\r\n break;\r\n\r\n case DocNodeKind.MemberSelector:\r\n const docMemberSelector: DocMemberSelector = docNode as DocMemberSelector;\r\n this._writeContent(docMemberSelector.selector);\r\n break;\r\n\r\n case DocNodeKind.MemberSymbol:\r\n const docMemberSymbol: DocMemberSymbol = docNode as DocMemberSymbol;\r\n this._writeContent('[');\r\n this._renderNode(docMemberSymbol.symbolReference);\r\n this._writeContent(']');\r\n break;\r\n\r\n case DocNodeKind.Section:\r\n const docSection: DocSection = docNode as DocSection;\r\n this._renderNodes(docSection.nodes);\r\n break;\r\n\r\n case DocNodeKind.Paragraph:\r\n const trimmedParagraph: DocParagraph = DocNodeTransforms.trimSpacesInParagraph(\r\n docNode as DocParagraph\r\n );\r\n if (trimmedParagraph.nodes.length > 0) {\r\n if (this._hangingParagraph) {\r\n // If it's a hanging paragraph, then don't skip a line\r\n this._hangingParagraph = false;\r\n } else {\r\n this._ensureLineSkipped();\r\n }\r\n\r\n this._renderNodes(trimmedParagraph.nodes);\r\n this._writeNewline();\r\n }\r\n break;\r\n\r\n case DocNodeKind.ParamBlock:\r\n const docParamBlock: DocParamBlock = docNode as DocParamBlock;\r\n this._ensureLineSkipped();\r\n this._renderNode(docParamBlock.blockTag);\r\n this._writeContent(' ');\r\n this._writeContent(docParamBlock.parameterName);\r\n this._writeContent(' - ');\r\n this._hangingParagraph = true;\r\n this._renderNode(docParamBlock.content);\r\n this._hangingParagraph = false;\r\n break;\r\n\r\n case DocNodeKind.ParamCollection:\r\n const docParamCollection: DocParamCollection = docNode as DocParamCollection;\r\n this._renderNodes(docParamCollection.blocks);\r\n break;\r\n\r\n case DocNodeKind.PlainText:\r\n const docPlainText: DocPlainText = docNode as DocPlainText;\r\n this._writeContent(docPlainText.text);\r\n break;\r\n }\r\n }\r\n\r\n private _renderInlineTag(docInlineTagBase: DocInlineTagBase, writeInlineTagContent: () => void): void {\r\n this._writeContent('{');\r\n this._writeContent(docInlineTagBase.tagName);\r\n writeInlineTagContent();\r\n this._writeContent('}');\r\n }\r\n\r\n private _renderNodes(docNodes: ReadonlyArray<DocNode | undefined>): void {\r\n for (const docNode of docNodes) {\r\n this._renderNode(docNode);\r\n }\r\n }\r\n\r\n // Calls _writeNewline() only if we're not already at the start of a new line\r\n private _ensureAtStartOfLine(): void {\r\n if (this._lineState === LineState.MiddleOfLine) {\r\n this._writeNewline();\r\n }\r\n }\r\n\r\n // Calls _writeNewline() if needed to ensure that we have skipped at least one line\r\n private _ensureLineSkipped(): void {\r\n this._ensureAtStartOfLine();\r\n if (this._previousLineHadContent) {\r\n this._writeNewline();\r\n }\r\n }\r\n\r\n // Writes literal text content. If it contains newlines, they will automatically be converted to\r\n // _writeNewline() calls, to ensure that \"*\" is written at the start of each line.\r\n private _writeContent(content: string | undefined): void {\r\n if (content === undefined || content.length === 0) {\r\n return;\r\n }\r\n\r\n const splitLines: string[] = content.split(/\\r?\\n/g);\r\n if (splitLines.length > 1) {\r\n let firstLine: boolean = true;\r\n for (const line of splitLines) {\r\n if (firstLine) {\r\n firstLine = false;\r\n } else {\r\n this._writeNewline();\r\n }\r\n this._writeContent(line);\r\n }\r\n return;\r\n }\r\n\r\n if (this._lineState === LineState.Closed) {\r\n if (this._emitCommentFraming) {\r\n this._output!.append('/**' + this.eol + ' *');\r\n }\r\n this._lineState = LineState.StartOfLine;\r\n }\r\n\r\n if (this._lineState === LineState.StartOfLine) {\r\n if (this._emitCommentFraming) {\r\n this._output!.append(' ');\r\n }\r\n }\r\n\r\n this._output!.append(content);\r\n this._lineState = LineState.MiddleOfLine;\r\n this._previousLineHadContent = true;\r\n }\r\n\r\n // Starts a new line, and inserts \"/**\" or \"*\" as appropriate.\r\n private _writeNewline(): void {\r\n if (this._lineState === LineState.Closed) {\r\n if (this._emitCommentFraming) {\r\n this._output!.append('/**' + this.eol + ' *');\r\n }\r\n this._lineState = LineState.StartOfLine;\r\n }\r\n\r\n this._previousLineHadContent = this._lineState === LineState.MiddleOfLine;\r\n\r\n if (this._emitCommentFraming) {\r\n this._output!.append(this.eol + ' *');\r\n } else {\r\n this._output!.append(this.eol);\r\n }\r\n\r\n this._lineState = LineState.StartOfLine;\r\n this._hangingParagraph = false;\r\n }\r\n\r\n // Closes the comment, adding the final \"*/\" delimiter\r\n private _writeEnd(): void {\r\n if (this._lineState === LineState.MiddleOfLine) {\r\n if (this._emitCommentFraming) {\r\n this._writeNewline();\r\n }\r\n }\r\n\r\n if (this._lineState !== LineState.Closed) {\r\n if (this._emitCommentFraming) {\r\n this._output!.append('/' + this.eol);\r\n }\r\n this._lineState = LineState.Closed;\r\n }\r\n }\r\n}\r\n"]}
\No newline at end of file