typedoc 0.23.1 → 0.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,9 +35,9 @@ function getCommentWithCache(discovered, config, logger) {
|
|
|
35
35
|
commentCache.set(file, cache);
|
|
36
36
|
return comment.clone();
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const comment = getCommentWithCache(
|
|
40
|
-
if (
|
|
38
|
+
function getCommentImpl(commentSource, config, logger, moduleComment) {
|
|
39
|
+
const comment = getCommentWithCache(commentSource, config, logger);
|
|
40
|
+
if (moduleComment && comment) {
|
|
41
41
|
// Module comment, make sure it is tagged with @packageDocumentation or @module.
|
|
42
42
|
// If it isn't then the comment applies to the first statement in the file, so throw it away.
|
|
43
43
|
if (!comment.hasModifier("@packageDocumentation") &&
|
|
@@ -45,7 +45,7 @@ function getComment(symbol, kind, config, logger, commentStyle) {
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
if (!
|
|
48
|
+
if (!moduleComment && comment) {
|
|
49
49
|
// Ensure module comments are not attached to non-module reflections.
|
|
50
50
|
if (comment.hasModifier("@packageDocumentation") ||
|
|
51
51
|
comment.getTag("@module")) {
|
|
@@ -54,9 +54,12 @@ function getComment(symbol, kind, config, logger, commentStyle) {
|
|
|
54
54
|
}
|
|
55
55
|
return comment;
|
|
56
56
|
}
|
|
57
|
+
function getComment(symbol, kind, config, logger, commentStyle) {
|
|
58
|
+
return getCommentImpl((0, discovery_1.discoverComment)(symbol, kind, logger, commentStyle), config, logger, symbol.declarations?.some(ts.isSourceFile) || false);
|
|
59
|
+
}
|
|
57
60
|
exports.getComment = getComment;
|
|
58
61
|
function getSignatureComment(declaration, config, logger, commentStyle) {
|
|
59
|
-
return
|
|
62
|
+
return getCommentImpl((0, discovery_1.discoverSignatureComment)(declaration, commentStyle), config, logger, false);
|
|
60
63
|
}
|
|
61
64
|
exports.getSignatureComment = getSignatureComment;
|
|
62
65
|
function getJsDocComment(declaration, config, logger) {
|
|
@@ -176,7 +176,7 @@ function blockContent(comment, lexer, config, warning) {
|
|
|
176
176
|
break;
|
|
177
177
|
case lexer_1.TokenSyntaxKind.CloseBrace:
|
|
178
178
|
// Unmatched closing brace, generate a warning, and treat it as text.
|
|
179
|
-
warning(`Unmatched closing brace
|
|
179
|
+
warning(`Unmatched closing brace`);
|
|
180
180
|
content.push({ kind: "text", text: next.text });
|
|
181
181
|
break;
|
|
182
182
|
case lexer_1.TokenSyntaxKind.OpenBrace:
|
|
@@ -5,7 +5,7 @@ import { Context } from "./context";
|
|
|
5
5
|
import { ConverterComponent } from "./components";
|
|
6
6
|
import { ChildableComponent } from "../utils/component";
|
|
7
7
|
import type { DocumentationEntryPoint } from "../utils/entry-point";
|
|
8
|
-
import
|
|
8
|
+
import { CommentParserConfig } from "./comments";
|
|
9
9
|
import type { CommentStyle } from "../utils/options/declaration";
|
|
10
10
|
/**
|
|
11
11
|
* Compiles source files using TypeScript and converts compiler symbols to reflections.
|
|
@@ -19,6 +19,7 @@ const converter_events_1 = require("./converter-events");
|
|
|
19
19
|
const symbols_1 = require("./symbols");
|
|
20
20
|
const paths_1 = require("../utils/paths");
|
|
21
21
|
const enum_1 = require("../utils/enum");
|
|
22
|
+
const comments_1 = require("./comments");
|
|
22
23
|
/**
|
|
23
24
|
* Compiles source files using TypeScript and converts compiler symbols to reflections.
|
|
24
25
|
*/
|
|
@@ -95,6 +96,9 @@ let Converter = Converter_1 = class Converter extends component_1.ChildableCompo
|
|
|
95
96
|
// Special case for when we're giving a single entry point, we don't need to
|
|
96
97
|
// create modules for each entry. Register the project as this module.
|
|
97
98
|
context.project.registerReflection(context.project, symbol);
|
|
99
|
+
context.project.comment =
|
|
100
|
+
symbol &&
|
|
101
|
+
(0, comments_1.getComment)(symbol, context.project.kind, this.config, this.application.logger, this.commentStyle);
|
|
98
102
|
context.trigger(Converter_1.EVENT_CREATE_DECLARATION, context.project);
|
|
99
103
|
moduleContext = context;
|
|
100
104
|
}
|
|
@@ -52,6 +52,9 @@ let JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.Ren
|
|
|
52
52
|
}
|
|
53
53
|
let parent = reflection.parent;
|
|
54
54
|
const boost = reflection.relevanceBoost ?? 1;
|
|
55
|
+
if (boost <= 0) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
55
58
|
if (parent instanceof models_1.ProjectReflection) {
|
|
56
59
|
parent = undefined;
|
|
57
60
|
}
|