зеркало из https://github.com/microsoft/rushstack.git
Add a test case to repro GitHub #2797
This commit is contained in:
Родитель
83f8aefba4
Коммит
4c4151b2b0
|
@ -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;
|
||||
}) => {};
|
||||
|
|
Загрузка…
Ссылка в новой задаче