Skip to content

Commit 451d435

Browse files
authoredMar 18, 2021
Revert "Editor support for link tag (#41877)" (#43302)
This reverts commit ec77bff.
1 parent a21f61f commit 451d435

File tree

155 files changed

+1604
-20458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+1604
-20458
lines changed
 

‎src/compiler/checker.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5187,7 +5187,7 @@ namespace ts {
51875187
function preserveCommentsOn<T extends Node>(node: T) {
51885188
if (some(propertySymbol.declarations, d => d.kind === SyntaxKind.JSDocPropertyTag)) {
51895189
const d = propertySymbol.declarations?.find(d => d.kind === SyntaxKind.JSDocPropertyTag)! as JSDocPropertyTag;
5190-
const commentText = getTextOfJSDocComment(d.comment);
5190+
const commentText = d.comment;
51915191
if (commentText) {
51925192
setSyntheticLeadingComments(node, [{ kind: SyntaxKind.MultiLineCommentTrivia, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
51935193
}
@@ -6702,7 +6702,7 @@ namespace ts {
67026702
const typeParams = getSymbolLinks(symbol).typeParameters;
67036703
const typeParamDecls = map(typeParams, p => typeParameterToDeclaration(p, context));
67046704
const jsdocAliasDecl = symbol.declarations?.find(isJSDocTypeAlias);
6705-
const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : undefined);
6705+
const commentText = jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : undefined;
67066706
const oldFlags = context.flags;
67076707
context.flags |= NodeBuilderFlags.InTypeAlias;
67086708
const oldEnclosingDecl = context.enclosingDeclaration;
@@ -38593,10 +38593,6 @@ namespace ts {
3859338593
const meaning = SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Value;
3859438594
return resolveEntityName(<EntityName>name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true, getHostSignatureFromJSDoc(name));
3859538595
}
38596-
else if (isJSDocLink(name.parent)) {
38597-
const meaning = SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Value;
38598-
return resolveEntityName(<EntityName>name, meaning, /*ignoreErrors*/ true);
38599-
}
3860038596

3860138597
if (name.parent.kind === SyntaxKind.TypePredicate) {
3860238598
return resolveEntityName(<Identifier>name, /*meaning*/ SymbolFlags.FunctionScopedVariable);

‎src/compiler/emitter.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3565,16 +3565,13 @@ namespace ts {
35653565
function emitJSDoc(node: JSDoc) {
35663566
write("/**");
35673567
if (node.comment) {
3568-
const text = getTextOfJSDocComment(node.comment);
3569-
if (text) {
3570-
const lines = text.split(/\r\n?|\n/g);
3571-
for (const line of lines) {
3572-
writeLine();
3573-
writeSpace();
3574-
writePunctuation("*");
3575-
writeSpace();
3576-
write(line);
3577-
}
3568+
const lines = node.comment.split(/\r\n?|\n/g);
3569+
for (const line of lines) {
3570+
writeLine();
3571+
writeSpace();
3572+
writePunctuation("*");
3573+
writeSpace();
3574+
write(line);
35783575
}
35793576
}
35803577
if (node.tags) {
@@ -3707,11 +3704,10 @@ namespace ts {
37073704
emit(tagName);
37083705
}
37093706

3710-
function emitJSDocComment(comment: NodeArray<JSDocText | JSDocLink> | undefined) {
3711-
const text = getTextOfJSDocComment(comment);
3712-
if (text) {
3707+
function emitJSDocComment(comment: string | undefined) {
3708+
if (comment) {
37133709
writeSpace();
3714-
write(text);
3710+
write(comment);
37153711
}
37163712
}
37173713

0 commit comments

Comments
 (0)