(
node: ts.Node,
scope: DocScope,
diagnostics: Array<JSDocModelDiagnostic>,
required = true,
linkContext?: { readonly checker: ts.TypeChecker; readonly entry: ProgramCacheEntry; readonly cwd: string }
)
| 2706 | } |
| 2707 | |
| 2708 | function parseDocumentedTs( |
| 2709 | node: ts.Node, |
| 2710 | scope: DocScope, |
| 2711 | diagnostics: Array<JSDocModelDiagnostic>, |
| 2712 | required = true, |
| 2713 | linkContext?: { readonly checker: ts.TypeChecker; readonly entry: ProgramCacheEntry; readonly cwd: string } |
| 2714 | ) { |
| 2715 | const block = getNodeJSDoc(node) |
| 2716 | if (block?.internal) return undefined |
| 2717 | if (block === undefined) { |
| 2718 | if (required) { |
| 2719 | diagnostics.push({ |
| 2720 | ...diagnostic("missing-jsdoc", scope === "member" ? "Member JSDoc is required" : "Public JSDoc is required"), |
| 2721 | range: nodeRange(node) |
| 2722 | }) |
| 2723 | } |
| 2724 | return undefined |
| 2725 | } |
| 2726 | addModelDiagnostics(diagnostics, block.range, block.diagnostics) |
| 2727 | if (block.parsed === undefined) return undefined |
| 2728 | const tags = buildTags(scope, block.parsed.tags) |
| 2729 | if (tags._tag === "Failure") { |
| 2730 | addModelDiagnostics(diagnostics, block.range, tags.error.diagnostics) |
| 2731 | return undefined |
| 2732 | } |
| 2733 | const parsedTags = tags.value as ParsedDeclarationTags | ParsedNamespaceTags | ParsedMemberTags |
| 2734 | if (linkContext !== undefined) addJSDocLinkDiagnostics(node.getSourceFile(), block, diagnostics, linkContext) |
| 2735 | return { |
| 2736 | core: block.parsed, |
| 2737 | tags: linkContext === undefined ? parsedTags : attachSeeLinkSymbols(parsedTags, node, block, linkContext) |
| 2738 | } |
| 2739 | } |
| 2740 | |
| 2741 | function hasExportModifier(node: ts.Node): boolean { |
| 2742 | return ts.canHaveModifiers(node) && |
no test coverage detected