mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 10:29:18 -05:00
feat(41216): show JSDoc for aliases (#41452)
This commit is contained in:
@@ -422,6 +422,10 @@ namespace ts.SymbolDisplay {
|
||||
documentationFromAlias = resolvedInfo.documentation;
|
||||
tagsFromAlias = resolvedInfo.tags;
|
||||
}
|
||||
else {
|
||||
documentationFromAlias = resolvedSymbol.getContextualDocumentationComment(resolvedNode, typeChecker);
|
||||
tagsFromAlias = resolvedSymbol.getJsDocTags();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
162
tests/baselines/reference/jsDocAliasQuickInfo.baseline
Normal file
162
tests/baselines/reference/jsDocAliasQuickInfo.baseline
Normal file
@@ -0,0 +1,162 @@
|
||||
[
|
||||
{
|
||||
"marker": {
|
||||
"fileName": "/jsDocAliasQuickInfo.ts",
|
||||
"position": 44
|
||||
},
|
||||
"quickInfo": {
|
||||
"kind": "property",
|
||||
"kindModifiers": "export",
|
||||
"textSpan": {
|
||||
"start": 44,
|
||||
"length": 7
|
||||
},
|
||||
"displayParts": [
|
||||
{
|
||||
"text": "(",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "property",
|
||||
"kind": "text"
|
||||
},
|
||||
{
|
||||
"text": ")",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "default",
|
||||
"kind": "propertyName"
|
||||
},
|
||||
{
|
||||
"text": ":",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "10",
|
||||
"kind": "stringLiteral"
|
||||
}
|
||||
],
|
||||
"documentation": [
|
||||
{
|
||||
"text": "Comment",
|
||||
"kind": "text"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"name": "type",
|
||||
"text": "{number}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"marker": {
|
||||
"fileName": "/test.ts",
|
||||
"position": 9
|
||||
},
|
||||
"quickInfo": {
|
||||
"kind": "property",
|
||||
"kindModifiers": "export",
|
||||
"textSpan": {
|
||||
"start": 9,
|
||||
"length": 7
|
||||
},
|
||||
"displayParts": [
|
||||
{
|
||||
"text": "(",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "property",
|
||||
"kind": "text"
|
||||
},
|
||||
{
|
||||
"text": ")",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "default",
|
||||
"kind": "propertyName"
|
||||
},
|
||||
{
|
||||
"text": ":",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "10",
|
||||
"kind": "stringLiteral"
|
||||
}
|
||||
],
|
||||
"documentation": [
|
||||
{
|
||||
"text": "Comment",
|
||||
"kind": "text"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"name": "type",
|
||||
"text": "{number}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"marker": {
|
||||
"fileName": "/test.ts",
|
||||
"position": 20
|
||||
},
|
||||
"quickInfo": {
|
||||
"kind": "alias",
|
||||
"kindModifiers": "",
|
||||
"textSpan": {
|
||||
"start": 20,
|
||||
"length": 4
|
||||
},
|
||||
"displayParts": [
|
||||
{
|
||||
"text": "export",
|
||||
"kind": "keyword"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "test",
|
||||
"kind": "aliasName"
|
||||
}
|
||||
],
|
||||
"documentation": [
|
||||
{
|
||||
"text": "Comment",
|
||||
"kind": "text"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"name": "type",
|
||||
"text": "{number}"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
13
tests/cases/fourslash/jsDocAliasQuickInfo.ts
Normal file
13
tests/cases/fourslash/jsDocAliasQuickInfo.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: /jsDocAliasQuickInfo.ts
|
||||
/////**
|
||||
//// * Comment
|
||||
//// * @type {number}
|
||||
//// */
|
||||
////export /*1*/default 10;
|
||||
|
||||
// @Filename: /test.ts
|
||||
////export { /*2*/default as /*3*/test } from "./jsDocAliasQuickInfo";
|
||||
|
||||
verify.baselineQuickInfo();
|
||||
Reference in New Issue
Block a user