This commit is contained in:
Pete Gonzalez 2021-07-08 16:11:17 -07:00
Родитель 83f8aefba4
Коммит 4c4151b2b0
6 изменённых файлов: 102 добавлений и 1 удалений

2
apps/api-extractor/.vscode/launch.json поставляемый
Просмотреть файл

@ -79,7 +79,7 @@
"run",
"--local",
"--config",
"./temp/configs/api-extractor-exportImportStarAs2.json"
"./temp/configs/api-extractor-spanSorting.json"
],
"sourceMaps": true
}

Просмотреть файл

@ -403,6 +403,49 @@ export class Span {
return result;
}
/**
* Returns a diagnostic dump of the tree, showing the SpanModification settings for each nodde.
*/
public getModifiedDump(indent: string = ''): string {
let result: string = indent + ts.SyntaxKind[this.node.kind] + ': ';
if (this.prefix) {
result += ' pre=[' + this._getTrimmed(this.modification.prefix) + ']';
}
if (this.suffix) {
result += ' suf=[' + this._getTrimmed(this.modification.suffix) + ']';
}
if (this.separator) {
result += ' sep=[' + this._getTrimmed(this.separator) + ']';
}
if (this.modification.indentDocComment !== IndentDocCommentScope.None) {
result += ' indentDocComment=' + IndentDocCommentScope[this.modification.indentDocComment];
}
if (this.modification.omitChildren) {
result += ' omitChildren';
}
if (this.modification.omitSeparatorAfter) {
result += ' omitSeparatorAfter';
}
if (this.modification.sortChildren) {
result += ' sortChildren';
}
if (this.modification.sortKey !== undefined) {
result += ` sortKey="${this.modification.sortKey}"`;
}
result += '\n';
if (!this.modification.omitChildren) {
for (const child of this.children) {
result += child.getModifiedDump(indent + ' ');
}
} else {
result += `${indent} (${this.children.length} children)\n`;
}
return result;
}
/**
* Recursive implementation of `getModifiedText()` and `writeModifiedText()`.
*/

Просмотреть файл

@ -351,6 +351,27 @@
}
],
"implementsTokenRanges": []
},
{
"kind": "Variable",
"canonicalReference": "api-extractor-scenarios!exampleD:var",
"docComment": "/**\n * Outer description\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "exampleD: "
},
{
"kind": "Content",
"text": "(o: {\n a: number;\n b(): string;\n}) => void"
}
],
"releaseTag": "Public",
"name": "exampleD",
"variableTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
]
}

Просмотреть файл

@ -22,6 +22,12 @@ export class ExampleC {
member1(): void;
}
// @public
export const exampleD: (o: {
a: number;
b(): string;
}) => void;
// (No @packageDocumentation comment for this package)
```

Просмотреть файл

@ -35,4 +35,19 @@ export declare class ExampleC {
member1(): void;
}
/**
* Outer description
*/
export declare const exampleD: (o: {
/**
* Inner description
*/
a: number;
/**
* @returns a string
* {@link http://example.com}
*/
b(): string;
}) => void;
export { }

Просмотреть файл

@ -39,3 +39,19 @@ export class ExampleC {
*/
public member1(): void {}
}
/**
* Outer description
*/
export const exampleD = (o: {
/**
* Inner description
*/
a: number;
/**
* @returns a string
* {@link http://example.com}
*/
b(): string;
}) => {};