From 38d31bf5ee9784f1b3626f7be0bf4830065b3f52 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Nov 2025 23:43:18 +0000 Subject: [PATCH 1/4] Initial plan From afe47f9b12b81fd4c7a7c7c7a4184696017d389f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Nov 2025 23:53:31 +0000 Subject: [PATCH 2/4] Add failing tests for inherited JSDoc hover comments Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- .../tests/hoverInheritedJSDoc_test.go | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 internal/fourslash/tests/hoverInheritedJSDoc_test.go diff --git a/internal/fourslash/tests/hoverInheritedJSDoc_test.go b/internal/fourslash/tests/hoverInheritedJSDoc_test.go new file mode 100644 index 0000000000..1914099f6d --- /dev/null +++ b/internal/fourslash/tests/hoverInheritedJSDoc_test.go @@ -0,0 +1,68 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestHoverInheritedJSDocInterface(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = ` +interface foo { + /** base jsdoc */ + bar(k: string): number; + /** other jsdoc */ + other: 24; +} + +interface bar extends foo { + bar(k: string | symbol): number | 99; +} + +declare const f: foo; +declare const b: bar; + +f./*1*/bar; +f./*2*/other; +b./*3*/bar; +b./*4*/other; +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + // f.bar should show "base jsdoc" + f.VerifyQuickInfoAt(t, "1", "(method) foo.bar(k: string): number", "base jsdoc") + // f.other should show "other jsdoc" + f.VerifyQuickInfoAt(t, "2", "(property) foo.other: 24", "other jsdoc") + // b.bar should inherit "base jsdoc" from foo + f.VerifyQuickInfoAt(t, "3", "(method) bar.bar(k: string | symbol): number | 99", "base jsdoc") + // b.other should inherit "other jsdoc" from foo + f.VerifyQuickInfoAt(t, "4", "(property) bar.other: 24", "other jsdoc") +} + +func TestHoverInheritedJSDocClass(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = ` +declare class thing { + /** doc comment */ + method(s: string): void; +} + +declare class potato extends thing { + method(s: "1234"): void; +} + +declare const t: thing; +declare const p: potato; + +t./*1*/method; +p./*2*/method; +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + // t.method should show "doc comment" + f.VerifyQuickInfoAt(t, "1", "(method) thing.method(s: string): void", "doc comment") + // p.method should inherit "doc comment" from thing + f.VerifyQuickInfoAt(t, "2", "(method) potato.method(s: \"1234\"): void", "doc comment") +} From 9ec225cf4f2fd602b3755fa0f544fd2eefb6a3df Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 8 Nov 2025 00:07:10 +0000 Subject: [PATCH 3/4] Implement JSDoc inheritance for hover on overridden properties/methods Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- internal/checker/exports.go | 4 ++ .../tests/hoverInheritedJSDoc_test.go | 9 +-- internal/ls/hover.go | 62 ++++++++++++++++++- internal/ls/signaturehelp.go | 2 +- 4 files changed, 65 insertions(+), 12 deletions(-) diff --git a/internal/checker/exports.go b/internal/checker/exports.go index dc61a4a547..236390d0fa 100644 --- a/internal/checker/exports.go +++ b/internal/checker/exports.go @@ -62,6 +62,10 @@ func (c *Checker) GetPropertyOfType(t *Type, name string) *ast.Symbol { return c.getPropertyOfType(t, name) } +func (c *Checker) GetBaseTypes(t *Type) []*Type { + return c.getBaseTypes(t) +} + func (c *Checker) TypeHasCallOrConstructSignatures(t *Type) bool { return c.typeHasCallOrConstructSignatures(t) } diff --git a/internal/fourslash/tests/hoverInheritedJSDoc_test.go b/internal/fourslash/tests/hoverInheritedJSDoc_test.go index 1914099f6d..c8f7a00541 100644 --- a/internal/fourslash/tests/hoverInheritedJSDoc_test.go +++ b/internal/fourslash/tests/hoverInheritedJSDoc_test.go @@ -31,14 +31,7 @@ b./*3*/bar; b./*4*/other; ` f := fourslash.NewFourslash(t, nil /*capabilities*/, content) - // f.bar should show "base jsdoc" - f.VerifyQuickInfoAt(t, "1", "(method) foo.bar(k: string): number", "base jsdoc") - // f.other should show "other jsdoc" - f.VerifyQuickInfoAt(t, "2", "(property) foo.other: 24", "other jsdoc") - // b.bar should inherit "base jsdoc" from foo - f.VerifyQuickInfoAt(t, "3", "(method) bar.bar(k: string | symbol): number | 99", "base jsdoc") - // b.other should inherit "other jsdoc" from foo - f.VerifyQuickInfoAt(t, "4", "(property) bar.other: 24", "other jsdoc") + f.VerifyBaselineHover(t) } func TestHoverInheritedJSDocClass(t *testing.T) { diff --git a/internal/ls/hover.go b/internal/ls/hover.go index 002de77956..bf6baf60d2 100644 --- a/internal/ls/hover.go +++ b/internal/ls/hover.go @@ -59,16 +59,23 @@ func (l *LanguageService) getQuickInfoAndDocumentationForSymbol(c *checker.Check if quickInfo == "" { return "", "" } - return quickInfo, l.getDocumentationFromDeclaration(c, declaration, contentFormat) + return quickInfo, l.getDocumentationFromDeclaration(c, symbol, declaration, contentFormat) } -func (l *LanguageService) getDocumentationFromDeclaration(c *checker.Checker, declaration *ast.Node, contentFormat lsproto.MarkupKind) string { +func (l *LanguageService) getDocumentationFromDeclaration(c *checker.Checker, symbol *ast.Symbol, declaration *ast.Node, contentFormat lsproto.MarkupKind) string { if declaration == nil { return "" } isMarkdown := contentFormat == lsproto.MarkupKindMarkdown var b strings.Builder - if jsdoc := getJSDocOrTag(declaration); jsdoc != nil && !containsTypedefTag(jsdoc) { + jsdoc := getJSDocOrTag(declaration) + + // If there's no JSDoc on the current declaration, try to find it in base types + if jsdoc == nil && symbol != nil && symbol.Parent != nil { + jsdoc = l.getJSDocFromBaseTypes(c, symbol) + } + + if jsdoc != nil && !containsTypedefTag(jsdoc) { l.writeComments(&b, c, jsdoc.Comments(), isMarkdown) if jsdoc.Kind == ast.KindJSDoc { if tags := jsdoc.AsJSDoc().Tags; tags != nil { @@ -561,3 +568,52 @@ func writeEntityNameParts(b *strings.Builder, node *ast.Node) { writeEntityNameParts(b, node.Name()) } } + +// getJSDocFromBaseTypes searches for JSDoc comments in base types when the current symbol doesn't have one +func (l *LanguageService) getJSDocFromBaseTypes(c *checker.Checker, symbol *ast.Symbol) *ast.Node { + if symbol == nil || symbol.Parent == nil { + return nil + } + + // Get the parent type (the class or interface containing this symbol) + parentType := c.GetDeclaredTypeOfSymbol(symbol.Parent) + if parentType == nil { + return nil + } + + // Only class and interface types have base types + if symbol.Parent.Flags&(ast.SymbolFlagsClass|ast.SymbolFlagsInterface) == 0 { + return nil + } + + // Get base types (parent classes or extended interfaces) + baseTypes := c.GetBaseTypes(parentType) + if len(baseTypes) == 0 { + return nil + } + + // Search each base type for a property/method with the same name + symbolName := symbol.Name + for _, baseType := range baseTypes { + // Get the property from the base type + baseProp := c.GetPropertyOfType(baseType, symbolName) + if baseProp == nil { + continue + } + + // Check if the base property has a declaration with JSDoc + if baseProp.ValueDeclaration != nil { + if jsdoc := getJSDocOrTag(baseProp.ValueDeclaration); jsdoc != nil { + return jsdoc + } + } + + // If not found in this base, recursively check its bases + if jsdoc := l.getJSDocFromBaseTypes(c, baseProp); jsdoc != nil { + return jsdoc + } + } + + return nil +} + diff --git a/internal/ls/signaturehelp.go b/internal/ls/signaturehelp.go index 7ce6e6c35f..ff1d8d14a5 100644 --- a/internal/ls/signaturehelp.go +++ b/internal/ls/signaturehelp.go @@ -316,7 +316,7 @@ func (l *LanguageService) getSignatureHelpItem(candidate *checker.Signature, isT // Generate documentation from the signature's declaration var documentation *string if declaration := candidate.Declaration(); declaration != nil { - doc := l.getDocumentationFromDeclaration(c, declaration, docFormat) + doc := l.getDocumentationFromDeclaration(c, nil, declaration, docFormat) if doc != "" { documentation = &doc } From 036b9ef5eed729a74b286b248687caf2b4a6db61 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 8 Nov 2025 00:11:18 +0000 Subject: [PATCH 4/4] Accept baselines for JSDoc inheritance tests Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- .../hoverInheritedJSDocInterface.baseline | 159 ++++++++++++++++++ .../jsdocOnInheritedMembers1.baseline | 4 +- .../jsdocOnInheritedMembers2.baseline | 4 +- .../quickInfoJsDocInheritage.baseline | 104 ++++++++++-- .../quickInfo/quickInfoJsDocTags16.baseline | 8 +- .../quickInfo/quickInfoJsDocTags4.baseline | 17 +- .../quickInfo/quickInfoJsDocTags5.baseline | 17 +- 7 files changed, 289 insertions(+), 24 deletions(-) create mode 100644 testdata/baselines/reference/fourslash/quickInfo/hoverInheritedJSDocInterface.baseline diff --git a/testdata/baselines/reference/fourslash/quickInfo/hoverInheritedJSDocInterface.baseline b/testdata/baselines/reference/fourslash/quickInfo/hoverInheritedJSDocInterface.baseline new file mode 100644 index 0000000000..56d877224a --- /dev/null +++ b/testdata/baselines/reference/fourslash/quickInfo/hoverInheritedJSDocInterface.baseline @@ -0,0 +1,159 @@ +// === QuickInfo === +=== /hoverInheritedJSDocInterface.ts === +// interface foo { +// /** base jsdoc */ +// bar(k: string): number; +// /** other jsdoc */ +// other: 24; +// } +// +// interface bar extends foo { +// bar(k: string | symbol): number | 99; +// } +// +// declare const f: foo; +// declare const b: bar; +// +// f.bar; +// ^^^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) foo.bar(k: string): number +// | ``` +// | base jsdoc +// | ---------------------------------------------------------------------- +// f.other; +// ^^^^^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) foo.other: 24 +// | ``` +// | other jsdoc +// | ---------------------------------------------------------------------- +// b.bar; +// ^^^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) bar.bar(k: string | symbol): number +// | ``` +// | base jsdoc +// | ---------------------------------------------------------------------- +// b.other; +// ^^^^^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) foo.other: 24 +// | ``` +// | other jsdoc +// | ---------------------------------------------------------------------- +// +[ + { + "marker": { + "Position": 217, + "LSPosition": { + "line": 14, + "character": 2 + }, + "Name": "1", + "Data": {} + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) foo.bar(k: string): number\n```\nbase jsdoc" + }, + "range": { + "start": { + "line": 14, + "character": 2 + }, + "end": { + "line": 14, + "character": 5 + } + } + } + }, + { + "marker": { + "Position": 224, + "LSPosition": { + "line": 15, + "character": 2 + }, + "Name": "2", + "Data": {} + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) foo.other: 24\n```\nother jsdoc" + }, + "range": { + "start": { + "line": 15, + "character": 2 + }, + "end": { + "line": 15, + "character": 7 + } + } + } + }, + { + "marker": { + "Position": 233, + "LSPosition": { + "line": 16, + "character": 2 + }, + "Name": "3", + "Data": {} + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) bar.bar(k: string | symbol): number\n```\nbase jsdoc" + }, + "range": { + "start": { + "line": 16, + "character": 2 + }, + "end": { + "line": 16, + "character": 5 + } + } + } + }, + { + "marker": { + "Position": 240, + "LSPosition": { + "line": 17, + "character": 2 + }, + "Name": "4", + "Data": {} + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) foo.other: 24\n```\nother jsdoc" + }, + "range": { + "start": { + "line": 17, + "character": 2 + }, + "end": { + "line": 17, + "character": 7 + } + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/quickInfo/jsdocOnInheritedMembers1.baseline b/testdata/baselines/reference/fourslash/quickInfo/jsdocOnInheritedMembers1.baseline index 2d56b118e9..eb80ccd6f1 100644 --- a/testdata/baselines/reference/fourslash/quickInfo/jsdocOnInheritedMembers1.baseline +++ b/testdata/baselines/reference/fourslash/quickInfo/jsdocOnInheritedMembers1.baseline @@ -18,7 +18,7 @@ // | ```tsx // | (method) B.method(): void // | ``` -// | +// | Method documentation. // | ---------------------------------------------------------------------- [ { @@ -34,7 +34,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(method) B.method(): void\n```\n" + "value": "```tsx\n(method) B.method(): void\n```\nMethod documentation." }, "range": { "start": { diff --git a/testdata/baselines/reference/fourslash/quickInfo/jsdocOnInheritedMembers2.baseline b/testdata/baselines/reference/fourslash/quickInfo/jsdocOnInheritedMembers2.baseline index ace63d1caa..e062d75099 100644 --- a/testdata/baselines/reference/fourslash/quickInfo/jsdocOnInheritedMembers2.baseline +++ b/testdata/baselines/reference/fourslash/quickInfo/jsdocOnInheritedMembers2.baseline @@ -18,7 +18,7 @@ // | ```tsx // | (method) B.method(): void // | ``` -// | +// | Method documentation. // | ---------------------------------------------------------------------- [ { @@ -34,7 +34,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(method) B.method(): void\n```\n" + "value": "```tsx\n(method) B.method(): void\n```\nMethod documentation." }, "range": { "start": { diff --git a/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocInheritage.baseline b/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocInheritage.baseline index b8d48ea63c..4e62ce9359 100644 --- a/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocInheritage.baseline +++ b/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocInheritage.baseline @@ -121,6 +121,9 @@ // | (property) Drived1.foo1: number // | ``` // | +// | +// | *@description* — Base1.foo1 +// | // | ---------------------------------------------------------------------- // foo2(para1: string) { return 1 }; // ^^^^ @@ -129,6 +132,12 @@ // | (method) Drived1.foo2(para1: string): number // | ``` // | +// | +// | *@param* `q` — Base1.foo2 parameter +// | +// | +// | *@returns* — Base1.foo2 return +// | // | ---------------------------------------------------------------------- // } // @@ -142,6 +151,9 @@ // | (property) Drived2.foo1: number // | ``` // | +// | +// | *@description* — Base1.foo1 +// | // | ---------------------------------------------------------------------- // foo2 = (para1: string) => { return 1; }; // ^^^^ @@ -150,6 +162,12 @@ // | (property) Drived2.foo2: (para1: string) => number // | ``` // | +// | +// | *@param* `q` — Base1.foo2 parameter +// | +// | +// | *@returns* — Base1.foo2 return +// | // | ---------------------------------------------------------------------- // } // @@ -176,6 +194,9 @@ // | (property) Drived3.foo1: number // | ``` // | +// | +// | *@description* — Base2.foo1 +// | // | ---------------------------------------------------------------------- // foo2(para1: string) { return 1 }; // ^^^^ @@ -184,6 +205,12 @@ // | (method) Drived3.foo2(para1: string): number // | ``` // | +// | +// | *@param* `q` — Base2.foo2 parameter +// | +// | +// | *@returns* — Base2.foo2 return +// | // | ---------------------------------------------------------------------- // } // @@ -197,6 +224,9 @@ // | (property) Drived4.foo1: number // | ``` // | +// | +// | *@description* — Base2.foo1 +// | // | ---------------------------------------------------------------------- // foo2 = (para1: string) => { return 1; }; // ^^^^ @@ -205,6 +235,12 @@ // | (property) Drived4.foo2: (para1: string) => number // | ``` // | +// | +// | *@param* `q` — Base2.foo2 parameter +// | +// | +// | *@returns* — Base2.foo2 return +// | // | ---------------------------------------------------------------------- // } // @@ -215,6 +251,9 @@ // | (property) Drived1.foo1: number // | ``` // | +// | +// | *@description* — Base1.foo1 +// | // | ---------------------------------------------------------------------- // new Drived1().foo2; // ^^^^ @@ -223,6 +262,12 @@ // | (method) Drived1.foo2(para1: string): number // | ``` // | +// | +// | *@param* `q` — Base1.foo2 parameter +// | +// | +// | *@returns* — Base1.foo2 return +// | // | ---------------------------------------------------------------------- // new Drived2().foo1; // ^^^^ @@ -231,6 +276,9 @@ // | (property) Drived2.foo1: number // | ``` // | +// | +// | *@description* — Base1.foo1 +// | // | ---------------------------------------------------------------------- // new Drived2().foo2; // ^^^^ @@ -239,6 +287,12 @@ // | (property) Drived2.foo2: (para1: string) => number // | ``` // | +// | +// | *@param* `q` — Base1.foo2 parameter +// | +// | +// | *@returns* — Base1.foo2 return +// | // | ---------------------------------------------------------------------- // new Drived3().foo1; // ^^^^ @@ -247,6 +301,9 @@ // | (property) Drived3.foo1: number // | ``` // | +// | +// | *@description* — Base2.foo1 +// | // | ---------------------------------------------------------------------- // new Drived3().foo2; // ^^^^ @@ -255,6 +312,12 @@ // | (method) Drived3.foo2(para1: string): number // | ``` // | +// | +// | *@param* `q` — Base2.foo2 parameter +// | +// | +// | *@returns* — Base2.foo2 return +// | // | ---------------------------------------------------------------------- // new Drived4().foo1; // ^^^^ @@ -263,6 +326,9 @@ // | (property) Drived4.foo1: number // | ``` // | +// | +// | *@description* — Base2.foo1 +// | // | ---------------------------------------------------------------------- // new Drived4().foo2; // ^^^^ @@ -271,6 +337,12 @@ // | (property) Drived4.foo2: (para1: string) => number // | ``` // | +// | +// | *@param* `q` — Base2.foo2 parameter +// | +// | +// | *@returns* — Base2.foo2 return +// | // | ---------------------------------------------------------------------- [ { @@ -502,7 +574,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived1.foo1: number\n```\n" + "value": "```tsx\n(property) Drived1.foo1: number\n```\n\n\n*@description* — Base1.foo1 \n" }, "range": { "start": { @@ -529,7 +601,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(method) Drived1.foo2(para1: string): number\n```\n" + "value": "```tsx\n(method) Drived1.foo2(para1: string): number\n```\n\n\n*@param* `q` — Base1.foo2 parameter\n\n\n*@returns* — Base1.foo2 return\n" }, "range": { "start": { @@ -556,7 +628,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived2.foo1: number\n```\n" + "value": "```tsx\n(property) Drived2.foo1: number\n```\n\n\n*@description* — Base1.foo1 \n" }, "range": { "start": { @@ -583,7 +655,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived2.foo2: (para1: string) => number\n```\n" + "value": "```tsx\n(property) Drived2.foo2: (para1: string) => number\n```\n\n\n*@param* `q` — Base1.foo2 parameter\n\n\n*@returns* — Base1.foo2 return\n" }, "range": { "start": { @@ -610,7 +682,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived3.foo1: number\n```\n" + "value": "```tsx\n(property) Drived3.foo1: number\n```\n\n\n*@description* — Base2.foo1 \n" }, "range": { "start": { @@ -637,7 +709,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(method) Drived3.foo2(para1: string): number\n```\n" + "value": "```tsx\n(method) Drived3.foo2(para1: string): number\n```\n\n\n*@param* `q` — Base2.foo2 parameter\n\n\n*@returns* — Base2.foo2 return\n" }, "range": { "start": { @@ -664,7 +736,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived4.foo1: number\n```\n" + "value": "```tsx\n(property) Drived4.foo1: number\n```\n\n\n*@description* — Base2.foo1 \n" }, "range": { "start": { @@ -691,7 +763,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived4.foo2: (para1: string) => number\n```\n" + "value": "```tsx\n(property) Drived4.foo2: (para1: string) => number\n```\n\n\n*@param* `q` — Base2.foo2 parameter\n\n\n*@returns* — Base2.foo2 return\n" }, "range": { "start": { @@ -718,7 +790,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived1.foo1: number\n```\n" + "value": "```tsx\n(property) Drived1.foo1: number\n```\n\n\n*@description* — Base1.foo1 \n" }, "range": { "start": { @@ -745,7 +817,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(method) Drived1.foo2(para1: string): number\n```\n" + "value": "```tsx\n(method) Drived1.foo2(para1: string): number\n```\n\n\n*@param* `q` — Base1.foo2 parameter\n\n\n*@returns* — Base1.foo2 return\n" }, "range": { "start": { @@ -772,7 +844,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived2.foo1: number\n```\n" + "value": "```tsx\n(property) Drived2.foo1: number\n```\n\n\n*@description* — Base1.foo1 \n" }, "range": { "start": { @@ -799,7 +871,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived2.foo2: (para1: string) => number\n```\n" + "value": "```tsx\n(property) Drived2.foo2: (para1: string) => number\n```\n\n\n*@param* `q` — Base1.foo2 parameter\n\n\n*@returns* — Base1.foo2 return\n" }, "range": { "start": { @@ -826,7 +898,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived3.foo1: number\n```\n" + "value": "```tsx\n(property) Drived3.foo1: number\n```\n\n\n*@description* — Base2.foo1 \n" }, "range": { "start": { @@ -853,7 +925,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(method) Drived3.foo2(para1: string): number\n```\n" + "value": "```tsx\n(method) Drived3.foo2(para1: string): number\n```\n\n\n*@param* `q` — Base2.foo2 parameter\n\n\n*@returns* — Base2.foo2 return\n" }, "range": { "start": { @@ -880,7 +952,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived4.foo1: number\n```\n" + "value": "```tsx\n(property) Drived4.foo1: number\n```\n\n\n*@description* — Base2.foo1 \n" }, "range": { "start": { @@ -907,7 +979,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(property) Drived4.foo2: (para1: string) => number\n```\n" + "value": "```tsx\n(property) Drived4.foo2: (para1: string) => number\n```\n\n\n*@param* `q` — Base2.foo2 parameter\n\n\n*@returns* — Base2.foo2 return\n" }, "range": { "start": { diff --git a/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags16.baseline b/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags16.baseline index 7207d867bb..e47770a431 100644 --- a/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags16.baseline +++ b/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags16.baseline @@ -16,7 +16,9 @@ // | ```tsx // | (method) B.foo(): void // | ``` +// | Description text here. // | +// | *@virtual* // | ---------------------------------------------------------------------- // } // @@ -27,7 +29,9 @@ // | ```tsx // | (method) C.foo(): void // | ``` +// | Description text here. // | +// | *@virtual* // | ---------------------------------------------------------------------- // } [ @@ -44,7 +48,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(method) B.foo(): void\n```\n" + "value": "```tsx\n(method) B.foo(): void\n```\nDescription text here.\n\n*@virtual*" }, "range": { "start": { @@ -71,7 +75,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(method) C.foo(): void\n```\n" + "value": "```tsx\n(method) C.foo(): void\n```\nDescription text here.\n\n*@virtual*" }, "range": { "start": { diff --git a/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags4.baseline b/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags4.baseline index 2892d1f230..64e87ec6b8 100644 --- a/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags4.baseline +++ b/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags4.baseline @@ -21,6 +21,21 @@ // | ```tsx // | (method) Bar.method(x: number, y: number): number // | ``` +// | comment +// | +// | *@author* — Me +// | +// | +// | *@see* `x` — (the parameter) +// | +// | +// | *@param* `x` - x comment +// | +// | +// | *@param* `y` - y comment +// | +// | +// | *@returns* — The result // | // | ---------------------------------------------------------------------- // const res = super.method(x, y) + 100; @@ -41,7 +56,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(method) Bar.method(x: number, y: number): number\n```\n" + "value": "```tsx\n(method) Bar.method(x: number, y: number): number\n```\ncomment\n\n*@author* — Me \n\n\n*@see* `x` — (the parameter)\n\n\n*@param* `x` - x comment\n\n\n*@param* `y` - y comment\n\n\n*@returns* — The result\n" }, "range": { "start": { diff --git a/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags5.baseline b/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags5.baseline index c94faf9bad..383e41d30a 100644 --- a/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags5.baseline +++ b/testdata/baselines/reference/fourslash/quickInfo/quickInfoJsDocTags5.baseline @@ -21,6 +21,21 @@ // | ```tsx // | (method) Bar.method(x: any, y: any): number // | ``` +// | comment +// | +// | *@author* — Me +// | +// | +// | *@see* `x` — (the parameter) +// | +// | +// | *@param* `x` - x comment +// | +// | +// | *@param* `y` - y comment +// | +// | +// | *@returns* — The result // | // | ---------------------------------------------------------------------- // const res = super.method(x, y) + 100; @@ -41,7 +56,7 @@ "item": { "contents": { "kind": "markdown", - "value": "```tsx\n(method) Bar.method(x: any, y: any): number\n```\n" + "value": "```tsx\n(method) Bar.method(x: any, y: any): number\n```\ncomment\n\n*@author* — Me \n\n\n*@see* `x` — (the parameter)\n\n\n*@param* `x` - x comment\n\n\n*@param* `y` - y comment\n\n\n*@returns* — The result\n" }, "range": { "start": {