TypeScript/tests/cases/fourslash/quickInfoJsDocTagsFunctionOverload04.ts
Jean Pierre 79dcd3dba1 Correctly resolve tags for function overloads (#30253)
* Correctly resolve tags for function overloads. Fixes #30181

* Better fix for #30181. Added more unit tests

* Fix commentsOverloads tests

* Fallback to first signature when doc and tags are empty
2020-01-10 08:54:26 -08:00

62 lines
1.8 KiB
TypeScript

/// <reference path='fourslash.ts'/>
// @Filename: quickInfoJsDocTagsFunctionOverload04.ts
////declare function /*1*/foo(): void;
////
/////**
//// * Doc foo overloaded
//// */
////declare function /*2*/foo(x: number): void
goTo.marker("1");
verify.verifyQuickInfoDisplayParts(
"function",
"declare",
{ start: 17, length: 3 },
[
{text:"function",kind:"keyword"},
{text:" ",kind:"space"},
{text:"foo",kind:"functionName"},
{text:"(",kind:"punctuation"},
{text:")",kind:"punctuation"},
{text:":",kind:"punctuation"},
{text:" ",kind:"space"},
{text:"void",kind:"keyword"},
{text:" ",kind:"space"},
{text:"(",kind:"punctuation"},
{text:"+",kind:"operator"},
{text:"1",kind:"numericLiteral"},
{text:" ",kind:"space"},
{text:"overload",kind:"text"},
{text:")",kind:"punctuation"}
],
[]);
goTo.marker("2");
verify.verifyQuickInfoDisplayParts(
"function",
"declare",
{ start: 78, length: 3 },
[
{text:"function",kind:"keyword"},
{text:" ",kind:"space"},
{text:"foo",kind:"functionName"},
{text:"(",kind:"punctuation"},
{text:"x",kind:"parameterName"},
{text:":",kind:"punctuation"},
{text:" ",kind:"space"},
{text:"number",kind:"keyword"},
{text:")",kind:"punctuation"},
{text:":",kind:"punctuation"},
{text:" ",kind:"space"},
{text:"void",kind:"keyword"},
{text:" ",kind:"space"},
{text:"(",kind:"punctuation"},
{text:"+",kind:"operator"},
{text:"1",kind:"numericLiteral"},
{text:" ",kind:"space"},
{text:"overload",kind:"text"},
{text:")",kind:"punctuation"}
],
[{ text: "Doc foo overloaded", kind: "text" }]);