diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go index 7ea69ddcbc..842e43d52d 100644 --- a/internal/fourslash/fourslash.go +++ b/internal/fourslash/fourslash.go @@ -297,6 +297,18 @@ func getCapabilitiesWithDefaults(capabilities *lsproto.ClientCapabilities) *lspr if capabilitiesWithDefaults.TextDocument.Hover == nil { capabilitiesWithDefaults.TextDocument.Hover = defaultHoverCapabilities } + if capabilitiesWithDefaults.TextDocument.SignatureHelp == nil { + capabilitiesWithDefaults.TextDocument.SignatureHelp = &lsproto.SignatureHelpClientCapabilities{ + SignatureInformation: &lsproto.ClientSignatureInformationOptions{ + DocumentationFormat: &[]lsproto.MarkupKind{lsproto.MarkupKindMarkdown, lsproto.MarkupKindPlainText}, + ParameterInformation: &lsproto.ClientSignatureParameterInformationOptions{ + LabelOffsetSupport: ptrTrue, + }, + ActiveParameterSupport: ptrTrue, + }, + ContextSupport: ptrTrue, + } + } return &capabilitiesWithDefaults } diff --git a/internal/ls/hover.go b/internal/ls/hover.go index f2b867dc01..002de77956 100644 --- a/internal/ls/hover.go +++ b/internal/ls/hover.go @@ -59,59 +59,64 @@ func (l *LanguageService) getQuickInfoAndDocumentationForSymbol(c *checker.Check if quickInfo == "" { return "", "" } + return quickInfo, l.getDocumentationFromDeclaration(c, declaration, contentFormat) +} + +func (l *LanguageService) getDocumentationFromDeclaration(c *checker.Checker, declaration *ast.Node, contentFormat lsproto.MarkupKind) string { + if declaration == nil { + return "" + } isMarkdown := contentFormat == lsproto.MarkupKindMarkdown var b strings.Builder - if declaration != nil { - if jsdoc := getJSDocOrTag(declaration); jsdoc != nil && !containsTypedefTag(jsdoc) { - l.writeComments(&b, c, jsdoc.Comments(), isMarkdown) - if jsdoc.Kind == ast.KindJSDoc { - if tags := jsdoc.AsJSDoc().Tags; tags != nil { - for _, tag := range tags.Nodes { - if tag.Kind == ast.KindJSDocTypeTag { - continue - } - b.WriteString("\n\n") - if isMarkdown { - b.WriteString("*@") - b.WriteString(tag.TagName().Text()) - b.WriteString("*") - } else { - b.WriteString("@") - b.WriteString(tag.TagName().Text()) - } - switch tag.Kind { - case ast.KindJSDocParameterTag, ast.KindJSDocPropertyTag: - writeOptionalEntityName(&b, tag.Name()) - case ast.KindJSDocAugmentsTag: - writeOptionalEntityName(&b, tag.AsJSDocAugmentsTag().ClassName) - case ast.KindJSDocSeeTag: - writeOptionalEntityName(&b, tag.AsJSDocSeeTag().NameExpression) - case ast.KindJSDocTemplateTag: - for i, tp := range tag.TypeParameters() { - if i != 0 { - b.WriteString(",") - } - writeOptionalEntityName(&b, tp.Name()) + if jsdoc := getJSDocOrTag(declaration); jsdoc != nil && !containsTypedefTag(jsdoc) { + l.writeComments(&b, c, jsdoc.Comments(), isMarkdown) + if jsdoc.Kind == ast.KindJSDoc { + if tags := jsdoc.AsJSDoc().Tags; tags != nil { + for _, tag := range tags.Nodes { + if tag.Kind == ast.KindJSDocTypeTag { + continue + } + b.WriteString("\n\n") + if isMarkdown { + b.WriteString("*@") + b.WriteString(tag.TagName().Text()) + b.WriteString("*") + } else { + b.WriteString("@") + b.WriteString(tag.TagName().Text()) + } + switch tag.Kind { + case ast.KindJSDocParameterTag, ast.KindJSDocPropertyTag: + writeOptionalEntityName(&b, tag.Name()) + case ast.KindJSDocAugmentsTag: + writeOptionalEntityName(&b, tag.AsJSDocAugmentsTag().ClassName) + case ast.KindJSDocSeeTag: + writeOptionalEntityName(&b, tag.AsJSDocSeeTag().NameExpression) + case ast.KindJSDocTemplateTag: + for i, tp := range tag.TypeParameters() { + if i != 0 { + b.WriteString(",") } + writeOptionalEntityName(&b, tp.Name()) } - comments := tag.Comments() - if len(comments) != 0 { - if commentHasPrefix(comments, "```") { - b.WriteString("\n") - } else { - b.WriteString(" ") - if !commentHasPrefix(comments, "-") { - b.WriteString("— ") - } + } + comments := tag.Comments() + if len(comments) != 0 { + if commentHasPrefix(comments, "```") { + b.WriteString("\n") + } else { + b.WriteString(" ") + if !commentHasPrefix(comments, "-") { + b.WriteString("— ") } - l.writeComments(&b, c, comments, isMarkdown) } + l.writeComments(&b, c, comments, isMarkdown) } } } } } - return quickInfo, b.String() + return b.String() } func formatQuickInfo(quickInfo string) string { diff --git a/internal/ls/signaturehelp.go b/internal/ls/signaturehelp.go index 8cc913ce57..7ce6e6c35f 100644 --- a/internal/ls/signaturehelp.go +++ b/internal/ls/signaturehelp.go @@ -44,6 +44,7 @@ func (l *LanguageService) ProvideSignatureHelp( position lsproto.Position, context *lsproto.SignatureHelpContext, clientOptions *lsproto.SignatureHelpClientCapabilities, + docFormat lsproto.MarkupKind, ) (lsproto.SignatureHelpResponse, error) { program, sourceFile := l.getProgramAndFile(documentURI) items := l.GetSignatureHelpItems( @@ -52,7 +53,8 @@ func (l *LanguageService) ProvideSignatureHelp( program, sourceFile, context, - clientOptions) + clientOptions, + docFormat) return lsproto.SignatureHelpOrNull{SignatureHelp: items}, nil } @@ -63,6 +65,7 @@ func (l *LanguageService) GetSignatureHelpItems( sourceFile *ast.SourceFile, context *lsproto.SignatureHelpContext, clientOptions *lsproto.SignatureHelpClientCapabilities, + docFormat lsproto.MarkupKind, ) *lsproto.SignatureHelp { typeChecker, done := program.GetTypeCheckerForFile(ctx, sourceFile) defer done() @@ -140,7 +143,7 @@ func (l *LanguageService) GetSignatureHelpItems( // return typeChecker.runWithCancellationToken(cancellationToken, typeChecker => if candidateInfo.candidateInfo != nil { - return createSignatureHelpItems(candidateInfo.candidateInfo.candidates, candidateInfo.candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker, onlyUseSyntacticOwners, clientOptions) + return l.createSignatureHelpItems(candidateInfo.candidateInfo.candidates, candidateInfo.candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker, onlyUseSyntacticOwners, clientOptions, docFormat) } return createTypeHelpItems(candidateInfo.typeInfo, argumentInfo, sourceFile, clientOptions, typeChecker) } @@ -202,7 +205,7 @@ func getTypeHelpItem(symbol *ast.Symbol, typeParameter []*checker.Type, enclosin } } -func createSignatureHelpItems(candidates []*checker.Signature, resolvedSignature *checker.Signature, argumentInfo *argumentListInfo, sourceFile *ast.SourceFile, c *checker.Checker, useFullPrefix bool, clientOptions *lsproto.SignatureHelpClientCapabilities) *lsproto.SignatureHelp { +func (l *LanguageService) createSignatureHelpItems(candidates []*checker.Signature, resolvedSignature *checker.Signature, argumentInfo *argumentListInfo, sourceFile *ast.SourceFile, c *checker.Checker, useFullPrefix bool, clientOptions *lsproto.SignatureHelpClientCapabilities, docFormat lsproto.MarkupKind) *lsproto.SignatureHelp { enclosingDeclaration := getEnclosingDeclarationFromInvocation(argumentInfo.invocation) if enclosingDeclaration == nil { return nil @@ -223,7 +226,7 @@ func createSignatureHelpItems(candidates []*checker.Signature, resolvedSignature } items := make([][]signatureInformation, len(candidates)) for i, candidateSignature := range candidates { - items[i] = getSignatureHelpItem(candidateSignature, argumentInfo.isTypeParameterList, callTargetDisplayParts.String(), enclosingDeclaration, sourceFile, c) + items[i] = l.getSignatureHelpItem(candidateSignature, argumentInfo.isTypeParameterList, callTargetDisplayParts.String(), enclosingDeclaration, sourceFile, c, docFormat) } selectedItemIndex := 0 @@ -262,9 +265,18 @@ func createSignatureHelpItems(candidates []*checker.Signature, resolvedSignature for j, param := range item.Parameters { parameters[j] = param.parameterInfo } + var documentation *lsproto.StringOrMarkupContent + if item.Documentation != nil { + documentation = &lsproto.StringOrMarkupContent{ + MarkupContent: &lsproto.MarkupContent{ + Kind: docFormat, + Value: *item.Documentation, + }, + } + } signatureInformation[i] = &lsproto.SignatureInformation{ Label: item.Label, - Documentation: nil, + Documentation: documentation, Parameters: ¶meters, } } @@ -291,7 +303,7 @@ func createSignatureHelpItems(candidates []*checker.Signature, resolvedSignature return help } -func getSignatureHelpItem(candidate *checker.Signature, isTypeParameterList bool, callTargetSymbol string, enclosingDeclaration *ast.Node, sourceFile *ast.SourceFile, c *checker.Checker) []signatureInformation { +func (l *LanguageService) getSignatureHelpItem(candidate *checker.Signature, isTypeParameterList bool, callTargetSymbol string, enclosingDeclaration *ast.Node, sourceFile *ast.SourceFile, c *checker.Checker, docFormat lsproto.MarkupKind) []signatureInformation { var infos []*signatureHelpItemInfo if isTypeParameterList { infos = itemInfoForTypeParameters(candidate, c, enclosingDeclaration, sourceFile) @@ -301,6 +313,15 @@ func getSignatureHelpItem(candidate *checker.Signature, isTypeParameterList bool suffixDisplayParts := returnTypeToDisplayParts(candidate, c) + // Generate documentation from the signature's declaration + var documentation *string + if declaration := candidate.Declaration(); declaration != nil { + doc := l.getDocumentationFromDeclaration(c, declaration, docFormat) + if doc != "" { + documentation = &doc + } + } + result := make([]signatureInformation, len(infos)) for i, info := range infos { var display strings.Builder @@ -309,7 +330,7 @@ func getSignatureHelpItem(candidate *checker.Signature, isTypeParameterList bool display.WriteString(suffixDisplayParts) result[i] = signatureInformation{ Label: display.String(), - Documentation: nil, + Documentation: documentation, Parameters: info.parameters, IsVariadic: info.isVariadic, } diff --git a/internal/lsp/server.go b/internal/lsp/server.go index 0287340ffb..0f086229b6 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -818,6 +818,7 @@ func (s *Server) handleSignatureHelp(ctx context.Context, languageService *ls.La params.Position, params.Context, s.initializeParams.Capabilities.TextDocument.SignatureHelp, + getSignatureHelpDocumentationFormat(s.initializeParams), ) } @@ -1021,3 +1022,18 @@ func getHoverContentFormat(params *lsproto.InitializeParams) lsproto.MarkupKind // Return the first (most preferred) format return formats[0] } + +func getSignatureHelpDocumentationFormat(params *lsproto.InitializeParams) lsproto.MarkupKind { + if params == nil || params.Capabilities == nil || params.Capabilities.TextDocument == nil || params.Capabilities.TextDocument.SignatureHelp == nil || + params.Capabilities.TextDocument.SignatureHelp.SignatureInformation == nil || + params.Capabilities.TextDocument.SignatureHelp.SignatureInformation.DocumentationFormat == nil { + // Default to plaintext if no preference specified + return lsproto.MarkupKindPlainText + } + formats := *params.Capabilities.TextDocument.SignatureHelp.SignatureInformation.DocumentationFormat + if len(formats) == 0 { + return lsproto.MarkupKindPlainText + } + // Return the first (most preferred) format + return formats[0] +} diff --git a/testdata/baselines/reference/fourslash/signatureHelp/jsDocDontBreakWithNamespaces.baseline b/testdata/baselines/reference/fourslash/signatureHelp/jsDocDontBreakWithNamespaces.baseline index 5b85fe7115..8ccdf99070 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/jsDocDontBreakWithNamespaces.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/jsDocDontBreakWithNamespaces.baseline @@ -8,6 +8,10 @@ // ^ // | ---------------------------------------------------------------------- // | foo(): module +// | +// | +// | *@returns* — :@nodefuel/web~Webserver~wsServer#hello} Websocket server object +// | // | ---------------------------------------------------------------------- // // /** @@ -42,6 +46,10 @@ "signatures": [ { "label": "foo(): module", + "documentation": { + "kind": "markdown", + "value": "\n\n*@returns* — :@nodefuel/web~Webserver~wsServer#hello} Websocket server object\n" + }, "parameters": [] } ], diff --git a/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures5.baseline b/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures5.baseline index 4738ec0a65..57f7193a17 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures5.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures5.baseline @@ -15,6 +15,22 @@ // ^ // | ---------------------------------------------------------------------- // | pathFilter(**basePath: String**, pattern: String, type: String, options: Object): any[] +// | Filters a path based on a regexp or glob pattern. +// | +// | *@param* `basePath` — The base path where the search will be performed. +// | +// | +// | *@param* `pattern` — A string defining a regexp of a glob pattern. +// | +// | +// | *@param* `type` — The search pattern type, can be a regexp or a glob. +// | +// | +// | *@param* `options` — A object containing options to the search. +// | +// | +// | *@return* — A list containing the filtered paths. +// | // | ---------------------------------------------------------------------- [ { @@ -31,6 +47,10 @@ "signatures": [ { "label": "pathFilter(basePath: String, pattern: String, type: String, options: Object): any[]", + "documentation": { + "kind": "markdown", + "value": "Filters a path based on a regexp or glob pattern.\n\n*@param* `basePath` — The base path where the search will be performed.\n\n\n*@param* `pattern` — A string defining a regexp of a glob pattern.\n\n\n*@param* `type` — The search pattern type, can be a regexp or a glob.\n\n\n*@param* `options` — A object containing options to the search.\n\n\n*@return* — A list containing the filtered paths.\n" + }, "parameters": [ { "label": "basePath: String" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures6.baseline b/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures6.baseline index bb6a6fdfb8..490770f2a3 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures6.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures6.baseline @@ -11,18 +11,70 @@ // ^ // | ---------------------------------------------------------------------- // | f1(**p1: string**, p2: string, p3?: string, p4?: string): void +// | +// | +// | *@param* `p1` - A string param +// | +// | +// | *@param* `p2` - An optional param +// | +// | +// | *@param* `p3` - Another optional param +// | +// | +// | *@param* `p4` - An optional param with a default value +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | f1(p1: string, **p2: string**, p3?: string, p4?: string): void +// | +// | +// | *@param* `p1` - A string param +// | +// | +// | *@param* `p2` - An optional param +// | +// | +// | *@param* `p3` - Another optional param +// | +// | +// | *@param* `p4` - An optional param with a default value +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | f1(p1: string, p2: string, **p3?: string**, p4?: string): void +// | +// | +// | *@param* `p1` - A string param +// | +// | +// | *@param* `p2` - An optional param +// | +// | +// | *@param* `p3` - Another optional param +// | +// | +// | *@param* `p4` - An optional param with a default value +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | f1(p1: string, p2: string, p3?: string, **p4?: string**): void +// | +// | +// | *@param* `p1` - A string param +// | +// | +// | *@param* `p2` - An optional param +// | +// | +// | *@param* `p3` - Another optional param +// | +// | +// | *@param* `p4` - An optional param with a default value +// | // | ---------------------------------------------------------------------- [ { @@ -39,6 +91,10 @@ "signatures": [ { "label": "f1(p1: string, p2: string, p3?: string, p4?: string): void", + "documentation": { + "kind": "markdown", + "value": "\n\n*@param* `p1` - A string param\n\n\n*@param* `p2` - An optional param\n\n\n*@param* `p3` - Another optional param\n\n\n*@param* `p4` - An optional param with a default value\n" + }, "parameters": [ { "label": "p1: string" @@ -73,6 +129,10 @@ "signatures": [ { "label": "f1(p1: string, p2: string, p3?: string, p4?: string): void", + "documentation": { + "kind": "markdown", + "value": "\n\n*@param* `p1` - A string param\n\n\n*@param* `p2` - An optional param\n\n\n*@param* `p3` - Another optional param\n\n\n*@param* `p4` - An optional param with a default value\n" + }, "parameters": [ { "label": "p1: string" @@ -107,6 +167,10 @@ "signatures": [ { "label": "f1(p1: string, p2: string, p3?: string, p4?: string): void", + "documentation": { + "kind": "markdown", + "value": "\n\n*@param* `p1` - A string param\n\n\n*@param* `p2` - An optional param\n\n\n*@param* `p3` - Another optional param\n\n\n*@param* `p4` - An optional param with a default value\n" + }, "parameters": [ { "label": "p1: string" @@ -141,6 +205,10 @@ "signatures": [ { "label": "f1(p1: string, p2: string, p3?: string, p4?: string): void", + "documentation": { + "kind": "markdown", + "value": "\n\n*@param* `p1` - A string param\n\n\n*@param* `p2` - An optional param\n\n\n*@param* `p3` - Another optional param\n\n\n*@param* `p4` - An optional param with a default value\n" + }, "parameters": [ { "label": "p1: string" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/jsdocReturnsTag.baseline b/testdata/baselines/reference/fourslash/signatureHelp/jsdocReturnsTag.baseline index 2043548ae2..09b671b368 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/jsdocReturnsTag.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/jsdocReturnsTag.baseline @@ -13,6 +13,16 @@ // ^ // | ---------------------------------------------------------------------- // | find(**l: unknown[]**, x: unknown): unknown +// | Find an item +// | +// | *@template* `T` +// | +// | *@param* `l` +// | +// | *@param* `x` +// | +// | *@returns* — The names of the found item(s). +// | // | ---------------------------------------------------------------------- [ { @@ -29,6 +39,10 @@ "signatures": [ { "label": "find(l: unknown[], x: unknown): unknown", + "documentation": { + "kind": "markdown", + "value": "Find an item\n\n*@template* `T`\n\n*@param* `l`\n\n*@param* `x`\n\n*@returns* — The names of the found item(s).\n" + }, "parameters": [ { "label": "l: unknown[]" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTextFormatting1.baseline b/testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTextFormatting1.baseline index 0a70cac362..aa84850695 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTextFormatting1.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTextFormatting1.baseline @@ -40,26 +40,61 @@ // ^ // | ---------------------------------------------------------------------- // | f1(**var1: any**, var2: any): void +// | +// | +// | *@param* `var1` — **Highlighted text** +// | +// | +// | *@param* `var2` — Another **Highlighted text** +// | // | ---------------------------------------------------------------------- // f2(); // ^ // | ---------------------------------------------------------------------- // | f2(**var1: any**, var2: any): void +// | +// | +// | *@param* `var1` — *Regular text with an asterisk +// | +// | +// | *@param* `var2` — Another *Regular text with an asterisk +// | // | ---------------------------------------------------------------------- // f3(); // ^ // | ---------------------------------------------------------------------- // | f3(**var1: any**, var2: any): void +// | +// | +// | *@param* `var1` — *Regular text with an asterisk +// | +// | +// | *@param* `var2` — Another *Regular text with an asterisk +// | // | ---------------------------------------------------------------------- // f4(); // ^ // | ---------------------------------------------------------------------- // | f4(**var1: any**, var2: any): void +// | +// | +// | *@param* `var1` — **Highlighted text** +// | +// | +// | *@param* `var2` — Another **Highlighted text** +// | // | ---------------------------------------------------------------------- // f5(); // ^ // | ---------------------------------------------------------------------- // | f5(**var1: any**, var2: any): void +// | +// | +// | *@param* `var1` — **Highlighted text** +// | +// | +// | *@param* `var2` — Another **Highlighted text** +// | // | ---------------------------------------------------------------------- [ { @@ -76,6 +111,10 @@ "signatures": [ { "label": "f1(var1: any, var2: any): void", + "documentation": { + "kind": "markdown", + "value": "\n\n*@param* `var1` — **Highlighted text**\n\n\n*@param* `var2` — Another **Highlighted text**\n" + }, "parameters": [ { "label": "var1: any" @@ -104,6 +143,10 @@ "signatures": [ { "label": "f2(var1: any, var2: any): void", + "documentation": { + "kind": "markdown", + "value": "\n\n*@param* `var1` — *Regular text with an asterisk\n\n\n*@param* `var2` — Another *Regular text with an asterisk\n" + }, "parameters": [ { "label": "var1: any" @@ -132,6 +175,10 @@ "signatures": [ { "label": "f3(var1: any, var2: any): void", + "documentation": { + "kind": "markdown", + "value": "\n\n*@param* `var1` — *Regular text with an asterisk\n\n\n*@param* `var2` — Another *Regular text with an asterisk\n" + }, "parameters": [ { "label": "var1: any" @@ -160,6 +207,10 @@ "signatures": [ { "label": "f4(var1: any, var2: any): void", + "documentation": { + "kind": "markdown", + "value": "\n\n*@param* `var1` — **Highlighted text**\n\n\n*@param* `var2` — Another **Highlighted text**\n" + }, "parameters": [ { "label": "var1: any" @@ -188,6 +239,10 @@ "signatures": [ { "label": "f5(var1: any, var2: any): void", + "documentation": { + "kind": "markdown", + "value": "\n\n*@param* `var1` — **Highlighted text**\n\n\n*@param* `var2` — Another **Highlighted text**\n" + }, "parameters": [ { "label": "var1: any" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClass.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClass.baseline index 3ac1bec561..eee615b3a5 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClass.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClass.baseline @@ -18,6 +18,7 @@ // ^ // | ---------------------------------------------------------------------- // | c3(): c3 +// | Constructor comment // | ---------------------------------------------------------------------- // var i3_c = c3; // /** Class comment*/ @@ -30,6 +31,7 @@ // ^ // | ---------------------------------------------------------------------- // | c4(): c4 +// | Constructor comment // | ---------------------------------------------------------------------- // var i4_c = c4; // /** Class with statics*/ @@ -54,6 +56,7 @@ // ^ // | ---------------------------------------------------------------------- // | c6(): c6 +// | constructor comment // | ---------------------------------------------------------------------- // var i6_c = c6; // @@ -69,6 +72,10 @@ // ^ // | ---------------------------------------------------------------------- // | a(**a: string**): a +// | constructor for a +// | +// | *@param* `a` — this is my a +// | // | ---------------------------------------------------------------------- // module m { // export module m2 { @@ -117,6 +124,10 @@ "signatures": [ { "label": "c3(): c3", + "documentation": { + "kind": "markdown", + "value": "Constructor comment" + }, "parameters": [] } ], @@ -138,6 +149,10 @@ "signatures": [ { "label": "c4(): c4", + "documentation": { + "kind": "markdown", + "value": "Constructor comment" + }, "parameters": [] } ], @@ -180,6 +195,10 @@ "signatures": [ { "label": "c6(): c6", + "documentation": { + "kind": "markdown", + "value": "constructor comment" + }, "parameters": [] } ], @@ -201,6 +220,10 @@ "signatures": [ { "label": "a(a: string): a", + "documentation": { + "kind": "markdown", + "value": "constructor for a\n\n*@param* `a` — this is my a\n" + }, "parameters": [ { "label": "a: string" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassMembers.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassMembers.baseline index 3240abb65d..d6c43e6b24 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassMembers.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassMembers.baseline @@ -14,6 +14,7 @@ // ^ // | ---------------------------------------------------------------------- // | p2(**b: number**): number +// | sum with property // | ---------------------------------------------------------------------- // } // /** setter property 1*/ @@ -22,6 +23,7 @@ // ^ // | ---------------------------------------------------------------------- // | p2(**b: number**): number +// | sum with property // | ---------------------------------------------------------------------- // } // /** pp1 is property of c1*/ @@ -36,6 +38,7 @@ // ^ // | ---------------------------------------------------------------------- // | pp2(**b: number**): number +// | sum with property // | ---------------------------------------------------------------------- // } // /** setter property 2*/ @@ -44,6 +47,7 @@ // ^ // | ---------------------------------------------------------------------- // | pp2(**b: number**): number +// | sum with property // | ---------------------------------------------------------------------- // } // /** Constructor method*/ @@ -61,6 +65,7 @@ // ^ // | ---------------------------------------------------------------------- // | s2(**b: number**): number +// | static sum with property // | ---------------------------------------------------------------------- // } // /** setter property 3*/ @@ -69,6 +74,7 @@ // ^ // | ---------------------------------------------------------------------- // | s2(**b: number**): number +// | static sum with property // | ---------------------------------------------------------------------- // } // public nc_p1: number; @@ -130,6 +136,7 @@ // ^ // | ---------------------------------------------------------------------- // | c1(): c1 +// | Constructor method // | ---------------------------------------------------------------------- // var i1_p = i1.p1; // var i1_f = i1.p2; @@ -137,6 +144,7 @@ // ^ // | ---------------------------------------------------------------------- // | p2(**b: number**): number +// | sum with property // | ---------------------------------------------------------------------- // var i1_prop = i1.p3; // i1.p3 = i1_prop; @@ -155,6 +163,7 @@ // ^ // | ---------------------------------------------------------------------- // | s2(**b: number**): number +// | static sum with property // | ---------------------------------------------------------------------- // var i1_s_prop = c1.s3; // c1.s3 = i1_s_prop; @@ -214,6 +223,10 @@ "signatures": [ { "label": "p2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "sum with property" + }, "parameters": [ { "label": "b: number" @@ -239,6 +252,10 @@ "signatures": [ { "label": "p2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "sum with property" + }, "parameters": [ { "label": "b: number" @@ -264,6 +281,10 @@ "signatures": [ { "label": "pp2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "sum with property" + }, "parameters": [ { "label": "b: number" @@ -289,6 +310,10 @@ "signatures": [ { "label": "pp2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "sum with property" + }, "parameters": [ { "label": "b: number" @@ -314,6 +339,10 @@ "signatures": [ { "label": "s2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "static sum with property" + }, "parameters": [ { "label": "b: number" @@ -339,6 +368,10 @@ "signatures": [ { "label": "s2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "static sum with property" + }, "parameters": [ { "label": "b: number" @@ -514,6 +547,10 @@ "signatures": [ { "label": "c1(): c1", + "documentation": { + "kind": "markdown", + "value": "Constructor method" + }, "parameters": [] } ], @@ -535,6 +572,10 @@ "signatures": [ { "label": "p2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "sum with property" + }, "parameters": [ { "label": "b: number" @@ -585,6 +626,10 @@ "signatures": [ { "label": "s2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "static sum with property" + }, "parameters": [ { "label": "b: number" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsCommentParsing.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsCommentParsing.baseline index e347d6162a..f9f951a722 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsCommentParsing.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsCommentParsing.baseline @@ -28,6 +28,7 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocSingleLine(): void +// | this is eg of single line jsdoc style comment // | ---------------------------------------------------------------------- // // @@ -40,6 +41,9 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocMultiLine(): void +// | this is multiple line jsdoc stule comment +// | New line1 +// | New Line2 // | ---------------------------------------------------------------------- // // /** multiple line jsdoc comments no longer merge @@ -53,6 +57,7 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocMultiLineMerge(): void +// | Another this one too // | ---------------------------------------------------------------------- // // @@ -64,6 +69,7 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocMixedComments1(): void +// | jsdoc comment // | ---------------------------------------------------------------------- // // /// Triple slash comment @@ -74,6 +80,7 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocMixedComments2(): void +// | another jsDocComment // | ---------------------------------------------------------------------- // // /** jsdoc comment */ /*** triplestar jsDocComment*/ @@ -84,6 +91,7 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocMixedComments3(): void +// | * triplestar jsDocComment // | ---------------------------------------------------------------------- // // /** jsdoc comment */ /** another jsDocComment*/ @@ -95,6 +103,7 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocMixedComments4(): void +// | another jsDocComment // | ---------------------------------------------------------------------- // // /// Triple slash comment 1 @@ -107,6 +116,7 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocMixedComments5(): void +// | another jsDocComment // | ---------------------------------------------------------------------- // // /** another jsDocComment*/ @@ -120,6 +130,7 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocMixedComments6(): void +// | jsdoc comment // | ---------------------------------------------------------------------- // // // This shoulnot be help comment @@ -158,10 +169,24 @@ // ^ // | ---------------------------------------------------------------------- // | sum(**a: number**, b: number): number +// | Adds two integers and returns the result +// | +// | *@param* `a` — first number +// | +// | +// | *@param* `b` — second number +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | sum(a: number, **b: number**): number +// | Adds two integers and returns the result +// | +// | *@param* `a` — first number +// | +// | +// | *@param* `b` — second number +// | // | ---------------------------------------------------------------------- // /** This is multiplication function // * @param @@ -176,22 +201,112 @@ // ^ // | ---------------------------------------------------------------------- // | multiply(**a: number**, b: number, c?: number, d?: any, e?: any): void +// | This is multiplication function +// | +// | *@param* `` +// | +// | *@param* `a` — first number +// | +// | +// | *@param* `b` +// | +// | *@param* `c` +// | +// | *@param* `d` +// | +// | *@anotherTag* +// | +// | *@param* `e` — LastParam +// | +// | *@anotherTag* // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | multiply(a: number, **b: number**, c?: number, d?: any, e?: any): void +// | This is multiplication function +// | +// | *@param* `` +// | +// | *@param* `a` — first number +// | +// | +// | *@param* `b` +// | +// | *@param* `c` +// | +// | *@param* `d` +// | +// | *@anotherTag* +// | +// | *@param* `e` — LastParam +// | +// | *@anotherTag* // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | multiply(a: number, b: number, **c?: number**, d?: any, e?: any): void +// | This is multiplication function +// | +// | *@param* `` +// | +// | *@param* `a` — first number +// | +// | +// | *@param* `b` +// | +// | *@param* `c` +// | +// | *@param* `d` +// | +// | *@anotherTag* +// | +// | *@param* `e` — LastParam +// | +// | *@anotherTag* // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | multiply(a: number, b: number, c?: number, **d?: any**, e?: any): void +// | This is multiplication function +// | +// | *@param* `` +// | +// | *@param* `a` — first number +// | +// | +// | *@param* `b` +// | +// | *@param* `c` +// | +// | *@param* `d` +// | +// | *@anotherTag* +// | +// | *@param* `e` — LastParam +// | +// | *@anotherTag* // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | multiply(a: number, b: number, c?: number, d?: any, **e?: any**): void +// | This is multiplication function +// | +// | *@param* `` +// | +// | *@param* `a` — first number +// | +// | +// | *@param* `b` +// | +// | *@param* `c` +// | +// | *@param* `d` +// | +// | *@anotherTag* +// | +// | *@param* `e` — LastParam +// | +// | *@anotherTag* // | ---------------------------------------------------------------------- // /** fn f1 with number // * @param { string} b about b @@ -206,6 +321,10 @@ // ^ // | ---------------------------------------------------------------------- // | f1(**a: number**): any +// | fn f1 with number +// | +// | *@param* `b` — about b +// | // | ---------------------------------------------------------------------- // f1("hello"); // ^ @@ -227,26 +346,134 @@ // ^ // | ---------------------------------------------------------------------- // | subtract(**a: number**, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void +// | This is subtract function +// | +// | *@param* `` +// | +// | *@param* `b` — this is about b +// | +// | +// | *@param* `c` — this is optional param c +// | +// | +// | *@param* `d` — this is optional param d +// | +// | +// | *@param* `e` — this is optional param e +// | +// | +// | *@param* `` — { () => string; } } f this is optional param f +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | subtract(a: number, **b: number**, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void +// | This is subtract function +// | +// | *@param* `` +// | +// | *@param* `b` — this is about b +// | +// | +// | *@param* `c` — this is optional param c +// | +// | +// | *@param* `d` — this is optional param d +// | +// | +// | *@param* `e` — this is optional param e +// | +// | +// | *@param* `` — { () => string; } } f this is optional param f +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | subtract(a: number, b: number, **c?: () => string**, d?: () => string, e?: () => string, f?: () => string): void +// | This is subtract function +// | +// | *@param* `` +// | +// | *@param* `b` — this is about b +// | +// | +// | *@param* `c` — this is optional param c +// | +// | +// | *@param* `d` — this is optional param d +// | +// | +// | *@param* `e` — this is optional param e +// | +// | +// | *@param* `` — { () => string; } } f this is optional param f +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | subtract(a: number, b: number, c?: () => string, **d?: () => string**, e?: () => string, f?: () => string): void +// | This is subtract function +// | +// | *@param* `` +// | +// | *@param* `b` — this is about b +// | +// | +// | *@param* `c` — this is optional param c +// | +// | +// | *@param* `d` — this is optional param d +// | +// | +// | *@param* `e` — this is optional param e +// | +// | +// | *@param* `` — { () => string; } } f this is optional param f +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | subtract(a: number, b: number, c?: () => string, d?: () => string, **e?: () => string**, f?: () => string): void +// | This is subtract function +// | +// | *@param* `` +// | +// | *@param* `b` — this is about b +// | +// | +// | *@param* `c` — this is optional param c +// | +// | +// | *@param* `d` — this is optional param d +// | +// | +// | *@param* `e` — this is optional param e +// | +// | +// | *@param* `` — { () => string; } } f this is optional param f +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, **f?: () => string**): void +// | This is subtract function +// | +// | *@param* `` +// | +// | *@param* `b` — this is about b +// | +// | +// | *@param* `c` — this is optional param c +// | +// | +// | *@param* `d` — this is optional param d +// | +// | +// | *@param* `e` — this is optional param e +// | +// | +// | *@param* `` — { () => string; } } f this is optional param f +// | // | ---------------------------------------------------------------------- // /** this is square function // @paramTag { number } a this is input number of paramTag @@ -260,6 +487,16 @@ // ^ // | ---------------------------------------------------------------------- // | square(**a: number**): number +// | this is square function +// | +// | *@paramTag* — { number } a this is input number of paramTag +// | +// | +// | *@param* `a` — this is input number +// | +// | +// | *@returnType* — { number } it is return type +// | // | ---------------------------------------------------------------------- // /** this is divide function // @param { number} a this is a @@ -272,10 +509,30 @@ // ^ // | ---------------------------------------------------------------------- // | divide(**a: number**, b: number): void +// | this is divide function +// | +// | *@param* `a` — this is a +// | +// | +// | *@paramTag* — { number } g this is optional param g +// | +// | +// | *@param* `b` — this is b +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | divide(a: number, **b: number**): void +// | this is divide function +// | +// | *@param* `a` — this is a +// | +// | +// | *@paramTag* — { number } g this is optional param g +// | +// | +// | *@param* `b` — this is b +// | // | ---------------------------------------------------------------------- // /** // Function returns string concat of foo and bar @@ -289,10 +546,24 @@ // ^ // | ---------------------------------------------------------------------- // | fooBar(**foo: string**, bar: string): string +// | Function returns string concat of foo and bar +// | +// | *@param* `foo` — is string +// | +// | +// | *@param* `bar` — is second string +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | fooBar(foo: string, **bar: string**): string +// | Function returns string concat of foo and bar +// | +// | *@param* `foo` — is string +// | +// | +// | *@param* `bar` — is second string +// | // | ---------------------------------------------------------------------- // /** This is a comment */ // var x; @@ -315,18 +586,46 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocParamTest(**a: number**, b: number, c: number, d: number): number +// | this is jsdoc style function with param tag as well as inline parameter help +// | +// | *@param* `a` — it is first parameter +// | +// | +// | *@param* `c` — it is third parameter +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | jsDocParamTest(a: number, **b: number**, c: number, d: number): number +// | this is jsdoc style function with param tag as well as inline parameter help +// | +// | *@param* `a` — it is first parameter +// | +// | +// | *@param* `c` — it is third parameter +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | jsDocParamTest(a: number, b: number, **c: number**, d: number): number +// | this is jsdoc style function with param tag as well as inline parameter help +// | +// | *@param* `a` — it is first parameter +// | +// | +// | *@param* `c` — it is third parameter +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | jsDocParamTest(a: number, b: number, c: number, **d: number**): number +// | this is jsdoc style function with param tag as well as inline parameter help +// | +// | *@param* `a` — it is first parameter +// | +// | +// | *@param* `c` — it is third parameter +// | // | ---------------------------------------------------------------------- // /** This is function comment // * And properly aligned comment @@ -337,6 +636,8 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocCommentAlignmentTest1(): void +// | This is function comment +// | And properly aligned comment // | ---------------------------------------------------------------------- // /** This is function comment // * And aligned with 4 space char margin @@ -347,6 +648,8 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocCommentAlignmentTest2(): void +// | This is function comment +// | And aligned with 4 space char margin // | ---------------------------------------------------------------------- // /** This is function comment // * And aligned with 4 space char margin @@ -365,14 +668,62 @@ // ^ // | ---------------------------------------------------------------------- // | jsDocCommentAlignmentTest3(**a: string**, b: any, c: any): void +// | This is function comment +// | And aligned with 4 space char margin +// | +// | *@param* `a` — this is info about a +// | spanning on two lines and aligned perfectly +// | +// | +// | *@param* `b` — this is info about b +// | spanning on two lines and aligned perfectly +// | spanning one more line alined perfectly +// | spanning another line with more margin +// | +// | +// | *@param* `c` — this is info about b +// | not aligned text about parameter will eat only one space +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | jsDocCommentAlignmentTest3(a: string, **b: any**, c: any): void +// | This is function comment +// | And aligned with 4 space char margin +// | +// | *@param* `a` — this is info about a +// | spanning on two lines and aligned perfectly +// | +// | +// | *@param* `b` — this is info about b +// | spanning on two lines and aligned perfectly +// | spanning one more line alined perfectly +// | spanning another line with more margin +// | +// | +// | *@param* `c` — this is info about b +// | not aligned text about parameter will eat only one space +// | // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | jsDocCommentAlignmentTest3(a: string, b: any, **c: any**): void +// | This is function comment +// | And aligned with 4 space char margin +// | +// | *@param* `a` — this is info about a +// | spanning on two lines and aligned perfectly +// | +// | +// | *@param* `b` — this is info about b +// | spanning on two lines and aligned perfectly +// | spanning one more line alined perfectly +// | spanning another line with more margin +// | +// | +// | *@param* `c` — this is info about b +// | not aligned text about parameter will eat only one space +// | // | ---------------------------------------------------------------------- // // ^ @@ -438,6 +789,10 @@ "signatures": [ { "label": "jsDocSingleLine(): void", + "documentation": { + "kind": "markdown", + "value": "this is eg of single line jsdoc style comment" + }, "parameters": [] } ], @@ -459,6 +814,10 @@ "signatures": [ { "label": "jsDocMultiLine(): void", + "documentation": { + "kind": "markdown", + "value": "this is multiple line jsdoc stule comment\nNew line1\nNew Line2" + }, "parameters": [] } ], @@ -480,6 +839,10 @@ "signatures": [ { "label": "jsDocMultiLineMerge(): void", + "documentation": { + "kind": "markdown", + "value": "Another this one too" + }, "parameters": [] } ], @@ -501,6 +864,10 @@ "signatures": [ { "label": "jsDocMixedComments1(): void", + "documentation": { + "kind": "markdown", + "value": "jsdoc comment" + }, "parameters": [] } ], @@ -522,6 +889,10 @@ "signatures": [ { "label": "jsDocMixedComments2(): void", + "documentation": { + "kind": "markdown", + "value": "another jsDocComment" + }, "parameters": [] } ], @@ -543,6 +914,10 @@ "signatures": [ { "label": "jsDocMixedComments3(): void", + "documentation": { + "kind": "markdown", + "value": "* triplestar jsDocComment" + }, "parameters": [] } ], @@ -564,6 +939,10 @@ "signatures": [ { "label": "jsDocMixedComments4(): void", + "documentation": { + "kind": "markdown", + "value": "another jsDocComment" + }, "parameters": [] } ], @@ -585,6 +964,10 @@ "signatures": [ { "label": "jsDocMixedComments5(): void", + "documentation": { + "kind": "markdown", + "value": "another jsDocComment" + }, "parameters": [] } ], @@ -606,6 +989,10 @@ "signatures": [ { "label": "jsDocMixedComments6(): void", + "documentation": { + "kind": "markdown", + "value": "jsdoc comment" + }, "parameters": [] } ], @@ -690,6 +1077,10 @@ "signatures": [ { "label": "sum(a: number, b: number): number", + "documentation": { + "kind": "markdown", + "value": "Adds two integers and returns the result\n\n*@param* `a` — first number\n\n\n*@param* `b` — second number\n" + }, "parameters": [ { "label": "a: number" @@ -718,6 +1109,10 @@ "signatures": [ { "label": "sum(a: number, b: number): number", + "documentation": { + "kind": "markdown", + "value": "Adds two integers and returns the result\n\n*@param* `a` — first number\n\n\n*@param* `b` — second number\n" + }, "parameters": [ { "label": "a: number" @@ -746,6 +1141,10 @@ "signatures": [ { "label": "multiply(a: number, b: number, c?: number, d?: any, e?: any): void", + "documentation": { + "kind": "markdown", + "value": "This is multiplication function\n\n*@param* ``\n\n*@param* `a` — first number\n\n\n*@param* `b`\n\n*@param* `c`\n\n*@param* `d`\n\n*@anotherTag*\n\n*@param* `e` — LastParam \n\n*@anotherTag*" + }, "parameters": [ { "label": "a: number" @@ -783,6 +1182,10 @@ "signatures": [ { "label": "multiply(a: number, b: number, c?: number, d?: any, e?: any): void", + "documentation": { + "kind": "markdown", + "value": "This is multiplication function\n\n*@param* ``\n\n*@param* `a` — first number\n\n\n*@param* `b`\n\n*@param* `c`\n\n*@param* `d`\n\n*@anotherTag*\n\n*@param* `e` — LastParam \n\n*@anotherTag*" + }, "parameters": [ { "label": "a: number" @@ -820,6 +1223,10 @@ "signatures": [ { "label": "multiply(a: number, b: number, c?: number, d?: any, e?: any): void", + "documentation": { + "kind": "markdown", + "value": "This is multiplication function\n\n*@param* ``\n\n*@param* `a` — first number\n\n\n*@param* `b`\n\n*@param* `c`\n\n*@param* `d`\n\n*@anotherTag*\n\n*@param* `e` — LastParam \n\n*@anotherTag*" + }, "parameters": [ { "label": "a: number" @@ -857,6 +1264,10 @@ "signatures": [ { "label": "multiply(a: number, b: number, c?: number, d?: any, e?: any): void", + "documentation": { + "kind": "markdown", + "value": "This is multiplication function\n\n*@param* ``\n\n*@param* `a` — first number\n\n\n*@param* `b`\n\n*@param* `c`\n\n*@param* `d`\n\n*@anotherTag*\n\n*@param* `e` — LastParam \n\n*@anotherTag*" + }, "parameters": [ { "label": "a: number" @@ -894,6 +1305,10 @@ "signatures": [ { "label": "multiply(a: number, b: number, c?: number, d?: any, e?: any): void", + "documentation": { + "kind": "markdown", + "value": "This is multiplication function\n\n*@param* ``\n\n*@param* `a` — first number\n\n\n*@param* `b`\n\n*@param* `c`\n\n*@param* `d`\n\n*@anotherTag*\n\n*@param* `e` — LastParam \n\n*@anotherTag*" + }, "parameters": [ { "label": "a: number" @@ -931,6 +1346,10 @@ "signatures": [ { "label": "f1(a: number): any", + "documentation": { + "kind": "markdown", + "value": "fn f1 with number\n\n*@param* `b` — about b\n" + }, "parameters": [ { "label": "a: number" @@ -964,6 +1383,10 @@ "signatures": [ { "label": "f1(a: number): any", + "documentation": { + "kind": "markdown", + "value": "fn f1 with number\n\n*@param* `b` — about b\n" + }, "parameters": [ { "label": "a: number" @@ -997,6 +1420,10 @@ "signatures": [ { "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function\n\n*@param* ``\n\n*@param* `b` — this is about b\n\n\n*@param* `c` — this is optional param c\n\n\n*@param* `d` — this is optional param d\n\n\n*@param* `e` — this is optional param e\n\n\n*@param* `` — { () => string; } } f this is optional param f\n" + }, "parameters": [ { "label": "a: number" @@ -1037,6 +1464,10 @@ "signatures": [ { "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function\n\n*@param* ``\n\n*@param* `b` — this is about b\n\n\n*@param* `c` — this is optional param c\n\n\n*@param* `d` — this is optional param d\n\n\n*@param* `e` — this is optional param e\n\n\n*@param* `` — { () => string; } } f this is optional param f\n" + }, "parameters": [ { "label": "a: number" @@ -1077,6 +1508,10 @@ "signatures": [ { "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function\n\n*@param* ``\n\n*@param* `b` — this is about b\n\n\n*@param* `c` — this is optional param c\n\n\n*@param* `d` — this is optional param d\n\n\n*@param* `e` — this is optional param e\n\n\n*@param* `` — { () => string; } } f this is optional param f\n" + }, "parameters": [ { "label": "a: number" @@ -1117,6 +1552,10 @@ "signatures": [ { "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function\n\n*@param* ``\n\n*@param* `b` — this is about b\n\n\n*@param* `c` — this is optional param c\n\n\n*@param* `d` — this is optional param d\n\n\n*@param* `e` — this is optional param e\n\n\n*@param* `` — { () => string; } } f this is optional param f\n" + }, "parameters": [ { "label": "a: number" @@ -1157,6 +1596,10 @@ "signatures": [ { "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function\n\n*@param* ``\n\n*@param* `b` — this is about b\n\n\n*@param* `c` — this is optional param c\n\n\n*@param* `d` — this is optional param d\n\n\n*@param* `e` — this is optional param e\n\n\n*@param* `` — { () => string; } } f this is optional param f\n" + }, "parameters": [ { "label": "a: number" @@ -1197,6 +1640,10 @@ "signatures": [ { "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function\n\n*@param* ``\n\n*@param* `b` — this is about b\n\n\n*@param* `c` — this is optional param c\n\n\n*@param* `d` — this is optional param d\n\n\n*@param* `e` — this is optional param e\n\n\n*@param* `` — { () => string; } } f this is optional param f\n" + }, "parameters": [ { "label": "a: number" @@ -1237,6 +1684,10 @@ "signatures": [ { "label": "square(a: number): number", + "documentation": { + "kind": "markdown", + "value": "this is square function\n\n*@paramTag* — { number } a this is input number of paramTag\n\n\n*@param* `a` — this is input number\n\n\n*@returnType* — { number } it is return type\n" + }, "parameters": [ { "label": "a: number" @@ -1262,6 +1713,10 @@ "signatures": [ { "label": "divide(a: number, b: number): void", + "documentation": { + "kind": "markdown", + "value": "this is divide function\n\n*@param* `a` — this is a\n\n\n*@paramTag* — { number } g this is optional param g\n\n\n*@param* `b` — this is b\n" + }, "parameters": [ { "label": "a: number" @@ -1290,6 +1745,10 @@ "signatures": [ { "label": "divide(a: number, b: number): void", + "documentation": { + "kind": "markdown", + "value": "this is divide function\n\n*@param* `a` — this is a\n\n\n*@paramTag* — { number } g this is optional param g\n\n\n*@param* `b` — this is b\n" + }, "parameters": [ { "label": "a: number" @@ -1318,6 +1777,10 @@ "signatures": [ { "label": "fooBar(foo: string, bar: string): string", + "documentation": { + "kind": "markdown", + "value": "Function returns string concat of foo and bar\n\n*@param* `foo` — is string\n\n\n*@param* `bar` — is second string\n" + }, "parameters": [ { "label": "foo: string" @@ -1346,6 +1809,10 @@ "signatures": [ { "label": "fooBar(foo: string, bar: string): string", + "documentation": { + "kind": "markdown", + "value": "Function returns string concat of foo and bar\n\n*@param* `foo` — is string\n\n\n*@param* `bar` — is second string\n" + }, "parameters": [ { "label": "foo: string" @@ -1386,6 +1853,10 @@ "signatures": [ { "label": "jsDocParamTest(a: number, b: number, c: number, d: number): number", + "documentation": { + "kind": "markdown", + "value": "this is jsdoc style function with param tag as well as inline parameter help\n\n*@param* `a` — it is first parameter\n\n\n*@param* `c` — it is third parameter\n" + }, "parameters": [ { "label": "a: number" @@ -1420,6 +1891,10 @@ "signatures": [ { "label": "jsDocParamTest(a: number, b: number, c: number, d: number): number", + "documentation": { + "kind": "markdown", + "value": "this is jsdoc style function with param tag as well as inline parameter help\n\n*@param* `a` — it is first parameter\n\n\n*@param* `c` — it is third parameter\n" + }, "parameters": [ { "label": "a: number" @@ -1454,6 +1929,10 @@ "signatures": [ { "label": "jsDocParamTest(a: number, b: number, c: number, d: number): number", + "documentation": { + "kind": "markdown", + "value": "this is jsdoc style function with param tag as well as inline parameter help\n\n*@param* `a` — it is first parameter\n\n\n*@param* `c` — it is third parameter\n" + }, "parameters": [ { "label": "a: number" @@ -1488,6 +1967,10 @@ "signatures": [ { "label": "jsDocParamTest(a: number, b: number, c: number, d: number): number", + "documentation": { + "kind": "markdown", + "value": "this is jsdoc style function with param tag as well as inline parameter help\n\n*@param* `a` — it is first parameter\n\n\n*@param* `c` — it is third parameter\n" + }, "parameters": [ { "label": "a: number" @@ -1522,6 +2005,10 @@ "signatures": [ { "label": "jsDocCommentAlignmentTest1(): void", + "documentation": { + "kind": "markdown", + "value": "This is function comment\nAnd properly aligned comment" + }, "parameters": [] } ], @@ -1543,6 +2030,10 @@ "signatures": [ { "label": "jsDocCommentAlignmentTest2(): void", + "documentation": { + "kind": "markdown", + "value": "This is function comment\n And aligned with 4 space char margin" + }, "parameters": [] } ], @@ -1564,6 +2055,10 @@ "signatures": [ { "label": "jsDocCommentAlignmentTest3(a: string, b: any, c: any): void", + "documentation": { + "kind": "markdown", + "value": "This is function comment\n And aligned with 4 space char margin\n\n*@param* `a` — this is info about a\nspanning on two lines and aligned perfectly\n\n\n*@param* `b` — this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin\n\n\n*@param* `c` — this is info about b\nnot aligned text about parameter will eat only one space\n" + }, "parameters": [ { "label": "a: string" @@ -1595,6 +2090,10 @@ "signatures": [ { "label": "jsDocCommentAlignmentTest3(a: string, b: any, c: any): void", + "documentation": { + "kind": "markdown", + "value": "This is function comment\n And aligned with 4 space char margin\n\n*@param* `a` — this is info about a\nspanning on two lines and aligned perfectly\n\n\n*@param* `b` — this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin\n\n\n*@param* `c` — this is info about b\nnot aligned text about parameter will eat only one space\n" + }, "parameters": [ { "label": "a: string" @@ -1626,6 +2125,10 @@ "signatures": [ { "label": "jsDocCommentAlignmentTest3(a: string, b: any, c: any): void", + "documentation": { + "kind": "markdown", + "value": "This is function comment\n And aligned with 4 space char margin\n\n*@param* `a` — this is info about a\nspanning on two lines and aligned perfectly\n\n\n*@param* `b` — this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin\n\n\n*@param* `c` — this is info about b\nnot aligned text about parameter will eat only one space\n" + }, "parameters": [ { "label": "a: string" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionDeclaration.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionDeclaration.baseline index 7eeca6af5e..9379624b79 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionDeclaration.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionDeclaration.baseline @@ -7,6 +7,7 @@ // ^ // | ---------------------------------------------------------------------- // | foo(): void +// | This comment should appear for foo // | ---------------------------------------------------------------------- // /** This is comment for function signature*/ // function fooWithParameters(/** this is comment about a*/a: string, @@ -18,10 +19,12 @@ // ^ // | ---------------------------------------------------------------------- // | fooWithParameters(**a: string**, b: number): void +// | This is comment for function signature // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | fooWithParameters(a: string, **b: number**): void +// | This is comment for function signature // | ---------------------------------------------------------------------- // /** // * Does something @@ -32,6 +35,10 @@ // ^ // | ---------------------------------------------------------------------- // | fn(**a: string**): any +// | Does something +// | +// | *@param* `a` — a string +// | // | ---------------------------------------------------------------------- [ { @@ -48,6 +55,10 @@ "signatures": [ { "label": "foo(): void", + "documentation": { + "kind": "markdown", + "value": "This comment should appear for foo" + }, "parameters": [] } ], @@ -69,6 +80,10 @@ "signatures": [ { "label": "fooWithParameters(a: string, b: number): void", + "documentation": { + "kind": "markdown", + "value": "This is comment for function signature" + }, "parameters": [ { "label": "a: string" @@ -97,6 +112,10 @@ "signatures": [ { "label": "fooWithParameters(a: string, b: number): void", + "documentation": { + "kind": "markdown", + "value": "This is comment for function signature" + }, "parameters": [ { "label": "a: string" @@ -125,6 +144,10 @@ "signatures": [ { "label": "fn(a: string): any", + "documentation": { + "kind": "markdown", + "value": "Does something\n\n*@param* `a` — a string\n" + }, "parameters": [ { "label": "a: string" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionExpression.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionExpression.baseline index ddd0d0daad..909f65f09e 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionExpression.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionExpression.baseline @@ -7,10 +7,12 @@ // ^ // | ---------------------------------------------------------------------- // | lambdaFoo(**a: number**, b: number): number +// | this is lambda comment // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- // | lambdaFoo(a: number, **b: number**): number +// | this is lambda comment // | ---------------------------------------------------------------------- // function anotherFunc(a: number) { // /** documentation @@ -37,6 +39,13 @@ // ^ // | ---------------------------------------------------------------------- // | assigned(**s: string**): number +// | Summary on expression +// | +// | *@param* `s` — param on expression +// | +// | +// | *@returns* — return on expression +// | // | ---------------------------------------------------------------------- [ { @@ -53,6 +62,10 @@ "signatures": [ { "label": "lambdaFoo(a: number, b: number): number", + "documentation": { + "kind": "markdown", + "value": "this is lambda comment" + }, "parameters": [ { "label": "a: number" @@ -81,6 +94,10 @@ "signatures": [ { "label": "lambdaFoo(a: number, b: number): number", + "documentation": { + "kind": "markdown", + "value": "this is lambda comment" + }, "parameters": [ { "label": "a: number" @@ -109,6 +126,10 @@ "signatures": [ { "label": "assigned(s: string): number", + "documentation": { + "kind": "markdown", + "value": "Summary on expression\n\n*@param* `s` — param on expression\n\n\n*@returns* — return on expression\n" + }, "parameters": [ { "label": "s: string" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpConstructorCallParamProperties.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpConstructorCallParamProperties.baseline index a9c2da5bea..1250243a32 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpConstructorCallParamProperties.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpConstructorCallParamProperties.baseline @@ -12,6 +12,10 @@ // ^ // | ---------------------------------------------------------------------- // | Circle(**radius: number**): Circle +// | Initialize a circle. +// | +// | *@param* `radius` — The radius of the circle. +// | // | ---------------------------------------------------------------------- [ { @@ -28,6 +32,10 @@ "signatures": [ { "label": "Circle(radius: number): Circle", + "documentation": { + "kind": "markdown", + "value": "Initialize a circle.\n\n*@param* `radius` — The radius of the circle.\n" + }, "parameters": [ { "label": "radius: number" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocTags.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocTags.baseline index b4af169f8c..58c8b36f34 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocTags.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocTags.baseline @@ -53,21 +53,36 @@ // ^ // | ---------------------------------------------------------------------- // | Foo(**value: number**): Foo +// | This is the constructor. +// | +// | *@myjsdoctag* — this is a comment +// | // | ---------------------------------------------------------------------- // Foo.method1(); // ^ // | ---------------------------------------------------------------------- // | method1(): void +// | method1 documentation +// | +// | *@mytag* — comment1 comment2 +// | // | ---------------------------------------------------------------------- // foo.method2(); // ^ // | ---------------------------------------------------------------------- // | method2(): void +// | +// | +// | *@mytag* // | ---------------------------------------------------------------------- // foo.method3(); // ^ // | ---------------------------------------------------------------------- // | method3(): number +// | +// | +// | *@returns* — a value +// | // | ---------------------------------------------------------------------- // foo.method4(); // foo.property1; @@ -89,6 +104,10 @@ "signatures": [ { "label": "Foo(value: number): Foo", + "documentation": { + "kind": "markdown", + "value": "This is the constructor.\n\n*@myjsdoctag* — this is a comment\n" + }, "parameters": [ { "label": "value: number" @@ -114,6 +133,10 @@ "signatures": [ { "label": "method1(): void", + "documentation": { + "kind": "markdown", + "value": "method1 documentation\n\n*@mytag* — comment1 comment2\n" + }, "parameters": [] } ], @@ -135,6 +158,10 @@ "signatures": [ { "label": "method2(): void", + "documentation": { + "kind": "markdown", + "value": "\n\n*@mytag*" + }, "parameters": [] } ], @@ -156,6 +183,10 @@ "signatures": [ { "label": "method3(): number", + "documentation": { + "kind": "markdown", + "value": "\n\n*@returns* — a value\n" + }, "parameters": [] } ], diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs3.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs3.baseline index 4da40c046b..0bfd6e0bd5 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs3.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs3.baseline @@ -4,6 +4,14 @@ // ^ // | ---------------------------------------------------------------------- // | assign(target: object, **...sources: any[]**): any +// | Copy the values of all of the enumerable own properties from one or more source objects to a +// | target object. Returns the target object. +// | +// | *@param* `target` — The target object to copy to. +// | +// | +// | *@param* `sources` — One or more source objects from which to copy properties +// | // | ---------------------------------------------------------------------- [ { @@ -20,6 +28,10 @@ "signatures": [ { "label": "assign(target: T, source: U): T & U", + "documentation": { + "kind": "markdown", + "value": "Copy the values of all of the enumerable own properties from one or more source objects to a\ntarget object. Returns the target object.\n\n*@param* `target` — The target object to copy to.\n\n\n*@param* `source` — The source object from which to copy properties.\n" + }, "parameters": [ { "label": "target: T" @@ -31,6 +43,10 @@ }, { "label": "assign(target: T, source1: U, source2: V): T & U & V", + "documentation": { + "kind": "markdown", + "value": "Copy the values of all of the enumerable own properties from one or more source objects to a\ntarget object. Returns the target object.\n\n*@param* `target` — The target object to copy to.\n\n\n*@param* `source1` — The first source object from which to copy properties.\n\n\n*@param* `source2` — The second source object from which to copy properties.\n" + }, "parameters": [ { "label": "target: T" @@ -45,6 +61,10 @@ }, { "label": "assign(target: T, source1: U, source2: V, source3: W): T & U & V & W", + "documentation": { + "kind": "markdown", + "value": "Copy the values of all of the enumerable own properties from one or more source objects to a\ntarget object. Returns the target object.\n\n*@param* `target` — The target object to copy to.\n\n\n*@param* `source1` — The first source object from which to copy properties.\n\n\n*@param* `source2` — The second source object from which to copy properties.\n\n\n*@param* `source3` — The third source object from which to copy properties.\n" + }, "parameters": [ { "label": "target: T" @@ -62,6 +82,10 @@ }, { "label": "assign(target: object, ...sources: any[]): any", + "documentation": { + "kind": "markdown", + "value": "Copy the values of all of the enumerable own properties from one or more source objects to a\ntarget object. Returns the target object.\n\n*@param* `target` — The target object to copy to.\n\n\n*@param* `sources` — One or more source objects from which to copy properties\n" + }, "parameters": [ { "label": "target: object" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpTypeArguments2.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpTypeArguments2.baseline index b18da8a20e..04519d87b3 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpTypeArguments2.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpTypeArguments2.baseline @@ -12,21 +12,81 @@ // ^ // | ---------------------------------------------------------------------- // | f<**T**, U, V, W>(a: number, b: string, c: boolean): void +// | some documentation +// | +// | *@template* `T` — some documentation 2 +// | +// | +// | *@template* `W` +// | +// | *@template* `U`, `V` — others +// | +// | +// | *@param* `a` — ok +// | +// | +// | *@param* `b` — not ok +// | // | ---------------------------------------------------------------------- // f(a: number, b: string, c: boolean): void +// | some documentation +// | +// | *@template* `T` — some documentation 2 +// | +// | +// | *@template* `W` +// | +// | *@template* `U`, `V` — others +// | +// | +// | *@param* `a` — ok +// | +// | +// | *@param* `b` — not ok +// | // | ---------------------------------------------------------------------- // f(a: number, b: string, c: boolean): void +// | some documentation +// | +// | *@template* `T` — some documentation 2 +// | +// | +// | *@template* `W` +// | +// | *@template* `U`, `V` — others +// | +// | +// | *@param* `a` — ok +// | +// | +// | *@param* `b` — not ok +// | // | ---------------------------------------------------------------------- // f(a: number, b: string, c: boolean): void +// | some documentation +// | +// | *@template* `T` — some documentation 2 +// | +// | +// | *@template* `W` +// | +// | *@template* `U`, `V` — others +// | +// | +// | *@param* `a` — ok +// | +// | +// | *@param* `b` — not ok +// | // | ---------------------------------------------------------------------- [ { @@ -43,6 +103,10 @@ "signatures": [ { "label": "f(a: number, b: string, c: boolean): void", + "documentation": { + "kind": "markdown", + "value": "some documentation\n\n*@template* `T` — some documentation 2\n\n\n*@template* `W`\n\n*@template* `U`, `V` — others\n\n\n*@param* `a` — ok\n\n\n*@param* `b` — not ok\n" + }, "parameters": [ { "label": "T" @@ -77,6 +141,10 @@ "signatures": [ { "label": "f(a: number, b: string, c: boolean): void", + "documentation": { + "kind": "markdown", + "value": "some documentation\n\n*@template* `T` — some documentation 2\n\n\n*@template* `W`\n\n*@template* `U`, `V` — others\n\n\n*@param* `a` — ok\n\n\n*@param* `b` — not ok\n" + }, "parameters": [ { "label": "T" @@ -111,6 +179,10 @@ "signatures": [ { "label": "f(a: number, b: string, c: boolean): void", + "documentation": { + "kind": "markdown", + "value": "some documentation\n\n*@template* `T` — some documentation 2\n\n\n*@template* `W`\n\n*@template* `U`, `V` — others\n\n\n*@param* `a` — ok\n\n\n*@param* `b` — not ok\n" + }, "parameters": [ { "label": "T" @@ -145,6 +217,10 @@ "signatures": [ { "label": "f(a: number, b: string, c: boolean): void", + "documentation": { + "kind": "markdown", + "value": "some documentation\n\n*@template* `T` — some documentation 2\n\n\n*@template* `W`\n\n*@template* `U`, `V` — others\n\n\n*@param* `a` — ok\n\n\n*@param* `b` — not ok\n" + }, "parameters": [ { "label": "T" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpWithUnknown.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpWithUnknown.baseline index b0c6b6254b..3bc1d52dab 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpWithUnknown.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpWithUnknown.baseline @@ -4,6 +4,10 @@ // ^ // | ---------------------------------------------------------------------- // | eval(**x: string**): any +// | Evaluates JavaScript code and executes it. +// | +// | *@param* `x` — A String value that contains valid JavaScript code. +// | // | ---------------------------------------------------------------------- [ { @@ -20,6 +24,10 @@ "signatures": [ { "label": "eval(x: string): any", + "documentation": { + "kind": "markdown", + "value": "Evaluates JavaScript code and executes it.\n\n*@param* `x` — A String value that contains valid JavaScript code.\n" + }, "parameters": [ { "label": "x: string" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/trailingCommaSignatureHelp.baseline b/testdata/baselines/reference/fourslash/signatureHelp/trailingCommaSignatureHelp.baseline index 3de5364af9..a605b34030 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/trailingCommaSignatureHelp.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/trailingCommaSignatureHelp.baseline @@ -12,6 +12,10 @@ // ^ // | ---------------------------------------------------------------------- // | str(n: number, **radix: number**): string +// | Stringifies a number with radix +// | +// | *@param* `radix` — The radix +// | // | ---------------------------------------------------------------------- // // declare function f(a: T): T; @@ -43,6 +47,10 @@ }, { "label": "str(n: number, radix: number): string", + "documentation": { + "kind": "markdown", + "value": "Stringifies a number with radix\n\n*@param* `radix` — The radix\n" + }, "parameters": [ { "label": "n: number"