Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/services/symbolDisplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,9 @@ namespace ts.SymbolDisplay {

if (allSignatures.length > 1 && documentation.length === 0 && tags.length === 0) {
documentation = allSignatures[0].getDocumentationComment(typeChecker);
tags = allSignatures[0].getJsDocTags();
tags = allSignatures[0].getJsDocTags().filter(tag => tag.name !== "deprecated"); // should only include @deprecated JSDoc tag on the first overload (#49368)
}

}

function writeTypeParametersOfSymbol(symbol: Symbol, enclosingDeclaration: Node | undefined) {
Expand Down
26 changes: 26 additions & 0 deletions tests/cases/fourslash/quickInfoJsDocTagsFunctionOverload06.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/// <reference path="fourslash.ts" />
// @target: esnext

// @Filename: /a.ts
/////**
//// * A function that gets the length of an array.
//// * @param testParam
//// * @deprecated Use the new method instead.
//// */
////export function getArrayLength(arr: string[]): number;
////export function getArrayLength(arr: boolean[]): number;

// @Filename: /b.ts
////import { getArrayLength } from "/a";
/////*1*/getArrayLength(["hello"]);
/////*2*/getArrayLength([true]);
/////*3*/getArrayLength(["hello"]);


goTo.file("/b.ts");
goTo.marker("1")
verify.quickInfoIs("(alias) getArrayLength(arr: string[]): number (+1 overload)\nimport getArrayLength", "A function that gets the length of an array.", [{name: "param", text: "testParam"}, {name: "deprecated", text: "Use the new method instead."}])
goTo.marker("2")
verify.quickInfoIs("(alias) getArrayLength(arr: boolean[]): number (+1 overload)\nimport getArrayLength", "A function that gets the length of an array.", [{name: "param", text: "testParam"}])
goTo.marker("3")
verify.quickInfoIs("(alias) getArrayLength(arr: string[]): number (+1 overload)\nimport getArrayLength", "A function that gets the length of an array.", [{name: "param", text: "testParam"}, {name: "deprecated", text: "Use the new method instead."}])