From 9ca7539277586591332c0826685417179650942f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 14:47:28 -0700 Subject: [PATCH 01/12] Convert `baselineQuickInfo` tests. --- .../fourslash/_scripts/convertFourslash.mts | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/internal/fourslash/_scripts/convertFourslash.mts b/internal/fourslash/_scripts/convertFourslash.mts index de1f9ebcb8..a5ef58f727 100644 --- a/internal/fourslash/_scripts/convertFourslash.mts +++ b/internal/fourslash/_scripts/convertFourslash.mts @@ -150,6 +150,8 @@ function parseFourslashStatement(statement: ts.Statement): Cmd[] | undefined { case "baselineFindAllReferences": // `verify.baselineFindAllReferences(...)` return [parseBaselineFindAllReferencesArgs(callExpression.arguments)]; + case "baselineQuickInfo": + return [parseBaselineQuickInfo(callExpression.arguments)]; case "baselineGoToDefinition": case "baselineGetDefinitionAtPosition": // Both of these take the same arguments, but differ in that... @@ -702,6 +704,17 @@ function parseBaselineGoToDefinitionArgs(args: readonly ts.Expression[]): Verify }; } +function parseBaselineQuickInfo(args: ts.NodeArray): Cmd { + if (args.length !== 0) { + // All calls are currently empty! + throw new Error("Expected no arguments in verify.baselineQuickInfo"); + } + return { + kind: "verifyBaselineQuickInfo", + } +} + + function parseKind(expr: ts.Expression): string | undefined { if (!ts.isStringLiteral(expr)) { console.error(`Expected string literal for kind, got ${expr.getText()}`); @@ -849,6 +862,10 @@ interface VerifyBaselineGoToDefinitionCmd { ranges?: boolean; } +interface VerifyBaselineQuickInfoCmd { + kind: "verifyBaselineQuickInfo"; +} + interface GoToCmd { kind: "goTo"; // !!! `selectRange` and `rangeStart` require parsing variables and `test.ranges()[n]` @@ -861,7 +878,14 @@ interface EditCmd { goStatement: string; } -type Cmd = VerifyCompletionsCmd | VerifyBaselineFindAllReferencesCmd | VerifyBaselineGoToDefinitionCmd | GoToCmd | EditCmd; +type Cmd = + | VerifyCompletionsCmd + | VerifyBaselineFindAllReferencesCmd + | VerifyBaselineGoToDefinitionCmd + | VerifyBaselineQuickInfoCmd + | GoToCmd + | EditCmd + ; function generateVerifyCompletions({ marker, args, isNewIdentifierLocation }: VerifyCompletionsCmd): string { let expectedList: string; @@ -917,6 +941,9 @@ function generateCmd(cmd: Cmd): string { return generateBaselineFindAllReferences(cmd as VerifyBaselineFindAllReferencesCmd); case "verifyBaselineGoToDefinition": return generateBaselineGoToDefinition(cmd as VerifyBaselineGoToDefinitionCmd); + case "verifyBaselineQuickInfo": + // Quick Info -> Hover + return `f.VerifyBaselineHover(t)`; case "goTo": return generateGoToCommand(cmd as GoToCmd); case "edit": From b01d279e4ba04b4fc3e67e5ab08de6847c488717 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 14:47:45 -0700 Subject: [PATCH 02/12] Implement `VerifyBaselineHover`. --- internal/fourslash/baselineutil.go | 99 ++++++++++++++++++++++++++++++ internal/fourslash/fourslash.go | 88 ++++++++++++++++++++++++++ 2 files changed, 187 insertions(+) diff --git a/internal/fourslash/baselineutil.go b/internal/fourslash/baselineutil.go index 550ffd53ea..2b87797f81 100644 --- a/internal/fourslash/baselineutil.go +++ b/internal/fourslash/baselineutil.go @@ -1,12 +1,14 @@ package fourslash import ( + "cmp" "errors" "fmt" "io/fs" "regexp" "slices" "strings" + "testing" "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/core" @@ -443,6 +445,103 @@ func (t *textWithContext) readableJsoncBaseline(text string) { } } +type markerAndItem[T any] struct { + marker *Marker + item T +} + +func writeAnnotatedContentWithTooltipsToBaseline[T comparable]( + t *testing.T, + f *FourslashTest, + markersAndItems []markerAndItem[T], + opName string, + getRange func(item T) *lsproto.Range, + getTooltipLines func(item T, prev T) []string, +) { + barWithGutter := "| " + strings.Repeat("-", 70) + + // sort by file, then *backwards* by position in the file + // so we can insert multiple times on a line without counting + sorted := slices.Clone(markersAndItems) + slices.SortFunc(sorted, func(a, b markerAndItem[T]) int { + if c := cmp.Compare(a.marker.FileName(), b.marker.FileName()); c != 0 { + return c + } + return -cmp.Compare(a.marker.Position, b.marker.Position) + }) + + filesToLines := collections.NewOrderedMapWithSizeHint[string, []string](1) + var previous T + for _, itemAndMarker := range sorted { + marker := itemAndMarker.marker + item := itemAndMarker.item + + textRange := getRange(item) + if textRange == nil { + start := marker.LSPosition + end := start + end.Character = end.Character + 1 + textRange = &lsproto.Range{Start: start, End: end} + } + + if textRange.Start.Line != textRange.End.Line { + t.Fatalf("Expected text range to be on a single line, got %v", textRange) + } + underline := + strings.Repeat(" ", int(textRange.Start.Character)) + + strings.Repeat("^", int(textRange.End.Character-textRange.Start.Character)) + + fileName := marker.FileName() + lines, ok := filesToLines.Get(fileName) + if !ok { + lines = lineSplitter.Split(f.getScriptInfo(fileName).content, -1) + } + + var tooltipLines []string + if item != *new(T) { + tooltipLines = getTooltipLines(item, previous) + } + if len(tooltipLines) == 0 { + tooltipLines = []string{fmt.Sprintf("No %s at /*%s*/.", opName, *marker.Name)} + } + tooltipLines = core.Map(tooltipLines, func(line string) string { + return "| " + line + }) + + linesToInsert := make([]string, len(tooltipLines)+3) + linesToInsert[0] = underline + linesToInsert[1] = barWithGutter + copy(linesToInsert[2:], tooltipLines) + linesToInsert[len(linesToInsert)-1] = barWithGutter + + lines = slices.Insert( + lines, + int(textRange.Start.Line), + linesToInsert..., + ) + filesToLines.Set(fileName, lines) + + previous = item + } + + builder := f.baseline.content + seenFirst := false + for fileName, lines := range filesToLines.Entries() { + builder.WriteString(fmt.Sprintf("=== %s ===\n", fileName)) + for _, line := range lines { + builder.WriteString("// ") + builder.WriteString(line) + } + builder.WriteByte('\n') + } + + if seenFirst { + builder.WriteString("\n\n") + } else { + seenFirst = true + } +} + func (t *textWithContext) sliceOfContent(start *int, end *int) string { if start == nil || *start < 0 { start = ptrTo(0) diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go index 24af7d9501..e366631b72 100644 --- a/internal/fourslash/fourslash.go +++ b/internal/fourslash/fourslash.go @@ -903,6 +903,94 @@ func (f *FourslashTest) VerifyBaselineGoToDefinition( baseline.Run(t, f.baseline.getBaselineFileName(), f.baseline.content.String(), baseline.Options{}) } +func (f *FourslashTest) VerifyBaselineHover(t *testing.T) { + if f.baseline != nil { + t.Fatalf("Error during test '%s': Another baseline is already in progress", t.Name()) + } else { + f.baseline = &baselineFromTest{ + content: &strings.Builder{}, + baselineName: "hover/" + strings.TrimPrefix(t.Name(), "Test"), + ext: ".baseline", + } + } + + // empty baseline after test completes + defer func() { + f.baseline = nil + }() + + itemsMarkers := core.MapFiltered(f.Markers(), func(marker *Marker) (markerAndItem[*lsproto.Hover], bool) { + if marker.Name == nil { + return markerAndItem[*lsproto.Hover]{}, false + } + + params := &lsproto.HoverParams{ + TextDocument: lsproto.TextDocumentIdentifier{ + Uri: ls.FileNameToDocumentURI(f.activeFilename), + }, + Position: marker.LSPosition, + } + + resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentHoverInfo, params) + var prefix string + if f.lastKnownMarkerName != nil { + prefix = fmt.Sprintf("At marker '%s': ", *f.lastKnownMarkerName) + } else { + prefix = fmt.Sprintf("At position (Ln %d, Col %d): ", f.currentCaretPosition.Line, f.currentCaretPosition.Character) + } + if resMsg == nil { + t.Fatalf(prefix+"Nil response received for quick info request", f.lastKnownMarkerName) + } + if !resultOk { + t.Fatalf(prefix+"Unexpected response type for quick info request: %T", resMsg.AsResponse().Result) + } + + return markerAndItem[*lsproto.Hover]{marker: marker, item: result.Hover}, true + }) + + getRange := func(item *lsproto.Hover) *lsproto.Range { + if item == nil || item.Range == nil { + return nil + } + return item.Range + } + + getTooltipLines := func(item, _prev *lsproto.Hover) []string { + var result []string + + if item.Contents.MarkupContent != nil { + result = strings.Split(item.Contents.MarkupContent.Value, "\n") + } + if item.Contents.String != nil { + result = strings.Split(*item.Contents.String, "\n") + } + if item.Contents.MarkedStringWithLanguage != nil { + result = appendLinesForMarkedStringWithLanguage(result, item.Contents.MarkedStringWithLanguage) + } + if item.Contents.MarkedStrings != nil { + for _, ms := range *item.Contents.MarkedStrings { + if ms.MarkedStringWithLanguage != nil { + result = appendLinesForMarkedStringWithLanguage(result, ms.MarkedStringWithLanguage) + } else { + result = append(result, *ms.String) + } + } + } + + return result + } + + writeAnnotatedContentWithTooltipsToBaseline(t, f, itemsMarkers, "quickinfo", getRange, getTooltipLines) + baseline.Run(t, f.baseline.getBaselineFileName(), f.baseline.content.String(), baseline.Options{}) +} + +func appendLinesForMarkedStringWithLanguage(result []string, ms *lsproto.MarkedStringWithLanguage) []string { + result = append(result, fmt.Sprintf("```%s", ms.Language)) + result = append(result, ms.Value) + result = append(result, "```") + return result +} + // Collects all named markers if provided, or defaults to anonymous ranges func (f *FourslashTest) lookupMarkersOrGetRanges(t *testing.T, markers []string) []MarkerOrRange { var referenceLocations []MarkerOrRange From 1330ecd1c0bdbe3a8eb79796302aa75ffa4785f3 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 14:50:56 -0700 Subject: [PATCH 03/12] Add new converted tests. --- ...OfContextSensitiveParameterNoCrash_test.go | 103 +++++++++ .../deprecatedInheritedJSDocOverload_test.go | 41 ++++ .../tests/gen/jsDocAliasQuickInfo_test.go | 24 ++ .../tests/gen/jsDocTypeTagQuickInfo1_test.go | 44 ++++ .../tests/gen/jsDocTypeTagQuickInfo2_test.go | 42 ++++ .../tests/gen/jsDocTypedefQuickInfo1_test.go | 44 ++++ .../fourslash/tests/gen/jsdocLink1_test.go | 28 +++ .../fourslash/tests/gen/jsdocLink2_test.go | 30 +++ .../fourslash/tests/gen/jsdocLink3_test.go | 31 +++ .../fourslash/tests/gen/jsdocLink4_test.go | 30 +++ .../fourslash/tests/gen/jsdocLink5_test.go | 24 ++ .../fourslash/tests/gen/jsdocLink6_test.go | 26 +++ .../gen/jsdocOnInheritedMembers1_test.go | 32 +++ .../gen/jsdocOnInheritedMembers2_test.go | 32 +++ .../tests/gen/quickInfoAlias_test.go | 38 +++ ...foAtPropWithAmbientDeclarationInJs_test.go | 27 +++ ...nfoCircularInstantiationExpression_test.go | 18 ++ .../gen/quickInfoCommentsClassMembers_test.go | 147 ++++++++++++ .../tests/gen/quickInfoCommentsClass_test.go | 73 ++++++ .../quickInfoCommentsCommentParsing_test.go | 217 ++++++++++++++++++ ...ickInfoCommentsFunctionDeclaration_test.go | 33 +++ ...uickInfoCommentsFunctionExpression_test.go | 42 ++++ ...isplayPartsArrowFunctionExpression_test.go | 20 ++ ...uickInfoDisplayPartsClassAccessors_test.go | 51 ++++ ...InfoDisplayPartsClassAutoAccessors_test.go | 45 ++++ ...ckInfoDisplayPartsClassConstructor_test.go | 42 ++++ ...oDisplayPartsClassDefaultAnonymous_test.go | 18 ++ ...kInfoDisplayPartsClassDefaultNamed_test.go | 18 ++ ...ickInfoDisplayPartsClassIncomplete_test.go | 18 ++ .../quickInfoDisplayPartsClassMethod_test.go | 35 +++ ...quickInfoDisplayPartsClassProperty_test.go | 35 +++ .../gen/quickInfoDisplayPartsClass_test.go | 20 ++ .../gen/quickInfoDisplayPartsConst_test.go | 37 +++ .../gen/quickInfoDisplayPartsEnum1_test.go | 34 +++ .../gen/quickInfoDisplayPartsEnum2_test.go | 34 +++ .../gen/quickInfoDisplayPartsEnum3_test.go | 34 +++ .../gen/quickInfoDisplayPartsEnum4_test.go | 22 ++ ...nfoDisplayPartsExternalModuleAlias_test.go | 26 +++ ...ickInfoDisplayPartsExternalModules_test.go | 28 +++ ...InfoDisplayPartsFunctionExpression_test.go | 24 ++ ...InfoDisplayPartsFunctionIncomplete_test.go | 20 ++ .../gen/quickInfoDisplayPartsFunction_test.go | 35 +++ ...ckInfoDisplayPartsInterfaceMembers_test.go | 26 +++ .../quickInfoDisplayPartsInterface_test.go | 19 ++ ...nfoDisplayPartsInternalModuleAlias_test.go | 30 +++ .../gen/quickInfoDisplayPartsLet_test.go | 37 +++ ...InfoDisplayPartsLiteralLikeNames01_test.go | 29 +++ ...quickInfoDisplayPartsLocalFunction_test.go | 38 +++ .../gen/quickInfoDisplayPartsModules_test.go | 28 +++ .../quickInfoDisplayPartsParameters_test.go | 23 ++ .../quickInfoDisplayPartsTypeAlias_test.go | 20 ++ ...foDisplayPartsTypeParameterInClass_test.go | 36 +++ ...ParameterInFunctionLikeInTypeAlias_test.go | 18 ++ ...isplayPartsTypeParameterInFunction_test.go | 24 ++ ...splayPartsTypeParameterInInterface_test.go | 34 +++ ...splayPartsTypeParameterInTypeAlias_test.go | 18 ++ .../gen/quickInfoDisplayPartsUsing_test.go | 21 ++ ...foDisplayPartsVarWithStringTypes01_test.go | 19 ++ .../gen/quickInfoDisplayPartsVar_test.go | 31 +++ ...oForArgumentsPropertyNameInJsMode1_test.go | 27 +++ ...oForArgumentsPropertyNameInJsMode2_test.go | 23 ++ .../gen/quickInfoForConstAssertions_test.go | 20 ++ .../gen/quickInfoForJSDocCodefence_test.go | 34 +++ .../gen/quickInfoForJSDocUnknownTag_test.go | 62 +++++ .../quickInfoForJSDocWithHttpLinks_test.go | 36 +++ ...nfoForJSDocWithUnresolvedHttpLinks_test.go | 23 ++ ...kInfoForObjectBindingElementName03_test.go | 26 +++ ...kInfoForObjectBindingElementName04_test.go | 32 +++ ...kInfoForObjectBindingElementName05_test.go | 29 +++ ...kInfoForObjectBindingElementName06_test.go | 34 +++ .../tests/gen/quickInfoImportMeta_test.go | 30 +++ .../tests/gen/quickInfoInheritDoc2_test.go | 33 +++ .../tests/gen/quickInfoInheritDoc3_test.go | 34 +++ .../tests/gen/quickInfoInheritDoc4_test.go | 27 +++ .../tests/gen/quickInfoInheritDoc5_test.go | 29 +++ .../tests/gen/quickInfoInheritDoc6_test.go | 27 +++ .../tests/gen/quickInfoInheritDoc_test.go | 76 ++++++ .../gen/quickInfoJSDocAtBeforeSpace_test.go | 29 +++ .../tests/gen/quickInfoJSDocTags_test.go | 74 ++++++ .../tests/gen/quickInfoJsDocAlias_test.go | 26 +++ .../gen/quickInfoJsDocGetterSetter_test.go | 60 +++++ .../gen/quickInfoJsDocInheritage_test.go | 120 ++++++++++ .../tests/gen/quickInfoJsDocTags10_test.go | 25 ++ .../tests/gen/quickInfoJsDocTags11_test.go | 26 +++ .../tests/gen/quickInfoJsDocTags12_test.go | 25 ++ .../tests/gen/quickInfoJsDocTags14_test.go | 26 +++ .../tests/gen/quickInfoJsDocTags15_test.go | 47 ++++ .../tests/gen/quickInfoJsDocTags16_test.go | 32 +++ .../tests/gen/quickInfoJsDocTags1_test.go | 30 +++ .../tests/gen/quickInfoJsDocTags3_test.go | 34 +++ .../tests/gen/quickInfoJsDocTags4_test.go | 37 +++ .../tests/gen/quickInfoJsDocTags5_test.go | 39 ++++ .../tests/gen/quickInfoJsDocTags6_test.go | 40 ++++ .../tests/gen/quickInfoJsDocTags7_test.go | 28 +++ .../tests/gen/quickInfoJsDocTags8_test.go | 28 +++ .../tests/gen/quickInfoJsDocTags9_test.go | 28 +++ .../gen/quickInfoJsDocTagsCallback_test.go | 30 +++ ...ickInfoJsDocTagsFunctionOverload01_test.go | 27 +++ ...ickInfoJsDocTagsFunctionOverload03_test.go | 24 ++ ...ickInfoJsDocTagsFunctionOverload05_test.go | 23 ++ .../gen/quickInfoJsDocTagsTypedef_test.go | 34 +++ .../tests/gen/quickInfoJsDocThisTag_test.go | 22 ++ .../tests/gen/quickInfoJsDoc_test.go | 74 ++++++ .../tests/gen/quickInfoLink10_test.go | 20 ++ .../tests/gen/quickInfoLink11_test.go | 25 ++ .../tests/gen/quickInfoLink5_test.go | 21 ++ .../tests/gen/quickInfoLink6_test.go | 21 ++ .../tests/gen/quickInfoLink7_test.go | 20 ++ .../tests/gen/quickInfoLink8_test.go | 21 ++ .../tests/gen/quickInfoLink9_test.go | 22 ++ ...InfoNestedExportEqualExportDefault_test.go | 20 ++ ...claredUsingCatchCallIndexSignature_test.go | 22 ++ ...UsingTemplateLiteralTypeSignatures_test.go | 26 +++ .../gen/quickInfoOnJsxNamespacedName_test.go | 23 ++ .../quickInfoOnParameterProperties_test.go | 41 ++++ .../tests/gen/quickInfoOnThis5_test.go | 37 +++ ...ertiesWithIdenticalJSDocComments01_test.go | 41 ++++ ...thodsOnAssignedFunctionExpressions_test.go | 28 +++ .../tests/gen/quickInfoSatisfiesTag_test.go | 22 ++ .../tests/gen/quickInfoTypedefTag_test.go | 40 ++++ .../gen/quickInfoUniqueSymbolJsDoc_test.go | 22 ++ 121 files changed, 4235 insertions(+) create mode 100644 internal/fourslash/tests/gen/completionDetailsOfContextSensitiveParameterNoCrash_test.go create mode 100644 internal/fourslash/tests/gen/deprecatedInheritedJSDocOverload_test.go create mode 100644 internal/fourslash/tests/gen/jsDocAliasQuickInfo_test.go create mode 100644 internal/fourslash/tests/gen/jsDocTypeTagQuickInfo1_test.go create mode 100644 internal/fourslash/tests/gen/jsDocTypeTagQuickInfo2_test.go create mode 100644 internal/fourslash/tests/gen/jsDocTypedefQuickInfo1_test.go create mode 100644 internal/fourslash/tests/gen/jsdocLink1_test.go create mode 100644 internal/fourslash/tests/gen/jsdocLink2_test.go create mode 100644 internal/fourslash/tests/gen/jsdocLink3_test.go create mode 100644 internal/fourslash/tests/gen/jsdocLink4_test.go create mode 100644 internal/fourslash/tests/gen/jsdocLink5_test.go create mode 100644 internal/fourslash/tests/gen/jsdocLink6_test.go create mode 100644 internal/fourslash/tests/gen/jsdocOnInheritedMembers1_test.go create mode 100644 internal/fourslash/tests/gen/jsdocOnInheritedMembers2_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoAlias_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoAtPropWithAmbientDeclarationInJs_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoCircularInstantiationExpression_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoCommentsClassMembers_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoCommentsClass_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoCommentsCommentParsing_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoCommentsFunctionDeclaration_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoCommentsFunctionExpression_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsArrowFunctionExpression_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsClassAccessors_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsClassAutoAccessors_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsClassConstructor_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsClassDefaultAnonymous_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsClassDefaultNamed_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsClassIncomplete_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsClassMethod_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsClassProperty_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsClass_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsConst_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsEnum1_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsEnum2_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsEnum3_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsEnum4_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsExternalModuleAlias_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsExternalModules_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsFunctionExpression_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsFunctionIncomplete_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsFunction_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsInterfaceMembers_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsInterface_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsInternalModuleAlias_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsLet_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsLiteralLikeNames01_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsLocalFunction_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsModules_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsParameters_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsTypeAlias_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInClass_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInFunction_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInInterface_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInTypeAlias_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsUsing_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsVarWithStringTypes01_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoDisplayPartsVar_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoForArgumentsPropertyNameInJsMode1_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoForArgumentsPropertyNameInJsMode2_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoForConstAssertions_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoForJSDocCodefence_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoForJSDocUnknownTag_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoForJSDocWithHttpLinks_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoForJSDocWithUnresolvedHttpLinks_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoForObjectBindingElementName03_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoForObjectBindingElementName04_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoForObjectBindingElementName05_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoForObjectBindingElementName06_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoImportMeta_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoInheritDoc2_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoInheritDoc3_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoInheritDoc4_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoInheritDoc5_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoInheritDoc6_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoInheritDoc_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJSDocAtBeforeSpace_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJSDocTags_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocAlias_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocGetterSetter_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocInheritage_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags10_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags11_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags12_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags14_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags15_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags16_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags1_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags3_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags4_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags5_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags6_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags7_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags8_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTags9_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTagsCallback_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload01_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload03_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload05_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocTagsTypedef_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDocThisTag_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoJsDoc_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoLink10_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoLink11_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoLink5_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoLink6_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoLink7_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoLink8_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoLink9_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoNestedExportEqualExportDefault_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoOnJsxNamespacedName_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoOnParameterProperties_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoOnThis5_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoOnUnionPropertiesWithIdenticalJSDocComments01_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoSalsaMethodsOnAssignedFunctionExpressions_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoSatisfiesTag_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoTypedefTag_test.go create mode 100644 internal/fourslash/tests/gen/quickInfoUniqueSymbolJsDoc_test.go diff --git a/internal/fourslash/tests/gen/completionDetailsOfContextSensitiveParameterNoCrash_test.go b/internal/fourslash/tests/gen/completionDetailsOfContextSensitiveParameterNoCrash_test.go new file mode 100644 index 0000000000..44adbe8bd4 --- /dev/null +++ b/internal/fourslash/tests/gen/completionDetailsOfContextSensitiveParameterNoCrash_test.go @@ -0,0 +1,103 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionDetailsOfContextSensitiveParameterNoCrash(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @strict: true +type __ = never; + +interface CurriedFunction1 { + (): CurriedFunction1; + (t1: T1): R; +} +interface CurriedFunction2 { + (): CurriedFunction2; + (t1: T1): CurriedFunction1; + (t1: __, t2: T2): CurriedFunction1; + (t1: T1, t2: T2): R; +} + +interface CurriedFunction3 { + (): CurriedFunction3; + (t1: T1): CurriedFunction2; + (t1: __, t2: T2): CurriedFunction2; + (t1: T1, t2: T2): CurriedFunction1; + (t1: __, t2: __, t3: T3): CurriedFunction2; + (t1: T1, t2: __, t3: T3): CurriedFunction1; + (t1: __, t2: T2, t3: T3): CurriedFunction1; + (t1: T1, t2: T2, t3: T3): R; +} + +interface CurriedFunction4 { + (): CurriedFunction4; + (t1: T1): CurriedFunction3; + (t1: __, t2: T2): CurriedFunction3; + (t1: T1, t2: T2): CurriedFunction2; + (t1: __, t2: __, t3: T3): CurriedFunction3; + (t1: __, t2: __, t3: T3): CurriedFunction2; + (t1: __, t2: T2, t3: T3): CurriedFunction2; + (t1: T1, t2: T2, t3: T3): CurriedFunction1; + (t1: __, t2: __, t3: __, t4: T4): CurriedFunction3; + (t1: T1, t2: __, t3: __, t4: T4): CurriedFunction2; + (t1: __, t2: T2, t3: __, t4: T4): CurriedFunction2; + (t1: __, t2: __, t3: T3, t4: T4): CurriedFunction2; + (t1: T1, t2: T2, t3: __, t4: T4): CurriedFunction1; + (t1: T1, t2: __, t3: T3, t4: T4): CurriedFunction1; + (t1: __, t2: T2, t3: T3, t4: T4): CurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: T4): R; +} + +declare var curry: { + (func: (t1: T1) => R, arity?: number): CurriedFunction1; + (func: (t1: T1, t2: T2) => R, arity?: number): CurriedFunction2; + (func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): CurriedFunction3; + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): CurriedFunction4; + (func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + placeholder: __; +}; + +export type StylingFunction = ( + keys: (string | false | undefined) | (string | false | undefined)[], + ...rest: unknown[] +) => object; + +declare const getStylingByKeys: ( + mergedStyling: object, + keys: (string | false | undefined) | (string | false | undefined)[], + ...args: unknown[] +) => object; + +declare var mergedStyling: object; + +export const createStyling: CurriedFunction3< + (base16Theme: object) => unknown, + object | undefined, + object | undefined, + StylingFunction +> = curry< + (base16Theme: object) => unknown, + object | undefined, + object | undefined, + StylingFunction +>( + ( + getStylingFromBase16: (base16Theme: object) => unknown, + options: object = {}, + themeOrStyling: object = {}, + ...args + ): StylingFunction => { + return curry(getStylingByKeys, 2)(mergedStyling, .../**/args); + }, + 3 +);` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/deprecatedInheritedJSDocOverload_test.go b/internal/fourslash/tests/gen/deprecatedInheritedJSDocOverload_test.go new file mode 100644 index 0000000000..2809e29c6c --- /dev/null +++ b/internal/fourslash/tests/gen/deprecatedInheritedJSDocOverload_test.go @@ -0,0 +1,41 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestDeprecatedInheritedJSDocOverload(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface PartialObserver {} +interface Subscription {} +interface Unsubscribable {} + +export interface Subscribable { + subscribe(observer?: PartialObserver): Unsubscribable; + /** @deprecated Base deprecation 1 */ + subscribe(next: null | undefined, error: null | undefined, complete: () => void): Unsubscribable; + /** @deprecated Base deprecation 2 */ + subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Unsubscribable; + /** @deprecated Base deprecation 3 */ + subscribe(next: (value: T) => void, error: null | undefined, complete: () => void): Unsubscribable; + subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Unsubscribable; +} +interface ThingWithDeprecations extends Subscribable { + subscribe(observer?: PartialObserver): Subscription; + /** @deprecated 'real' deprecation */ + subscribe(next: null | undefined, error: null | undefined, complete: () => void): Subscription; + /** @deprecated 'real' deprecation */ + subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Subscription; +} +declare const a: ThingWithDeprecations +a.subscribe/**/(() => { + console.log('something happened'); +});` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsDocAliasQuickInfo_test.go b/internal/fourslash/tests/gen/jsDocAliasQuickInfo_test.go new file mode 100644 index 0000000000..45b3996e24 --- /dev/null +++ b/internal/fourslash/tests/gen/jsDocAliasQuickInfo_test.go @@ -0,0 +1,24 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsDocAliasQuickInfo(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /jsDocAliasQuickInfo.ts +/** + * Comment + * @type {number} + */ +export /*1*/default 10; +// @Filename: /test.ts +export { /*2*/default as /*3*/test } from "./jsDocAliasQuickInfo";` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsDocTypeTagQuickInfo1_test.go b/internal/fourslash/tests/gen/jsDocTypeTagQuickInfo1_test.go new file mode 100644 index 0000000000..2177c99fcd --- /dev/null +++ b/internal/fourslash/tests/gen/jsDocTypeTagQuickInfo1_test.go @@ -0,0 +1,44 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsDocTypeTagQuickInfo1(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: jsDocTypeTag1.js +/** @type {String} */ +var /*1*/S; +/** @type {Number} */ +var /*2*/N; +/** @type {Boolean} */ +var /*3*/B; +/** @type {Void} */ +var /*4*/V; +/** @type {Undefined} */ +var /*5*/U; +/** @type {Null} */ +var /*6*/Nl; +/** @type {Array} */ +var /*7*/A; +/** @type {Promise} */ +var /*8*/P; +/** @type {Object} */ +var /*9*/Obj; +/** @type {Function} */ +var /*10*/Func; +/** @type {*} */ +var /*11*/AnyType; +/** @type {?} */ +var /*12*/QType; +/** @type {String|Number} */ +var /*13*/SOrN;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsDocTypeTagQuickInfo2_test.go b/internal/fourslash/tests/gen/jsDocTypeTagQuickInfo2_test.go new file mode 100644 index 0000000000..0b8806fbe5 --- /dev/null +++ b/internal/fourslash/tests/gen/jsDocTypeTagQuickInfo2_test.go @@ -0,0 +1,42 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsDocTypeTagQuickInfo2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: jsDocTypeTag2.js +/** @type {string} */ +var /*1*/s; +/** @type {number} */ +var /*2*/n; +/** @type {boolean} */ +var /*3*/b; +/** @type {void} */ +var /*4*/v; +/** @type {undefined} */ +var /*5*/u; +/** @type {null} */ +var /*6*/nl; +/** @type {array} */ +var /*7*/a; +/** @type {promise} */ +var /*8*/p; +/** @type {?number} */ +var /*9*/nullable; +/** @type {function} */ +var /*10*/func; +/** @type {function (number): number} */ +var /*11*/func1; +/** @type {string | number} */ +var /*12*/sOrn;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsDocTypedefQuickInfo1_test.go b/internal/fourslash/tests/gen/jsDocTypedefQuickInfo1_test.go new file mode 100644 index 0000000000..f4a36af122 --- /dev/null +++ b/internal/fourslash/tests/gen/jsDocTypedefQuickInfo1_test.go @@ -0,0 +1,44 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsDocTypedefQuickInfo1(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: jsDocTypedef1.js +/** + * @typedef {Object} Opts + * @property {string} x + * @property {string=} y + * @property {string} [z] + * @property {string} [w="hi"] + * + * @param {Opts} opts + */ +function foo(/*1*/opts) { + opts.x; +} +foo({x: 'abc'}); +/** + * @typedef {object} Opts1 + * @property {string} x + * @property {string=} y + * @property {string} [z] + * @property {string} [w="hi"] + * + * @param {Opts1} opts + */ +function foo1(/*2*/opts1) { + opts1.x; +} +foo1({x: 'abc'});` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsdocLink1_test.go b/internal/fourslash/tests/gen/jsdocLink1_test.go new file mode 100644 index 0000000000..7476f121f2 --- /dev/null +++ b/internal/fourslash/tests/gen/jsdocLink1_test.go @@ -0,0 +1,28 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsdocLink1(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class C { +} +/** + * {@link C} + * @wat Makes a {@link C}. A default one. + * {@link C()} + * {@link C|postfix text} + * {@link unformatted postfix text} + * @see {@link C} its great + */ +function /**/CC() { +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsdocLink2_test.go b/internal/fourslash/tests/gen/jsdocLink2_test.go new file mode 100644 index 0000000000..5058b64a72 --- /dev/null +++ b/internal/fourslash/tests/gen/jsdocLink2_test.go @@ -0,0 +1,30 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsdocLink2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: jsdocLink2.ts +class C { +} +// @Filename: script.ts +/** + * {@link C} + * @wat Makes a {@link C}. A default one. + * {@link C()} + * {@link C|postfix text} + * {@link unformatted postfix text} + * @see {@link C} its great + */ +function /**/CC() { +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsdocLink3_test.go b/internal/fourslash/tests/gen/jsdocLink3_test.go new file mode 100644 index 0000000000..ec3606c751 --- /dev/null +++ b/internal/fourslash/tests/gen/jsdocLink3_test.go @@ -0,0 +1,31 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsdocLink3(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /jsdocLink3.ts +export class C { +} +// @Filename: /module1.ts +import { C } from './jsdocLink3' +/** + * {@link C} + * @wat Makes a {@link C}. A default one. + * {@link C()} + * {@link C|postfix text} + * {@link unformatted postfix text} + * @see {@link C} its great + */ +function /**/CC() { +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsdocLink4_test.go b/internal/fourslash/tests/gen/jsdocLink4_test.go new file mode 100644 index 0000000000..a860c38109 --- /dev/null +++ b/internal/fourslash/tests/gen/jsdocLink4_test.go @@ -0,0 +1,30 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsdocLink4(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `declare class I { + /** {@link I} */ + bar/*1*/(): void +} +/** {@link I} */ +var n/*2*/ = 1 +/** + * A real, very serious {@link I to an interface}. Right there. + * @param x one {@link Pos here too} + */ +function f(x) { +} +f/*3*/() +type Pos = [number, number]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsdocLink5_test.go b/internal/fourslash/tests/gen/jsdocLink5_test.go new file mode 100644 index 0000000000..483ae6df73 --- /dev/null +++ b/internal/fourslash/tests/gen/jsdocLink5_test.go @@ -0,0 +1,24 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsdocLink5(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `function g() { } +/** + * {@link g()} {@link g() } {@link g ()} {@link g () 0} {@link g()1} {@link g() 2} + * {@link u()} {@link u() } {@link u ()} {@link u () 0} {@link u()1} {@link u() 2} + */ +function f(x) { +} +f/*3*/()` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsdocLink6_test.go b/internal/fourslash/tests/gen/jsdocLink6_test.go new file mode 100644 index 0000000000..bafe0bbb1f --- /dev/null +++ b/internal/fourslash/tests/gen/jsdocLink6_test.go @@ -0,0 +1,26 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsdocLink6(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @filename: /a.ts +export default function A() { } +export function B() { }; +// @Filename: /b.ts +import A, { B } from "./a"; +/** + * {@link A} + * {@link B} + */ +export default function /**/f() { }` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsdocOnInheritedMembers1_test.go b/internal/fourslash/tests/gen/jsdocOnInheritedMembers1_test.go new file mode 100644 index 0000000000..99aebc7f3e --- /dev/null +++ b/internal/fourslash/tests/gen/jsdocOnInheritedMembers1_test.go @@ -0,0 +1,32 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsdocOnInheritedMembers1(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @checkJs: true +// @filename: /a.js +/** @template T */ +class A { + /** Method documentation. */ + method() {} +} + +/** @extends {A} */ +class B extends A { + method() {} +} + +const b = new B(); +b.method/**/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/jsdocOnInheritedMembers2_test.go b/internal/fourslash/tests/gen/jsdocOnInheritedMembers2_test.go new file mode 100644 index 0000000000..cf5051fcb4 --- /dev/null +++ b/internal/fourslash/tests/gen/jsdocOnInheritedMembers2_test.go @@ -0,0 +1,32 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsdocOnInheritedMembers2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @checkJs: true +// @filename: /a.js +/** @template T */ +class A { + /** Method documentation. */ + method() {} +} + +/** @extends {A} */ +const B = class extends A { + method() {} +} + +const b = new B(); +b.method/**/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoAlias_test.go b/internal/fourslash/tests/gen/quickInfoAlias_test.go new file mode 100644 index 0000000000..f7a5a0edec --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoAlias_test.go @@ -0,0 +1,38 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoAlias(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /a.ts +/** + * Doc + * @tag Tag text + */ +export const x = 0; +// @Filename: /b.ts +import { x } from "./a"; +x/*b*/; +// @Filename: /c.ts +/** + * Doc 2 + * @tag Tag text 2 + */ +import { + /** + * Doc 3 + * @tag Tag text 3 + */ + x +} from "./a"; +x/*c*/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoAtPropWithAmbientDeclarationInJs_test.go b/internal/fourslash/tests/gen/quickInfoAtPropWithAmbientDeclarationInJs_test.go new file mode 100644 index 0000000000..d6236751d7 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoAtPropWithAmbientDeclarationInJs_test.go @@ -0,0 +1,27 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoAtPropWithAmbientDeclarationInJs(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @filename: /a.js +class C { + constructor() { + this.prop = ""; + } + declare prop: string; + method() { + this.prop.foo/**/ + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoCircularInstantiationExpression_test.go b/internal/fourslash/tests/gen/quickInfoCircularInstantiationExpression_test.go new file mode 100644 index 0000000000..d15d3bdd9a --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoCircularInstantiationExpression_test.go @@ -0,0 +1,18 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoCircularInstantiationExpression(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `declare function foo(t: T): typeof foo; +/**/foo("");` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoCommentsClassMembers_test.go b/internal/fourslash/tests/gen/quickInfoCommentsClassMembers_test.go new file mode 100644 index 0000000000..faa643b8df --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoCommentsClassMembers_test.go @@ -0,0 +1,147 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoCommentsClassMembers(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** This is comment for c1*/ +class c/*1*/1 { + /** p1 is property of c1*/ + public p/*2*/1: number; + /** sum with property*/ + public p/*3*/2(/** number to add*/b: number) { + return this.p1 + b; + } + /** getter property 1*/ + public get p/*6*/3() { + return this.p/*8q*/2(this.p1); + } + /** setter property 1*/ + public set p/*10*/3(/** this is value*/value: number) { + this.p1 = this.p/*13q*/2(value); + } + /** pp1 is property of c1*/ + private p/*14*/p1: number; + /** sum with property*/ + private p/*15*/p2(/** number to add*/b: number) { + return this.p1 + b; + } + /** getter property 2*/ + private get p/*18*/p3() { + return this.p/*20q*/p2(this.pp1); + } + /** setter property 2*/ + private set p/*22*/p3( /** this is value*/value: number) { + this.pp1 = this.p/*25q*/p2(value); + } + /** Constructor method*/ + constru/*26*/ctor() { + } + /** s1 is static property of c1*/ + static s/*27*/1: number; + /** static sum with property*/ + static s/*28*/2(/** number to add*/b: number) { + return c1.s1 + b; + } + /** static getter property*/ + static get s/*32*/3() { + return c1.s/*35q*/2(c1.s1); + } + /** setter property 3*/ + static set s/*37*/3( /** this is value*/value: number) { + c1.s1 = c1.s/*42q*/2(value); + } + public nc_/*43*/p1: number; + public nc_/*44*/p2(b: number) { + return this.nc_p1 + b; + } + public get nc_/*46*/p3() { + return this.nc/*47q*/_p2(this.nc_p1); + } + public set nc/*48*/_p3(value: number) { + this.nc_p1 = this.nc/*49q*/_p2(value); + } + private nc/*50*/_pp1: number; + private nc_/*51*/pp2(b: number) { + return this.nc_pp1 + b; + } + private get nc/*53*/_pp3() { + return this.nc_/*54q*/pp2(this.nc_pp1); + } + private set nc_p/*55*/p3(value: number) { + this.nc_pp1 = this./*56q*/nc_pp2(value); + } + static nc/*57*/_s1: number; + static nc/*58*/_s2(b: number) { + return c1.nc_s1 + b; + } + static get nc/*60*/_s3() { + return c1.nc/*61q*/_s2(c1.nc_s1); + } + static set nc/*62*/_s3(value: number) { + c1.nc_s1 = c1.nc_/*63q*/s2(value); + } +} +var i/*64*/1 = new c/*65q*/1(); +var i1/*66*/_p = i1.p1; +var i1/*68*/_f = i1.p/*69*/2; +var i1/*70*/_r = i1.p/*71q*/2(20); +var i1_p/*72*/rop = i1./*73*/p3; +i1./*74*/p3 = i1_/*75*/prop; +var i1_/*76*/nc_p = i1.n/*77*/c_p1; +var i1/*78*/_ncf = i1.nc_/*79*/p2; +var i1_/*80*/ncr = i1.nc/*81q*/_p2(20); +var i1_n/*82*/cprop = i1.n/*83*/c_p3; +i1.nc/*84*/_p3 = i1_/*85*/ncprop; +var i1_/*86*/s_p = /*87*/c1./*88*/s1; +var i1_s/*89*/_f = c1./*90*/s2; +var i1_/*91*/s_r = c1.s/*92q*/2(20); +var i1_s/*93*/_prop = c1.s/*94*/3; +c1.s/*95*/3 = i1_s/*96*/_prop; +var i1_s/*97*/_nc_p = c1.n/*98*/c_s1; +var i1_s_/*99*/ncf = c1.nc/*100*/_s2; +var i1_s_/*101*/ncr = c1.n/*102q*/c_s2(20); +var i1_s_n/*103*/cprop = c1.nc/*104*/_s3; +c1.nc/*105*/_s3 = i1_s_nc/*106*/prop; +var i1/*107*/_c = c/*108*/1; + +class cProperties { + private val: number; + /** getter only property*/ + public get p1() { + return this.val; + } + public get nc_p1() { + return this.val; + } + /**setter only property*/ + public set p2(value: number) { + this.val = value; + } + public set nc_p2(value: number) { + this.val = value; + } +} +var cProperties_i = new cProperties(); +cProperties_i./*110*/p2 = cProperties_i.p/*111*/1; +cProperties_i.nc/*112*/_p2 = cProperties_i.nc/*113*/_p1; +class cWithConstructorProperty { + /** + * this is class cWithConstructorProperty's constructor + * @param a this is first parameter a + */ + /*119*/constructor(/**more info about a*/public a: number) { + var b/*118*/bbb = 10; + th/*116*/is./*114*/a = /*115*/a + 2 + bb/*117*/bb; + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoCommentsClass_test.go b/internal/fourslash/tests/gen/quickInfoCommentsClass_test.go new file mode 100644 index 0000000000..1f5b401950 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoCommentsClass_test.go @@ -0,0 +1,73 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoCommentsClass(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** This is class c2 without constructor*/ +class c/*1*/2 { +} +var i/*2*/2 = new c/*28*/2(); +var i2/*4*/_c = c/*5*/2; +class c/*6*/3 { + /** Constructor comment*/ + constructor() { + } +} +var i/*7*/3 = new c/*29*/3(); +var i3/*9*/_c = c/*10*/3; +/** Class comment*/ +class c/*11*/4 { + /** Constructor comment*/ + constructor() { + } +} +var i/*12*/4 = new c/*30*/4(); +var i4/*14*/_c = c/*15*/4; +/** Class with statics*/ +class c/*16*/5 { + static s1: number; +} +var i/*17*/5 = new c/*31*/5(); +var i5_/*19*/c = c/*20*/5; +/** class with statics and constructor*/ +class c/*21*/6 { + /** s1 comment*/ + static s1: number; + /** constructor comment*/ + constructor() { + } +} +var i/*22*/6 = new c/*32*/6(); +var i6/*24*/_c = c/*25*/6; + +class a { + /** + constructor for a + @param a this is my a + */ + constructor(a: string) { + } +} +new a("Hello"); +module m { + export module m2 { + /** class comment */ + export class c1 { + /** constructor comment*/ + constructor() { + } + } + } +} +var myVar = new m.m2.c/*33*/1();` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoCommentsCommentParsing_test.go b/internal/fourslash/tests/gen/quickInfoCommentsCommentParsing_test.go new file mode 100644 index 0000000000..32ff2882da --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoCommentsCommentParsing_test.go @@ -0,0 +1,217 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoCommentsCommentParsing(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/// This is simple /// comments +function simple() { +} + +sim/*1q*/ple( ); + +/// multiLine /// Comments +/// This is example of multiline /// comments +/// Another multiLine +function multiLine() { +} +mul/*2q*/tiLine( ); + +/** this is eg of single line jsdoc style comment */ +function jsDocSingleLine() { +} +jsDoc/*3q*/SingleLine(); + + +/** this is multiple line jsdoc stule comment +*New line1 +*New Line2*/ +function jsDocMultiLine() { +} +jsDocM/*4q*/ultiLine(); + +/** multiple line jsdoc comments no longer merge +*New line1 +*New Line2*/ +/** Shoul mege this line as well +* and this too*/ /** Another this one too*/ +function jsDocMultiLineMerge() { +} +jsDocMu/*5q*/ltiLineMerge(); + + +/// Triple slash comment +/** jsdoc comment */ +function jsDocMixedComments1() { +} +jsDocMix/*6q*/edComments1(); + +/// Triple slash comment +/** jsdoc comment */ /** another jsDocComment*/ +function jsDocMixedComments2() { +} +jsDocMi/*7q*/xedComments2(); + +/** jsdoc comment */ /*** triplestar jsDocComment*/ +/// Triple slash comment +function jsDocMixedComments3() { +} +jsDocMixe/*8q*/dComments3(); + +/** jsdoc comment */ /** another jsDocComment*/ +/// Triple slash comment +/// Triple slash comment 2 +function jsDocMixedComments4() { +} +jsDocMixed/*9q*/Comments4(); + +/// Triple slash comment 1 +/** jsdoc comment */ /** another jsDocComment*/ +/// Triple slash comment +/// Triple slash comment 2 +function jsDocMixedComments5() { +} +jsDocM/*10q*/ixedComments5(); + +/** another jsDocComment*/ +/// Triple slash comment 1 +/// Triple slash comment +/// Triple slash comment 2 +/** jsdoc comment */ +function jsDocMixedComments6() { +} +jsDocMix/*11q*/edComments6(); + +// This shoulnot be help comment +function noHelpComment1() { +} +noHel/*12q*/pComment1(); + +/* This shoulnot be help comment */ +function noHelpComment2() { +} +noHelpC/*13q*/omment2(); + +function noHelpComment3() { +} +noHelpC/*14q*/omment3(); +/** Adds two integers and returns the result + * @param {number} a first number + * @param b second number + */ +function sum(/*16aq*/a: number, /*17aq*/b: number) { + return a + b; +} +s/*16q*/um(10, 20); +/** This is multiplication function + * @param + * @param a first number + * @param b + * @param c { + @param d @anotherTag + * @param e LastParam @anotherTag*/ +function multiply(/*19aq*/a: number, /*20aq*/b: number, /*21aq*/c?: number, /*22aq*/d?, /*23aq*/e?) { +} +mult/*19q*/iply(10, 20, 30, 40, 50); +/** fn f1 with number +* @param { string} b about b +*/ +function f1(/*25aq*/a: number); +function f1(/*26aq*/b: string); +/**@param opt optional parameter*/ +function f1(aOrb, opt?) { + return aOrb; +} +f/*25q*/1(10); +f/*26q*/1("hello"); + +/** This is subtract function +@param { a +*@param { number | } b this is about b +@param { { () => string; } } c this is optional param c +@param { { () => string; } d this is optional param d +@param { { () => string; } } e this is optional param e +@param { { { () => string; } } f this is optional param f +*/ +function subtract(/*28aq*/a: number, /*29aq*/b: number, /*30aq*/c?: () => string, /*31aq*/d?: () => string, /*32aq*/e?: () => string, /*33aq*/f?: () => string) { +} +subt/*28q*/ract(10, 20, null, null, null, null); +/** this is square function +@paramTag { number } a this is input number of paramTag +@param { number } a this is input number +@returnType { number } it is return type +*/ +function square(/*34aq*/a: number) { + return a * a; +} +squ/*34q*/are(10); +/** this is divide function +@param { number} a this is a +@paramTag { number } g this is optional param g +@param { number} b this is b +*/ +function divide(/*35aq*/a: number, /*36aq*/b: number) { +} +div/*35q*/ide(10, 20); +/** +Function returns string concat of foo and bar +@param {string} foo is string +@param {string} bar is second string +*/ +function fooBar(/*37aq*/foo: string, /*38aq*/bar: string) { + return foo + bar; +} +fo/*37q*/oBar("foo","bar"); +/** This is a comment */ +var x; +/** + * This is a comment + */ +var y; +/** 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 +*/ +function jsDocParamTest(/** this is inline comment for a *//*40aq*/a: number, /** this is inline comment for b*/ /*41aq*/b: number, /*42aq*/c: number, /*43aq*/d: number) { + return a + b + c + d; +} +jsD/*40q*/ocParamTest(30, 40, 50, 60); +/** This is function comment + * And properly aligned comment + */ +function jsDocCommentAlignmentTest1() { +} +jsDocCom/*45q*/mentAlignmentTest1(); +/** This is function comment + * And aligned with 4 space char margin + */ +function jsDocCommentAlignmentTest2() { +} +jsDocComme/*46q*/ntAlignmentTest2(); +/** This is function comment + * And aligned with 4 space char margin + * @param {string} 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 + */ +function jsDocCommentAlignmentTest3(/*47aq*/a: string, /*48aq*/b, /*49aq*/c) { +} +jsDocComme/*47q*/ntAlignmentTest3("hello",1, 2); +/**/ +class NoQuic/*50q*/kInfoClass { +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoCommentsFunctionDeclaration_test.go b/internal/fourslash/tests/gen/quickInfoCommentsFunctionDeclaration_test.go new file mode 100644 index 0000000000..afcbdbdee2 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoCommentsFunctionDeclaration_test.go @@ -0,0 +1,33 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoCommentsFunctionDeclaration(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** This comment should appear for foo*/ +function f/*1*/oo() { +} +f/*2*/oo(); +/** This is comment for function signature*/ +function fo/*5*/oWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var /*6*/d = a; +} +fooWithParam/*8*/eters("a",10); +/** +* Does something +* @param a a string +*/ +declare function fn(a: string); +fn("hello");` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoCommentsFunctionExpression_test.go b/internal/fourslash/tests/gen/quickInfoCommentsFunctionExpression_test.go new file mode 100644 index 0000000000..bd9a8999d8 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoCommentsFunctionExpression_test.go @@ -0,0 +1,42 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoCommentsFunctionExpression(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** lambdaFoo var comment*/ +var lamb/*1*/daFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => a + b; +var lambddaN/*3*/oVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b; +lambdaFoo(10, 20); +function /*7*/anotherFunc(a: number) { + /** documentation + @param b {string} inner parameter */ + var /*8*/lambdaVar = /** inner docs */(/*9*/b: string) => { + var /*10*/localVar = "Hello "; + return /*11*/localVar + /*12*/b; + } + return lamb/*13*/daVar("World") + a; +} +/** + * On variable + * @param s the first parameter! + * @returns the parameter's length + */ +var assi/*14*/gned = /** + * Summary on expression + * @param s param on expression + * @returns return on expression + */function(/** On parameter */s: string) { + return s.length; +} +assig/*16*/ned("hey");` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsArrowFunctionExpression_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsArrowFunctionExpression_test.go new file mode 100644 index 0000000000..2e8c09687e --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsArrowFunctionExpression_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsArrowFunctionExpression(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `var /*1*/x = /*5*/a => 10; +var /*2*/y = (/*6*/a, /*7*/b) => 10; +var /*3*/z = (/*8*/a: number) => 10; +var /*4*/z2 = () => 10;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsClassAccessors_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassAccessors_test.go new file mode 100644 index 0000000000..53e644e410 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassAccessors_test.go @@ -0,0 +1,51 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsClassAccessors(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class c { + public get /*1*/publicProperty() { return ""; } + public set /*1s*/publicProperty(x: string) { } + private get /*2*/privateProperty() { return ""; } + private set /*2s*/privateProperty(x: string) { } + protected get /*21*/protectedProperty() { return ""; } + protected set /*21s*/protectedProperty(x: string) { } + static get /*3*/staticProperty() { return ""; } + static set /*3s*/staticProperty(x: string) { } + private static get /*4*/privateStaticProperty() { return ""; } + private static set /*4s*/privateStaticProperty(x: string) { } + protected static get /*41*/protectedStaticProperty() { return ""; } + protected static set /*41s*/protectedStaticProperty(x: string) { } + method() { + var x : string; + x = this./*5*/publicProperty; + x = this./*6*/privateProperty; + x = this./*61*/protectedProperty; + x = c./*7*/staticProperty; + x = c./*8*/privateStaticProperty; + x = c./*81*/protectedStaticProperty; + this./*5s*/publicProperty = ""; + this./*6s*/privateProperty = ""; + this./*61s*/protectedProperty = ""; + c./*7s*/staticProperty = ""; + c./*8s*/privateStaticProperty = ""; + c./*81s*/protectedStaticProperty = ""; + } +} +var cInstance = new c(); +var y: string; +y = /*9*/cInstance./*10*/publicProperty; +y = /*11*/c./*12*/staticProperty; +/*9s*/cInstance./*10s*/publicProperty = y; +/*11s*/c./*12s*/staticProperty = y;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsClassAutoAccessors_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassAutoAccessors_test.go new file mode 100644 index 0000000000..577b42a133 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassAutoAccessors_test.go @@ -0,0 +1,45 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsClassAutoAccessors(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class c { + public accessor /*1a*/publicProperty: string; + private accessor /*2a*/privateProperty: string; + protected accessor /*3a*/protectedProperty: string; + static accessor /*4a*/staticProperty: string; + private static accessor /*5a*/privateStaticProperty: string; + protected static accessor /*6a*/protectedStaticProperty: string; + method() { + var x: string; + x = this./*1g*/publicProperty; + x = this./*2g*/privateProperty; + x = this./*3g*/protectedProperty; + x = c./*4g*/staticProperty; + x = c./*5g*/privateStaticProperty; + x = c./*6g*/protectedStaticProperty; + this./*1s*/publicProperty = ""; + this./*2s*/privateProperty = ""; + this./*3s*/protectedProperty = ""; + c./*4s*/staticProperty = ""; + c./*5s*/privateStaticProperty = ""; + c./*6s*/protectedStaticProperty = ""; + } +} +var cInstance = new c(); +var y: string; +y = /*7g*/cInstance./*8g*/publicProperty; +y = /*9g*/c./*10g*/staticProperty; +/*7s*/cInstance./*8s*/publicProperty = y; +/*9s*/c./*10s*/staticProperty = y;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsClassConstructor_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassConstructor_test.go new file mode 100644 index 0000000000..e6ec49c63f --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassConstructor_test.go @@ -0,0 +1,42 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsClassConstructor(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class c { + /*1*/constructor() { + } +} +var /*2*/cInstance = new /*3*/c(); +var /*4*/cVal = /*5*/c; +class cWithOverloads { + /*6*/constructor(x: string); + /*7*/constructor(x: number); + /*8*/constructor(x: any) { + } +} +var /*9*/cWithOverloadsInstance = new /*10*/cWithOverloads("hello"); +var /*11*/cWithOverloadsInstance2 = new /*12*/cWithOverloads(10); +var /*13*/cWithOverloadsVal = /*14*/cWithOverloads; +class cWithMultipleOverloads { + /*15*/constructor(x: string); + /*16*/constructor(x: number); + /*17*/constructor(x: boolean); + /*18*/constructor(x: any) { + } +} +var /*19*/cWithMultipleOverloadsInstance = new /*20*/cWithMultipleOverloads("hello"); +var /*21*/cWithMultipleOverloadsInstance2 = new /*22*/cWithMultipleOverloads(10); +var /*23*/cWithMultipleOverloadsInstance3 = new /*24*/cWithMultipleOverloads(true); +var /*25*/cWithMultipleOverloadsVal = /*26*/cWithMultipleOverloads;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsClassDefaultAnonymous_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassDefaultAnonymous_test.go new file mode 100644 index 0000000000..5460a2d488 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassDefaultAnonymous_test.go @@ -0,0 +1,18 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsClassDefaultAnonymous(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/*1*/export /*2*/default /*3*/class /*4*/ { +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsClassDefaultNamed_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassDefaultNamed_test.go new file mode 100644 index 0000000000..4542e33a59 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassDefaultNamed_test.go @@ -0,0 +1,18 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsClassDefaultNamed(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/*1*/export /*2*/default /*3*/class /*4*/C /*5*/ { +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsClassIncomplete_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassIncomplete_test.go new file mode 100644 index 0000000000..9732f71c2f --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassIncomplete_test.go @@ -0,0 +1,18 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsClassIncomplete(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/*1*/class /*2*/ { +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsClassMethod_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassMethod_test.go new file mode 100644 index 0000000000..76970f3628 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassMethod_test.go @@ -0,0 +1,35 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsClassMethod(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class c { + public /*1*/publicMethod() { } + private /*2*/privateMethod() { } + protected /*21*/protectedMethod() { } + static /*3*/staticMethod() { } + private static /*4*/privateStaticMethod() { } + protected static /*41*/protectedStaticMethod() { } + method() { + this./*5*/publicMethod(); + this./*6*/privateMethod(); + this./*61*/protectedMethod(); + c./*7*/staticMethod(); + c./*8*/privateStaticMethod(); + c./*81*/protectedStaticMethod(); + } +} +var cInstance = new c(); +/*9*/cInstance./*10*/publicMethod(); +/*11*/c./*12*/staticMethod();` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsClassProperty_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassProperty_test.go new file mode 100644 index 0000000000..bd3b3cbad7 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsClassProperty_test.go @@ -0,0 +1,35 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsClassProperty(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class c { + public /*1*/publicProperty: string; + private /*2*/privateProperty: string; + protected /*21*/protectedProperty: string; + static /*3*/staticProperty: string; + private static /*4*/privateStaticProperty: string; + protected static /*41*/protectedStaticProperty: string; + method() { + this./*5*/publicProperty; + this./*6*/privateProperty; + this./*61*/protectedProperty; + c./*7*/staticProperty; + c./*8*/privateStaticProperty; + c./*81*/protectedStaticProperty; + } +} +var cInstance = new c(); +/*9*/cInstance./*10*/publicProperty; +/*11*/c./*12*/staticProperty;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsClass_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsClass_test.go new file mode 100644 index 0000000000..8e87c381ef --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsClass_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsClass(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class /*1*/c { +} +var /*2*/cInstance = new /*3*/c(); +var /*4*/cVal = /*5*/c;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsConst_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsConst_test.go new file mode 100644 index 0000000000..3bd17b058b --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsConst_test.go @@ -0,0 +1,37 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsConst(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `const /*1*/a = 10; +function foo() { + const /*2*/b = /*3*/a; + if (b) { + const /*4*/b1 = 10; + } +} +module m { + const /*5*/c = 10; + export const /*6*/d = 10; + if (c) { + const /*7*/e = 10; + } +} +const /*8*/f: () => number = () => 10; +const /*9*/g = /*10*/f; +/*11*/f(); +const /*12*/h: { (a: string): number; (a: number): string; } = a => a; +const /*13*/i = /*14*/h; +/*15*/h(10); +/*16*/h("hello");` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum1_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum1_test.go new file mode 100644 index 0000000000..ef29790f7c --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum1_test.go @@ -0,0 +1,34 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsEnum1(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `enum /*1*/E { + /*2*/e1, + /*3*/e2 = 10, + /*4*/e3 +} +var /*5*/eInstance: /*6*/E; +/*7*/eInstance = /*8*/E./*9*/e1; +/*10*/eInstance = /*11*/E./*12*/e2; +/*13*/eInstance = /*14*/E./*15*/e3; +const enum /*16*/constE { + /*17*/e1, + /*18*/e2 = 10, + /*19*/e3 +} +var /*20*/eInstance1: /*21*/constE; +/*22*/eInstance1 = /*23*/constE./*24*/e1; +/*25*/eInstance1 = /*26*/constE./*27*/e2; +/*28*/eInstance1 = /*29*/constE./*30*/e3;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum2_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum2_test.go new file mode 100644 index 0000000000..31c917f8e5 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum2_test.go @@ -0,0 +1,34 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsEnum2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `enum /*1*/E { + /*2*/"e1", + /*3*/'e2' = 10, + /*4*/"e3" +} +var /*5*/eInstance: /*6*/E; +/*7*/eInstance = /*8*/E./*9*/e1; +/*10*/eInstance = /*11*/E./*12*/e2; +/*13*/eInstance = /*14*/E./*15*/e3; +const enum /*16*/constE { + /*17*/"e1", + /*18*/'e2' = 10, + /*19*/"e3" +} +var /*20*/eInstance1: /*21*/constE; +/*22*/eInstance1 = /*23*/constE./*24*/e1; +/*25*/eInstance1 = /*26*/constE./*27*/e2; +/*28*/eInstance1 = /*29*/constE./*30*/e3;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum3_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum3_test.go new file mode 100644 index 0000000000..c7e5f21e8a --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum3_test.go @@ -0,0 +1,34 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsEnum3(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `enum /*1*/E { + /*2*/"e1", + /*3*/'e2' = 10, + /*4*/"e3" +} +var /*5*/eInstance: /*6*/E; +/*7*/eInstance = /*8*/E[/*9*/"e1"]; +/*10*/eInstance = /*11*/E[/*12*/"e2"]; +/*13*/eInstance = /*14*/E[/*15*/'e3']; +const enum /*16*/constE { + /*17*/"e1", + /*18*/'e2' = 10, + /*19*/"e3" +} +var /*20*/eInstance1: /*21*/constE; +/*22*/eInstance1 = /*23*/constE[/*24*/"e1"]; +/*25*/eInstance1 = /*26*/constE[/*27*/"e2"]; +/*28*/eInstance1 = /*29*/constE[/*30*/'e3'];` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum4_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum4_test.go new file mode 100644 index 0000000000..f87fee32ed --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsEnum4_test.go @@ -0,0 +1,22 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsEnum4(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `const enum Foo { + "\t" = 9, + "\u007f" = 127, +} +Foo[/*1*/"\t"] +Foo[/*2*/"\u007f"]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsExternalModuleAlias_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsExternalModuleAlias_test.go new file mode 100644 index 0000000000..8c808b11cf --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsExternalModuleAlias_test.go @@ -0,0 +1,26 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsExternalModuleAlias(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: quickInfoDisplayPartsExternalModuleAlias_file0.ts +export namespace m1 { + export class c { + } +} +// @Filename: quickInfoDisplayPartsExternalModuleAlias_file1.ts +import /*1*/a1 = require(/*mod1*/"./quickInfoDisplayPartsExternalModuleAlias_file0"); +new /*2*/a1.m1.c(); +export import /*3*/a2 = require(/*mod2*/"./quickInfoDisplayPartsExternalModuleAlias_file0"); +new /*4*/a2.m1.c();` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsExternalModules_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsExternalModules_test.go new file mode 100644 index 0000000000..0d2f3186cf --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsExternalModules_test.go @@ -0,0 +1,28 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsExternalModules(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `export namespace /*1*/m { + var /*2*/namespaceElemWithoutExport = 10; + export var /*3*/namespaceElemWithExport = 10; +} +export var /*4*/a = /*5*/m; +export var /*6*/b: typeof /*7*/m; +export namespace /*8*/m1./*9*/m2 { + var /*10*/namespaceElemWithoutExport = 10; + export var /*11*/namespaceElemWithExport = 10; +} +export var /*12*/x = /*13*/m1./*14*/m2; +export var /*15*/y: typeof /*16*/m1./*17*/m2;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsFunctionExpression_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsFunctionExpression_test.go new file mode 100644 index 0000000000..3b15870cd6 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsFunctionExpression_test.go @@ -0,0 +1,24 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsFunctionExpression(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `var /*1*/x = function /*2*/foo() { + /*3*/foo(); +}; +var /*4*/y = function () { +}; +(function /*5*/foo1() { + /*6*/foo1(); +})();` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsFunctionIncomplete_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsFunctionIncomplete_test.go new file mode 100644 index 0000000000..562abef5ca --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsFunctionIncomplete_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsFunctionIncomplete(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/*1*/function /*2*/(param: string) { +}\ +/*3*/function /*4*/ { +}\` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsFunction_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsFunction_test.go new file mode 100644 index 0000000000..636eddcf9d --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsFunction_test.go @@ -0,0 +1,35 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsFunction(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `function /*1*/foo(param: string, optionalParam?: string, paramWithInitializer = "hello", ...restParam: string[]) { +} +function /*2*/foowithoverload(a: string): string; +function /*3*/foowithoverload(a: number): number; +function /*4*/foowithoverload(a: any): any { + return a; +} +function /*5*/foowith3overload(a: string): string; +function /*6*/foowith3overload(a: number): number; +function /*7*/foowith3overload(a: boolean): boolean; +function /*8*/foowith3overload(a: any): any { + return a; +} +/*9*/foo("hello"); +/*10*/foowithoverload("hello"); +/*11*/foowithoverload(10); +/*12*/foowith3overload("hello"); +/*13*/foowith3overload(10); +/*14*/foowith3overload(true);` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsInterfaceMembers_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsInterfaceMembers_test.go new file mode 100644 index 0000000000..dba616f960 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsInterfaceMembers_test.go @@ -0,0 +1,26 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsInterfaceMembers(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface I { + /*1*/property: string; + /*2*/method(): string; + (): string; + new (): I; +} +var iInstance: I; +/*3*/iInstance./*4*/property = /*5*/iInstance./*6*/method(); +/*7*/iInstance(); +var /*8*/anotherInstance = new /*9*/iInstance();` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsInterface_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsInterface_test.go new file mode 100644 index 0000000000..328e3c9677 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsInterface_test.go @@ -0,0 +1,19 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsInterface(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface /*1*/i { +} +var /*2*/iInstance: /*3*/i;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsInternalModuleAlias_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsInternalModuleAlias_test.go new file mode 100644 index 0000000000..4181ee8727 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsInternalModuleAlias_test.go @@ -0,0 +1,30 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsInternalModuleAlias(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `module m.m1 { + export class c { + } +} +module m2 { + import /*1*/a1 = m; + new /*2*/a1.m1.c(); + import /*3*/a2 = m.m1; + new /*4*/a2.c(); + export import /*5*/a3 = m; + new /*6*/a3.m1.c(); + export import /*7*/a4 = m.m1; + new /*8*/a4.c(); +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsLet_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsLet_test.go new file mode 100644 index 0000000000..93b5723d96 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsLet_test.go @@ -0,0 +1,37 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsLet(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `let /*1*/a = 10; +function foo() { + let /*2*/b = /*3*/a; + if (b) { + let /*4*/b1 = 10; + } +} +module m { + let /*5*/c = 10; + export let /*6*/d = 10; + if (c) { + let /*7*/e = 10; + } +} +let /*8*/f: () => number; +let /*9*/g = /*10*/f; +/*11*/f(); +let /*12*/h: { (a: string): number; (a: number): string; }; +let /*13*/i = /*14*/h; +/*15*/h(10); +/*16*/h("hello");` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsLiteralLikeNames01_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsLiteralLikeNames01_test.go new file mode 100644 index 0000000000..f9ca088c1d --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsLiteralLikeNames01_test.go @@ -0,0 +1,29 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsLiteralLikeNames01(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class C { + public /*1*/1() { } + private /*2*/Infinity() { } + protected /*3*/NaN() { } + static /*4*/"stringLiteralName"() { } + method() { + this[/*5*/1](); + this[/*6*/"1"](); + this./*7*/Infinity(); + this[/*8*/"Infinity"](); + this./*9*/NaN(); + C./*10*/stringLiteralName(); + }` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsLocalFunction_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsLocalFunction_test.go new file mode 100644 index 0000000000..befbd1bbd0 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsLocalFunction_test.go @@ -0,0 +1,38 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsLocalFunction(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `function /*1*/outerFoo() { + function /*2*/foo(param: string, optionalParam?: string, paramWithInitializer = "hello", ...restParam: string[]) { + } + function /*3*/foowithoverload(a: string): string; + function /*4*/foowithoverload(a: number): number; + function /*5*/foowithoverload(a: any): any { + return a; + } + function /*6*/foowith3overload(a: string): string; + function /*7*/foowith3overload(a: number): number; + function /*8*/foowith3overload(a: boolean): boolean; + function /*9*/foowith3overload(a: any): any { + return a; + } + /*10*/foo("hello"); + /*11*/foowithoverload("hello"); + /*12*/foowithoverload(10); + /*13*/foowith3overload("hello"); + /*14*/foowith3overload(10); + /*15*/foowith3overload(true); +} +/*16*/outerFoo();` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsModules_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsModules_test.go new file mode 100644 index 0000000000..200246edb6 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsModules_test.go @@ -0,0 +1,28 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsModules(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `namespace /*1*/m { + var /*2*/namespaceElemWithoutExport = 10; + export var /*3*/namespaceElemWithExport = 10; +} +var /*4*/a = /*5*/m; +var /*6*/b: typeof /*7*/m; +namespace /*8*/m1./*9*/m2 { + var /*10*/namespaceElemWithoutExport = 10; + export var /*11*/namespaceElemWithExport = 10; +} +var /*12*/x = /*13*/m1./*14*/m2; +var /*15*/y: typeof /*16*/m1./*17*/m2;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsParameters_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsParameters_test.go new file mode 100644 index 0000000000..76852c7f18 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsParameters_test.go @@ -0,0 +1,23 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsParameters(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** @return *crunch* */ +function /*1*/foo(/*2*/param: string, /*3*/optionalParam?: string, /*4*/paramWithInitializer = "hello", .../*5*/restParam: string[]) { + /*6*/param = "Hello"; + /*7*/optionalParam = "World"; + /*8*/paramWithInitializer = "Hello"; + /*9*/restParam[0] = "World"; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeAlias_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeAlias_test.go new file mode 100644 index 0000000000..70a3b5bb66 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeAlias_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsTypeAlias(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class /*1*/c { +} +type /*2*/t1 = /*3*/c; +var /*4*/cInstance: /*5*/t1 = new /*6*/c();` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInClass_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInClass_test.go new file mode 100644 index 0000000000..51fddbad3f --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInClass_test.go @@ -0,0 +1,36 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsTypeParameterInClass(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class /*1*/c { + /*3*/constructor(/*4*/a: /*5*/T) { + } + /*6*/method(/*8*/a: /*9*/U, /*10*/b: /*11*/T) { + return /*12*/a; + } +} +var /*13*/cInstance = new /*14*/c("Hello"); +var /*15*/cVal = /*16*/c; +/*17*/cInstance./*18*/method("hello", "cello"); +class /*19*/c2> { + /*22*/constructor(/*23*/a: /*24*/T) { + } + /*25*/method>(/*28*/a: /*29*/U, /*30*/b: /*31*/T) { + return /*32*/a; + } +} +var /*33*/cInstance1 = new /*34*/c2(/*35*/cInstance); +var /*36*/cVal2 = /*37*/c2; +/*38*/cInstance1./*39*/method(/*40*/cInstance, /*41*/cInstance);` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias_test.go new file mode 100644 index 0000000000..bee4780541 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias_test.go @@ -0,0 +1,18 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `type MixinCtor = new () => /*0*/A & { constructor: MixinCtor }; +type MixinCtor = new () => A & { constructor: { constructor: MixinCtor } };` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInFunction_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInFunction_test.go new file mode 100644 index 0000000000..7e615154c1 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInFunction_test.go @@ -0,0 +1,24 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsTypeParameterInFunction(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `function /*1*/foo(/*3*/a: /*4*/U) { + return /*5*/a; +} +/*6*/foo("Hello"); +function /*7*/foo2(/*9*/a: /*10*/U) { + return /*11*/a; +} +/*12*/foo2("hello");` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInInterface_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInInterface_test.go new file mode 100644 index 0000000000..3ea87d1f8e --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInInterface_test.go @@ -0,0 +1,34 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsTypeParameterInInterface(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface /*1*/I { + new (/*4*/a: /*5*/U, /*6*/b: /*7*/T): /*8*/U; + (/*10*/a: /*11*/U, /*12*/b: /*13*/T): /*14*/U; + /*15*/method(/*17*/a: /*18*/U, /*19*/b: /*20*/T): /*21*/U; +} +var /*22*/iVal: /*23*/I; +new /*24*/iVal("hello", "hello"); +/*25*/iVal("hello", "hello"); +/*26*/iVal./*27*/method("hello", "hello"); +interface /*28*/I1> { + new >(/*33*/a: /*34*/U, /*35*/b: /*36*/T): /*37*/U; + >(/*40*/a: /*41*/U, /*42*/b: /*43*/T): /*44*/U; + /*45*/method>(/*48*/a: /*49*/U, /*50*/b: /*51*/T): /*52*/U; +} +var /*53*/iVal1: /*54*/I1>; +new /*56*/iVal1(/*57*/iVal, /*58*/iVal); +/*59*/iVal1(/*60*/iVal, /*61*/iVal); +/*62*/iVal1./*63*/method(/*64*/iVal, /*65*/iVal);` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInTypeAlias_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInTypeAlias_test.go new file mode 100644 index 0000000000..ebdf5f9b56 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsTypeParameterInTypeAlias_test.go @@ -0,0 +1,18 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsTypeParameterInTypeAlias(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `type /*0*/List = /*2*/T[] +type /*3*/List2 = /*5*/T[];` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsUsing_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsUsing_test.go new file mode 100644 index 0000000000..0dad94a076 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsUsing_test.go @@ -0,0 +1,21 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsUsing(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @lib: esnext +using a/*a*/ = "a"; +const f = async () => { + await using /*b*/b = { async [Symbol.asyncDispose]() {} }; +};` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsVarWithStringTypes01_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsVarWithStringTypes01_test.go new file mode 100644 index 0000000000..73632e3ba0 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsVarWithStringTypes01_test.go @@ -0,0 +1,19 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsVarWithStringTypes01(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `let /*1*/hello: "hello" | 'hello' = "hello"; +let /*2*/world: 'world' = "world"; +let /*3*/helloOrWorld: "hello" | 'world';` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoDisplayPartsVar_test.go b/internal/fourslash/tests/gen/quickInfoDisplayPartsVar_test.go new file mode 100644 index 0000000000..627416a60b --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoDisplayPartsVar_test.go @@ -0,0 +1,31 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoDisplayPartsVar(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `var /*1*/a = 10; +function foo() { + var /*2*/b = /*3*/a; +} +module m { + var /*4*/c = 10; + export var /*5*/d = 10; +} +var /*6*/f: () => number; +var /*7*/g = /*8*/f; +/*9*/f(); +var /*10*/h: { (a: string): number; (a: number): string; }; +var /*11*/i = /*12*/h; +/*13*/h(10); +/*14*/h("hello");` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoForArgumentsPropertyNameInJsMode1_test.go b/internal/fourslash/tests/gen/quickInfoForArgumentsPropertyNameInJsMode1_test.go new file mode 100644 index 0000000000..1c58c56b86 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoForArgumentsPropertyNameInJsMode1_test.go @@ -0,0 +1,27 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoForArgumentsPropertyNameInJsMode1(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @filename: a.js +const foo = { + f1: (params) => { } +} + +function /*1*/f2(x) { + foo.f1({ x, arguments: [] }); +} + +/*2*/f2('');` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoForArgumentsPropertyNameInJsMode2_test.go b/internal/fourslash/tests/gen/quickInfoForArgumentsPropertyNameInJsMode2_test.go new file mode 100644 index 0000000000..9c33885f9b --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoForArgumentsPropertyNameInJsMode2_test.go @@ -0,0 +1,23 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoForArgumentsPropertyNameInJsMode2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @filename: a.js +function /*1*/f(x) { + arguments; +} + +/*2*/f('');` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoForConstAssertions_test.go b/internal/fourslash/tests/gen/quickInfoForConstAssertions_test.go new file mode 100644 index 0000000000..7c9d5ef2da --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoForConstAssertions_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoForConstAssertions(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `const a = { a: 1 } as /*1*/const; +const b = 1 as /*2*/const; +const c = "c" as /*3*/const; +const d = [1, 2] as /*4*/const;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoForJSDocCodefence_test.go b/internal/fourslash/tests/gen/quickInfoForJSDocCodefence_test.go new file mode 100644 index 0000000000..eed7d58eaa --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoForJSDocCodefence_test.go @@ -0,0 +1,34 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoForJSDocCodefence(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** + * @example + * ` + "`" + `` + "`" + `` + "`" + ` + * 1 + 2 + * ` + "`" + `` + "`" + `` + "`" + ` + */ +function fo/*1*/o() { + return '2'; +} +/** + * @example + * ` + "`" + `` + "`" + ` + * 1 + 2 + * ` + "`" + ` + */ +function bo/*2*/o() { + return '2'; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoForJSDocUnknownTag_test.go b/internal/fourslash/tests/gen/quickInfoForJSDocUnknownTag_test.go new file mode 100644 index 0000000000..916dd6b255 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoForJSDocUnknownTag_test.go @@ -0,0 +1,62 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoForJSDocUnknownTag(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** + * @example + * if (true) { + * foo() + * } + */ +function fo/*1*/o() { + return '2'; +} +/** + @example + { + foo() + } + */ +function fo/*2*/o2() { + return '2'; +} +/** + * @example + * x y + * 12345 + * b + */ +function m/*3*/oo() { + return '2'; +} +/** + * @func + * @example + * x y + * 12345 + * b + */ +function b/*4*/oo() { + return '2'; +} +/** + * @func + * @example x y + * 12345 + * b + */ +function go/*5*/o() { + return '2'; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoForJSDocWithHttpLinks_test.go b/internal/fourslash/tests/gen/quickInfoForJSDocWithHttpLinks_test.go new file mode 100644 index 0000000000..99b6f089f4 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoForJSDocWithHttpLinks_test.go @@ -0,0 +1,36 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoForJSDocWithHttpLinks(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @checkJs: true +// @filename: quickInfoForJSDocWithHttpLinks.js +/** @typedef {number} /*1*/https://wat */ + +/** +* @typedef {Object} Oops +* @property {number} /*2*/https://wass +*/ + + +/** @callback /*3*/http://vad */ + +/** @see https://hvad */ +var /*4*/see1 = true + +/** @see {@link https://hva} */ +var /*5*/see2 = true + +/** {@link https://hvaD} */ +var /*6*/see3 = true` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoForJSDocWithUnresolvedHttpLinks_test.go b/internal/fourslash/tests/gen/quickInfoForJSDocWithUnresolvedHttpLinks_test.go new file mode 100644 index 0000000000..41e9f05262 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoForJSDocWithUnresolvedHttpLinks_test.go @@ -0,0 +1,23 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoForJSDocWithUnresolvedHttpLinks(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @checkJs: true +// @filename: quickInfoForJSDocWithHttpLinks.js +/** @see {@link https://hva} */ +var /*5*/see2 = true + +/** {@link https://hvaD} */ +var /*6*/see3 = true` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName03_test.go b/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName03_test.go new file mode 100644 index 0000000000..9caea690bd --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName03_test.go @@ -0,0 +1,26 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoForObjectBindingElementName03(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface Options { + /** + * A description of foo + */ + foo: string; +} + +function f({ foo }: Options) { + foo/*1*/; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName04_test.go b/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName04_test.go new file mode 100644 index 0000000000..89a61cd458 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName04_test.go @@ -0,0 +1,32 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoForObjectBindingElementName04(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface Options { + /** + * A description of 'a' + */ + a: { + /** + * A description of 'b' + */ + b: string; + } +} + +function f({ a, a: { b } }: Options) { + a/*1*/; + b/*2*/; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName05_test.go b/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName05_test.go new file mode 100644 index 0000000000..5f1d5952c0 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName05_test.go @@ -0,0 +1,29 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoForObjectBindingElementName05(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface A { + /** + * A description of a + */ + a: number; +} +interface B { + a: string; +} + +function f({ a }: A | B) { + a/**/; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName06_test.go b/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName06_test.go new file mode 100644 index 0000000000..ee5be9fce7 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoForObjectBindingElementName06_test.go @@ -0,0 +1,34 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoForObjectBindingElementName06(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `type Foo = { + /** + * Thing is a bar + */ + isBar: boolean + + /** + * Thing is a baz + */ + isBaz: boolean +} + +function f(): Foo { + return undefined as any +} + +const { isBaz: isBar } = f(); +isBar/**/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoImportMeta_test.go b/internal/fourslash/tests/gen/quickInfoImportMeta_test.go new file mode 100644 index 0000000000..abc6da9a40 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoImportMeta_test.go @@ -0,0 +1,30 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoImportMeta(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: esnext +// @Filename: foo.ts +/// +/// +im/*1*/port.me/*2*/ta; +//@Filename: bar.d.ts +/** + * The type of ` + "`" + `import.meta` + "`" + `. + * + * If you need to declare that a given property exists on ` + "`" + `import.meta` + "`" + `, + * this type may be augmented via interface merging. + */ + interface ImportMeta { +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoInheritDoc2_test.go b/internal/fourslash/tests/gen/quickInfoInheritDoc2_test.go new file mode 100644 index 0000000000..082f2091d8 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoInheritDoc2_test.go @@ -0,0 +1,33 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoInheritDoc2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoInheritDoc2.ts +class Base { + /** + * Base.prop + */ + prop: T | undefined; +} + +class SubClass extends Base { + /** + * @inheritdoc + * SubClass.prop + */ + /*1*/prop: T | undefined; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoInheritDoc3_test.go b/internal/fourslash/tests/gen/quickInfoInheritDoc3_test.go new file mode 100644 index 0000000000..1f6b7430a1 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoInheritDoc3_test.go @@ -0,0 +1,34 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoInheritDoc3(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoInheritDoc3.ts +function getBaseClass() { + return class Base { + /** + * Base.prop + */ + prop: string | undefined; + } +} +class SubClass extends getBaseClass() { + /** + * @inheritdoc + * SubClass.prop + */ + /*1*/prop: string | undefined; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoInheritDoc4_test.go b/internal/fourslash/tests/gen/quickInfoInheritDoc4_test.go new file mode 100644 index 0000000000..9f125a462e --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoInheritDoc4_test.go @@ -0,0 +1,27 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoInheritDoc4(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: quickInfoInheritDoc4.ts +var A: any; + +class B extends A { + /** + * @inheritdoc + */ + static /**/value() { + return undefined; + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoInheritDoc5_test.go b/internal/fourslash/tests/gen/quickInfoInheritDoc5_test.go new file mode 100644 index 0000000000..04cdbd68f2 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoInheritDoc5_test.go @@ -0,0 +1,29 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoInheritDoc5(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @checkJs: true +// @Filename: quickInfoInheritDoc5.js +function A() {} + +class B extends A { + /** + * @inheritdoc + */ + static /**/value() { + return undefined; + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoInheritDoc6_test.go b/internal/fourslash/tests/gen/quickInfoInheritDoc6_test.go new file mode 100644 index 0000000000..08db27ca04 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoInheritDoc6_test.go @@ -0,0 +1,27 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoInheritDoc6(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @checkJs: true +// @Filename: quickInfoInheritDoc6.js +class B extends UNRESOLVED_VALUE_DEFINITELY_DOES_NOT_EXIST { + /** + * @inheritdoc + */ + static /**/value() { + return undefined; + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoInheritDoc_test.go b/internal/fourslash/tests/gen/quickInfoInheritDoc_test.go new file mode 100644 index 0000000000..db1b8a3b46 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoInheritDoc_test.go @@ -0,0 +1,76 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoInheritDoc(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoInheritDoc.ts +abstract class BaseClass { + /** + * Useful description always applicable + * + * @returns {string} Useful description of return value always applicable. + */ + public static doSomethingUseful(stuff?: any): string { + throw new Error('Must be implemented by subclass'); + } + + /** + * BaseClass.func1 + * @param {any} stuff1 BaseClass.func1.stuff1 + * @returns {void} BaseClass.func1.returns + */ + public static func1(stuff1: any): void { + } + + /** + * Applicable description always. + */ + public static readonly someProperty: string = 'general value'; +} + + + + +class SubClass extends BaseClass { + + /** + * @inheritDoc + * + * @param {{ tiger: string; lion: string; }} [mySpecificStuff] Description of my specific parameter. + */ + public static /*1*/doSomethingUseful(mySpecificStuff?: { tiger: string; lion: string; }): string { + let useful = ''; + + // do something useful to useful + + return useful; + } + + /** + * @inheritDoc + * @param {any} stuff1 SubClass.func1.stuff1 + * @returns {void} SubClass.func1.returns + */ + public static /*2*/func1(stuff1: any): void { + } + + /** + * text over tag + * @inheritDoc + * text after tag + */ + public static readonly /*3*/someProperty: string = 'specific to this class value' +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJSDocAtBeforeSpace_test.go b/internal/fourslash/tests/gen/quickInfoJSDocAtBeforeSpace_test.go new file mode 100644 index 0000000000..dd4cc7758c --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJSDocAtBeforeSpace_test.go @@ -0,0 +1,29 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJSDocAtBeforeSpace(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** + * @return Don't @ me + */ +function /*f*/f() { } +/** + * @return One final @ + */ +function /*g*/g() { } +/** + * @return An @ + * But another line + */ +function /*h*/h() { }` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJSDocTags_test.go b/internal/fourslash/tests/gen/quickInfoJSDocTags_test.go new file mode 100644 index 0000000000..1b2eb37fc7 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJSDocTags_test.go @@ -0,0 +1,74 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJSDocTags(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** + * This is class Foo. + * @mytag comment1 comment2 + */ +class Foo { + /** + * This is the constructor. + * @myjsdoctag this is a comment + */ + constructor(value: number) {} + /** + * method1 documentation + * @mytag comment1 comment2 + */ + static method1() {} + /** + * @mytag + */ + method2() {} + /** + * @mytag comment1 comment2 + */ + property1: string; + /** + * @mytag1 some comments + * some more comments about mytag1 + * @mytag2 + * here all the comments are on a new line + * @mytag3 + * @mytag + */ + property2: number; + /** + * @returns {number} a value + */ + method3(): number { return 3; } + /** + * @param {string} foo A value. + * @returns {number} Another value + * @mytag + */ + method4(foo: string): number { return 3; } + /** @mytag */ + method5() {} + /** method documentation + * @mytag a JSDoc tag + */ + newMethod() {} +} +var foo = new /*1*/Foo(/*10*/4); +/*2*/Foo./*3*/method1(/*11*/); +foo./*4*/method2(/*12*/); +foo./*5*/method3(/*13*/); +foo./*6*/method4(); +foo./*7*/property1; +foo./*8*/property2; +foo./*9*/method5(); +foo.newMet/*14*/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocAlias_test.go b/internal/fourslash/tests/gen/quickInfoJsDocAlias_test.go new file mode 100644 index 0000000000..671ef137bb --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocAlias_test.go @@ -0,0 +1,26 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocAlias(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @filename: /a.d.ts +/** docs - type T */ +export type T = () => void; +/** + * docs - const A: T + */ +export declare const A: T; +// @filename: /b.ts +import { A } from "./a"; +A/**/()` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocGetterSetter_test.go b/internal/fourslash/tests/gen/quickInfoJsDocGetterSetter_test.go new file mode 100644 index 0000000000..72b439ceca --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocGetterSetter_test.go @@ -0,0 +1,60 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocGetterSetter(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class A { + /** + * getter A + * @returns return A + */ + get /*1*/x(): string { + return ""; + } + /** + * setter A + * @param value foo A + * @todo empty jsdoc + */ + set /*2*/x(value) { } +} +// override both getter and setter +class B extends A { + /** + * getter B + * @returns return B + */ + get /*3*/x(): string { + return ""; + } + /** + * setter B + * @param value foo B + */ + set /*4*/x(vale) { } +} +// not override +class C extends A { } +// only override setter +class D extends A { + /** + * setter D + * @param value foo D + */ + set /*5*/x(val: string) { } +} +new A()./*6*/x = "1"; +new B()./*7*/x = "1"; +new C()./*8*/x = "1"; +new D()./*9*/x = "1";` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocInheritage_test.go b/internal/fourslash/tests/gen/quickInfoJsDocInheritage_test.go new file mode 100644 index 0000000000..3f78b2fce8 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocInheritage_test.go @@ -0,0 +1,120 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocInheritage(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface A { + /** + * @description A.foo1 + */ + foo1: number; + /** + * @description A.foo2 + */ + foo2: (para1: string) => number; +} + +interface B { + /** + * @description B.foo1 + */ + foo1: number; + /** + * @description B.foo2 + */ + foo2: (para2: string) => number; +} + +// implement multi interfaces with duplicate name +// method for function signature +class C implements A, B { + /*1*/foo1: number = 1; + /*2*/foo2(q: string) { return 1 } +} + +// implement multi interfaces with duplicate name +// property for function signature +class D implements A, B { + /*3*/foo1: number = 1; + /*4*/foo2 = (q: string) => { return 1 } +} + +new C()./*5*/foo1; +new C()./*6*/foo2; +new D()./*7*/foo1; +new D()./*8*/foo2; + +class Base1 { + /** + * @description Base1.foo1 + */ + foo1: number = 1; + + /** + * + * @param q Base1.foo2 parameter + * @returns Base1.foo2 return + */ + foo2(q: string) { return 1 } +} + +// extends class and implement interfaces with duplicate name +// property override method +class Drived1 extends Base1 implements A { + /*9*/foo1: number = 1; + /*10*/foo2(para1: string) { return 1 }; +} + +// extends class and implement interfaces with duplicate name +// method override method +class Drived2 extends Base1 implements B { + /*11*/foo1: number = 1; + /*12*/foo2 = (para1: string) => { return 1; }; +} + +class Base2 { + /** + * @description Base2.foo1 + */ + foo1: number = 1; + /** + * + * @param q Base2.foo2 parameter + * @returns Base2.foo2 return + */ + foo2(q: string) { return 1 } +} + +// extends class and implement interfaces with duplicate name +// property override method +class Drived3 extends Base2 implements A { + /*13*/foo1: number = 1; + /*14*/foo2(para1: string) { return 1 }; +} + +// extends class and implement interfaces with duplicate name +// method override method +class Drived4 extends Base2 implements B { + /*15*/foo1: number = 1; + /*16*/foo2 = (para1: string) => { return 1; }; +} + +new Drived1()./*17*/foo1; +new Drived1()./*18*/foo2; +new Drived2()./*19*/foo1; +new Drived2()./*20*/foo2; +new Drived3()./*21*/foo1; +new Drived3()./*22*/foo2; +new Drived4()./*23*/foo1; +new Drived4()./*24*/foo2;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags10_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags10_test.go new file mode 100644 index 0000000000..6a8ea83d46 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags10_test.go @@ -0,0 +1,25 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags10(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoJsDocTags10.js +/** + * @param {T1} a + * @param {T2} a + * @template T1,T2 Comment Text + */ +const /**/foo = (a, b) => {};` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags11_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags11_test.go new file mode 100644 index 0000000000..3c7e220e87 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags11_test.go @@ -0,0 +1,26 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags11(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoJsDocTags11.js +/** + * @param {T1} a + * @param {T2} b + * @template {number} T1 Comment T1 + * @template {number} T2 Comment T2 + */ +const /**/foo = (a, b) => {};` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags12_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags12_test.go new file mode 100644 index 0000000000..3c8436a3cb --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags12_test.go @@ -0,0 +1,25 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags12(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** + * @param {Object} options the args object + * @param {number} options.a first number + * @param {number} options.b second number + * @param {Function} callback the callback function + * @returns {number} + */ +function /**/f(options, callback = null) { +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags14_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags14_test.go new file mode 100644 index 0000000000..14cef4c554 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags14_test.go @@ -0,0 +1,26 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags14(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** + * @param {Object} options the args object + * @param {number} options.a first number + * @param {number} options.b second number + * @param {Object} options.c sub-object + * @param {number} options.c.d third number + * @param {Function} callback the callback function + * @returns {number} + */ +function /**/fn(options, callback = null) { }` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags15_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags15_test.go new file mode 100644 index 0000000000..b7b6e42490 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags15_test.go @@ -0,0 +1,47 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags15(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @checkJs: true +// @filename: /a.js +/** + * @callback Bar + * @param {string} name + * @returns {string} + */ + +/** + * @typedef Foo + * @property {Bar} getName + */ +export const foo = 1; +// @filename: /b.js +import * as _a from "./a.js"; +/** + * @implements {_a.Foo/*1*/} + */ +class C1 { } + +/** + * @extends {_a.Foo/*2*/} + */ +class C2 { } + +/** + * @augments {_a.Foo/*3*/} + */ +class C3 { }` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToFile(t, "/b.js") + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags16_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags16_test.go new file mode 100644 index 0000000000..4985eeb8f9 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags16_test.go @@ -0,0 +1,32 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags16(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class A { + /** + * Description text here. + * + * @virtual + */ + foo() { } +} + +class B extends A { + override /*1*/foo() { } +} + +class C extends B { + override /*2*/foo() { } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags1_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags1_test.go new file mode 100644 index 0000000000..a8be7991d1 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags1_test.go @@ -0,0 +1,30 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags1(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: quickInfoJsDocTags1.ts +/** + * Doc + * @author Me + * @augments {C} Augments it + * @template T A template + * @type {number | string} A type + * @typedef {number | string} NumOrStr + * @property {number} x The prop + * @param {number} x The param + * @returns The result + * @see x (the parameter) + */ +function /**/foo(x) {}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags3_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags3_test.go new file mode 100644 index 0000000000..9bedce1746 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags3_test.go @@ -0,0 +1,34 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags3(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: quickInfoJsDocTags3.ts +interface Foo { + /** + * comment + * @author Me + * @see x (the parameter) + * @param {number} x - x comment + * @param {number} y - y comment + * @throws {Error} comment + */ + method(x: number, y: number): void; +} + +class Bar implements Foo { + /**/method(): void { + throw new Error("Method not implemented."); + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags4_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags4_test.go new file mode 100644 index 0000000000..278c3d0fd2 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags4_test.go @@ -0,0 +1,37 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags4(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: quickInfoJsDocTags4.ts +class Foo { + /** + * comment + * @author Me + * @see x (the parameter) + * @param {number} x - x comment + * @param {number} y - y comment + * @returns The result + */ + method(x: number, y: number): number { + return x + y; + } +} + +class Bar extends Foo { + /**/method(x: number, y: number): number { + const res = super.method(x, y) + 100; + return res; + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags5_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags5_test.go new file mode 100644 index 0000000000..a9c9610399 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags5_test.go @@ -0,0 +1,39 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags5(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoJsDocTags5.js +class Foo { + /** + * comment + * @author Me + * @see x (the parameter) + * @param {number} x - x comment + * @param {number} y - y comment + * @returns The result + */ + method(x, y) { + return x + y; + } +} + +class Bar extends Foo { + /**/method(x, y) { + const res = super.method(x, y) + 100; + return res; + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags6_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags6_test.go new file mode 100644 index 0000000000..4dc2566200 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags6_test.go @@ -0,0 +1,40 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags6(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoJsDocTags6.js +class Foo { + /** + * comment + * @author Me + * @see x (the parameter) + * @param {number} x - x comment + * @param {number} y - y comment + * @returns The result + */ + method(x, y) { + return x + y; + } +} + +class Bar extends Foo { + /** @inheritDoc */ + /**/method(x, y) { + const res = super.method(x, y) + 100; + return res; + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags7_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags7_test.go new file mode 100644 index 0000000000..a375b52b1b --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags7_test.go @@ -0,0 +1,28 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags7(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoJsDocTags7.js +/** + * @typedef {{ [x: string]: any, y: number }} Foo + */ + +/** + * @type {(t: T) => number} + * @template T + */ +const /**/foo = t => t.y;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags8_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags8_test.go new file mode 100644 index 0000000000..6d775e09b7 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags8_test.go @@ -0,0 +1,28 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags8(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoJsDocTags8.js +/** + * @typedef {{ [x: string]: any, y: number }} Foo + */ + +/** + * @type {(t: T) => number} + * @template {Foo} T + */ +const /**/foo = t => t.y;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTags9_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTags9_test.go new file mode 100644 index 0000000000..66315d41ec --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTags9_test.go @@ -0,0 +1,28 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTags9(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoJsDocTags9.js +/** + * @typedef {{ [x: string]: any, y: number }} Foo + */ + +/** + * @type {(t: T) => number} + * @template {Foo} T Comment Text + */ +const /**/foo = t => t.y;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTagsCallback_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTagsCallback_test.go new file mode 100644 index 0000000000..a60b08a602 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTagsCallback_test.go @@ -0,0 +1,30 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTagsCallback(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoJsDocTagsCallback.js +/** + * @callback cb/*1*/ + * @param {string} x - x comment + */ + +/** + * @param {/*2*/cb} bar -callback comment + */ +function foo(bar) { + bar(bar); +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload01_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload01_test.go new file mode 100644 index 0000000000..c5cf42fab8 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload01_test.go @@ -0,0 +1,27 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTagsFunctionOverload01(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: quickInfoJsDocTagsFunctionOverload01.ts +/** + * Doc foo + */ +declare function /*1*/foo(): void; + +/** + * Doc foo overloaded + * @tag Tag text + */ +declare function /*2*/foo(x: number): void` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload03_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload03_test.go new file mode 100644 index 0000000000..862ff9e0cf --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload03_test.go @@ -0,0 +1,24 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTagsFunctionOverload03(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: quickInfoJsDocTagsFunctionOverload03.ts +declare function /*1*/foo(): void; + +/** + * Doc foo overloaded + * @tag Tag text + */ +declare function /*2*/foo(x: number): void` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload05_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload05_test.go new file mode 100644 index 0000000000..523c82db4e --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTagsFunctionOverload05_test.go @@ -0,0 +1,23 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTagsFunctionOverload05(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: quickInfoJsDocTagsFunctionOverload05.ts +declare function /*1*/foo(): void; + +/** + * @tag Tag text + */ +declare function /*2*/foo(x: number): void` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocTagsTypedef_test.go b/internal/fourslash/tests/gen/quickInfoJsDocTagsTypedef_test.go new file mode 100644 index 0000000000..f6eb630ab3 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocTagsTypedef_test.go @@ -0,0 +1,34 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocTagsTypedef(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJs: true +// @Filename: quickInfoJsDocTagsTypedef.js +/** + * Bar comment + * @typedef {Object} /*1*/Bar + * @property {string} baz - baz comment + * @property {string} qux - qux comment + */ + +/** + * foo comment + * @param {/*2*/Bar} x - x comment + * @returns {Bar} + */ +function foo(x) { + return x; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDocThisTag_test.go b/internal/fourslash/tests/gen/quickInfoJsDocThisTag_test.go new file mode 100644 index 0000000000..7679b1829f --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDocThisTag_test.go @@ -0,0 +1,22 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDocThisTag(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @strict: true +// @filename: /a.ts +/** @this {number} */ +function f/**/() { + this +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoJsDoc_test.go b/internal/fourslash/tests/gen/quickInfoJsDoc_test.go new file mode 100644 index 0000000000..6362c20825 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoJsDoc_test.go @@ -0,0 +1,74 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoJsDoc(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @target: esnext +/** + * A constant + * @deprecated + */ +var foo = "foo"; + +/** + * A function + * @deprecated + */ +function fn() { } + +/** + * A class + * @deprecated + */ +class C { + /** + * A field + * @deprecated + */ + field = "field"; + + /** + * A getter + * @deprecated + */ + get getter() { + return; + } + + /** + * A method + * @deprecated + */ + m() { } + + get a() { + this.field/*0*/; + this.getter/*1*/; + this.m/*2*/; + foo/*3*/; + C/*4*//; + fn()/*5*/; + + return 1; + } + + set a(value: number) { + this.field/*6*/; + this.getter/*7*/; + this.m/*8*/; + foo/*9*/; + C/*10*/; + fn/*11*/(); + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoLink10_test.go b/internal/fourslash/tests/gen/quickInfoLink10_test.go new file mode 100644 index 0000000000..5a44581857 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoLink10_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoLink10(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** + * start {@link https://vscode.dev/ | end} + */ +const /**/a = () => 1;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoLink11_test.go b/internal/fourslash/tests/gen/quickInfoLink11_test.go new file mode 100644 index 0000000000..b3ff68254c --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoLink11_test.go @@ -0,0 +1,25 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoLink11(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** + * {@link https://vscode.dev} + * [link text]{https://vscode.dev} + * {@link https://vscode.dev|link text} + * {@link https://vscode.dev link text} + */ +function f() {} + +/**/f();` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoLink5_test.go b/internal/fourslash/tests/gen/quickInfoLink5_test.go new file mode 100644 index 0000000000..1b934348eb --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoLink5_test.go @@ -0,0 +1,21 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoLink5(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `const A = 123; +/** + * See {@link A| constant A} instead + */ +const /**/B = 456;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoLink6_test.go b/internal/fourslash/tests/gen/quickInfoLink6_test.go new file mode 100644 index 0000000000..3b6211949f --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoLink6_test.go @@ -0,0 +1,21 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoLink6(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `const A = 123; +/** + * See {@link A |constant A} instead + */ +const /**/B = 456;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoLink7_test.go b/internal/fourslash/tests/gen/quickInfoLink7_test.go new file mode 100644 index 0000000000..489694fedf --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoLink7_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoLink7(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** + * See {@link | } instead + */ +const /**/B = 456;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoLink8_test.go b/internal/fourslash/tests/gen/quickInfoLink8_test.go new file mode 100644 index 0000000000..fa4baf9b8c --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoLink8_test.go @@ -0,0 +1,21 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoLink8(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `const A = 123; +/** + * See {@link A | constant A} instead + */ +const /**/B = 456;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoLink9_test.go b/internal/fourslash/tests/gen/quickInfoLink9_test.go new file mode 100644 index 0000000000..4f9977cb19 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoLink9_test.go @@ -0,0 +1,22 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoLink9(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `type Foo = { + /** + * Text before {@link /**/a} text after + */ + c: (a: number) => void; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoNestedExportEqualExportDefault_test.go b/internal/fourslash/tests/gen/quickInfoNestedExportEqualExportDefault_test.go new file mode 100644 index 0000000000..e65d843716 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoNestedExportEqualExportDefault_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoNestedExportEqualExportDefault(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `export = (state, messages) => { + export/*1*/ default/*2*/ { + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature_test.go b/internal/fourslash/tests/gen/quickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature_test.go new file mode 100644 index 0000000000..65d98c37d9 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature_test.go @@ -0,0 +1,22 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @jsx: react +// @filename: /a.tsx +declare namespace JSX { + interface IntrinsicElements { [elemName: string]: any; } +} +;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures_test.go b/internal/fourslash/tests/gen/quickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures_test.go new file mode 100644 index 0000000000..d76750eb1c --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures_test.go @@ -0,0 +1,26 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @jsx: react +// @filename: /a.tsx +declare namespace JSX { + interface IntrinsicElements { + [k: ` + "`" + `foo${string}` + "`" + `]: any; + [k: ` + "`" + `foobar${string}` + "`" + `]: any; + } +} +; +;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoOnJsxNamespacedName_test.go b/internal/fourslash/tests/gen/quickInfoOnJsxNamespacedName_test.go new file mode 100644 index 0000000000..b21db430fa --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoOnJsxNamespacedName_test.go @@ -0,0 +1,23 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoOnJsxNamespacedName(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @jsx: react +// @Filename: /types.d.ts +declare namespace JSX { + interface IntrinsicElements { ['a:b']: { a: string }; } +} +// @filename: /a.tsx +;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoOnParameterProperties_test.go b/internal/fourslash/tests/gen/quickInfoOnParameterProperties_test.go new file mode 100644 index 0000000000..a6560da6bf --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoOnParameterProperties_test.go @@ -0,0 +1,41 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoOnParameterProperties(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface IFoo { + /** this is the name of blabla + * - use blabla + * @example blabla + */ + name?: string; +} + +// test1 should work +class Foo implements IFoo { + //public name: string = ''; + constructor( + public na/*1*/me: string, // documentation should leech and work ! + ) { + } +} + +// test2 work +class Foo2 implements IFoo { + public na/*2*/me: string = ''; // documentation leeched and work ! + constructor( + //public name: string, + ) { + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoOnThis5_test.go b/internal/fourslash/tests/gen/quickInfoOnThis5_test.go new file mode 100644 index 0000000000..7db3bef8e5 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoOnThis5_test.go @@ -0,0 +1,37 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoOnThis5(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noImplicitThis: true +const foo = { + num: 0, + f() { + type Y = typeof th/*1*/is; + type Z = typeof th/*2*/is.num; + }, + g(this: number) { + type X = typeof th/*3*/is; + } +} +class Foo { + num = 0; + f() { + type Y = typeof th/*4*/is; + type Z = typeof th/*5*/is.num; + } + g(this: number) { + type X = typeof th/*6*/is; + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoOnUnionPropertiesWithIdenticalJSDocComments01_test.go b/internal/fourslash/tests/gen/quickInfoOnUnionPropertiesWithIdenticalJSDocComments01_test.go new file mode 100644 index 0000000000..b5f17428d3 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoOnUnionPropertiesWithIdenticalJSDocComments01_test.go @@ -0,0 +1,41 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoOnUnionPropertiesWithIdenticalJSDocComments01(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `export type DocumentFilter = { + /** A language id, like ` + "`" + `typescript` + "`" + `. */ + language: string; + /** A Uri [scheme](#Uri.scheme), like ` + "`" + `file` + "`" + ` or ` + "`" + `untitled` + "`" + `. */ + scheme?: string; + /** A glob pattern, like ` + "`" + `*.{ts,js}` + "`" + `. */ + pattern?: string; +} | { + /** A language id, like ` + "`" + `typescript` + "`" + `. */ + language?: string; + /** A Uri [scheme](#Uri.scheme), like ` + "`" + `file` + "`" + ` or ` + "`" + `untitled` + "`" + `. */ + scheme: string; + /** A glob pattern, like ` + "`" + `*.{ts,js}` + "`" + `. */ + pattern?: string; +} | { + /** A language id, like ` + "`" + `typescript` + "`" + `. */ + language?: string; + /** A Uri [scheme](#Uri.scheme), like ` + "`" + `file` + "`" + ` or ` + "`" + `untitled` + "`" + `. */ + scheme?: string; + /** A glob pattern, like ` + "`" + `*.{ts,js}` + "`" + `. */ + pattern: string; +}; + +declare let x: DocumentFilter; +x./**/language` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoSalsaMethodsOnAssignedFunctionExpressions_test.go b/internal/fourslash/tests/gen/quickInfoSalsaMethodsOnAssignedFunctionExpressions_test.go new file mode 100644 index 0000000000..9351630291 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoSalsaMethodsOnAssignedFunctionExpressions_test.go @@ -0,0 +1,28 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoSalsaMethodsOnAssignedFunctionExpressions(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: something.js +var C = function () { } +/** + * The prototype method. + * @param {string} a Parameter definition. + */ +function f(a) {} +C.prototype.m = f; + +var x = new C(); +x/*1*/.m();` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoSatisfiesTag_test.go b/internal/fourslash/tests/gen/quickInfoSatisfiesTag_test.go new file mode 100644 index 0000000000..7f884c5172 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoSatisfiesTag_test.go @@ -0,0 +1,22 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoSatisfiesTag(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noEmit: true +// @allowJS: true +// @checkJs: true +// @filename: /a.js +/** @satisfies {number} comment */ +const /*1*/a = 1;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoTypedefTag_test.go b/internal/fourslash/tests/gen/quickInfoTypedefTag_test.go new file mode 100644 index 0000000000..baec3ce565 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoTypedefTag_test.go @@ -0,0 +1,40 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoTypedefTag(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: a.js +/** + * The typedef tag should not appear in the quickinfo. + * @typedef {{ foo: 'foo' }} Foo + */ +function f() { } +f/*1*/() +/** + * A removed comment + * @tag Usage shows that non-param tags in comments explain the typedef instead of using it + * @typedef {{ nope: any }} Nope not here + * @tag comment 2 + */ +function g() { } +g/*2*/() +/** + * The whole thing is kept + * @param {Local} keep + * @typedef {{ local: any }} Local kept too + * @returns {void} also kept + */ +function h(keep) { } +h/*3*/({ nope: 1 })` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} diff --git a/internal/fourslash/tests/gen/quickInfoUniqueSymbolJsDoc_test.go b/internal/fourslash/tests/gen/quickInfoUniqueSymbolJsDoc_test.go new file mode 100644 index 0000000000..7ebe74ffd3 --- /dev/null +++ b/internal/fourslash/tests/gen/quickInfoUniqueSymbolJsDoc_test.go @@ -0,0 +1,22 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoUniqueSymbolJsDoc(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @checkJs: true +// @allowJs: true +// @filename: ./a.js +/** @type {unique symbol} */ +const foo = Symbol(); +foo/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineHover(t) +} From b78410bf624bee57cee5341f4eca05a14b9b3c55 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 14:52:09 -0700 Subject: [PATCH 04/12] Fix issue with newlines in baselines. --- internal/fourslash/baselineutil.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/fourslash/baselineutil.go b/internal/fourslash/baselineutil.go index 2b87797f81..15b21980f6 100644 --- a/internal/fourslash/baselineutil.go +++ b/internal/fourslash/baselineutil.go @@ -531,14 +531,14 @@ func writeAnnotatedContentWithTooltipsToBaseline[T comparable]( for _, line := range lines { builder.WriteString("// ") builder.WriteString(line) + builder.WriteByte('\n') } - builder.WriteByte('\n') - } - if seenFirst { - builder.WriteString("\n\n") - } else { - seenFirst = true + if seenFirst { + builder.WriteString("\n\n") + } else { + seenFirst = true + } } } From ff005c93ab2bef7bcfc3819cf75700145db30ff7 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 15:10:47 -0700 Subject: [PATCH 05/12] Go back to returning a string to be consistent with original tests. --- internal/fourslash/baselineutil.go | 10 ++++++---- internal/fourslash/fourslash.go | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/fourslash/baselineutil.go b/internal/fourslash/baselineutil.go index 15b21980f6..ac0318b27e 100644 --- a/internal/fourslash/baselineutil.go +++ b/internal/fourslash/baselineutil.go @@ -450,14 +450,14 @@ type markerAndItem[T any] struct { item T } -func writeAnnotatedContentWithTooltipsToBaseline[T comparable]( +func annotateContentWithTooltips[T comparable]( t *testing.T, f *FourslashTest, markersAndItems []markerAndItem[T], opName string, getRange func(item T) *lsproto.Range, getTooltipLines func(item T, prev T) []string, -) { +) string { barWithGutter := "| " + strings.Repeat("-", 70) // sort by file, then *backwards* by position in the file @@ -516,7 +516,7 @@ func writeAnnotatedContentWithTooltipsToBaseline[T comparable]( lines = slices.Insert( lines, - int(textRange.Start.Line), + int(textRange.Start.Line+1), linesToInsert..., ) filesToLines.Set(fileName, lines) @@ -524,7 +524,7 @@ func writeAnnotatedContentWithTooltipsToBaseline[T comparable]( previous = item } - builder := f.baseline.content + builder := strings.Builder{} seenFirst := false for fileName, lines := range filesToLines.Entries() { builder.WriteString(fmt.Sprintf("=== %s ===\n", fileName)) @@ -540,6 +540,8 @@ func writeAnnotatedContentWithTooltipsToBaseline[T comparable]( seenFirst = true } } + + return builder.String() } func (t *textWithContext) sliceOfContent(start *int, end *int) string { diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go index e366631b72..7187a7e5fa 100644 --- a/internal/fourslash/fourslash.go +++ b/internal/fourslash/fourslash.go @@ -980,7 +980,7 @@ func (f *FourslashTest) VerifyBaselineHover(t *testing.T) { return result } - writeAnnotatedContentWithTooltipsToBaseline(t, f, itemsMarkers, "quickinfo", getRange, getTooltipLines) + f.baseline.addResult("QuickInfo", annotateContentWithTooltips(t, f, itemsMarkers, "quickinfo", getRange, getTooltipLines)) baseline.Run(t, f.baseline.getBaselineFileName(), f.baseline.content.String(), baseline.Options{}) } From 86b5fdf6ddbf82a434474a1f4d3839044cb2884e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 15:15:38 -0700 Subject: [PATCH 06/12] Accept baselines. --- .../FindReferencesAfterEdit.baseline.jsonc | 36 + ...fContextSensitiveParameterNoCrash.baseline | 95 +++ .../DeprecatedInheritedJSDocOverload.baseline | 34 + .../hover/JsDocAliasQuickInfo.baseline | 23 + .../hover/JsDocTypeTagQuickInfo1.baseline | 119 +++ .../hover/JsDocTypeTagQuickInfo2.baseline | 110 +++ .../hover/JsDocTypedefQuickInfo1.baseline | 42 + .../fourslash/hover/JsdocLink1.baseline | 29 + .../fourslash/hover/JsdocLink4.baseline | 39 + .../fourslash/hover/JsdocLink5.baseline | 18 + .../hover/JsdocOnInheritedMembers1.baseline | 22 + .../hover/JsdocOnInheritedMembers2.baseline | 22 + ...oAtPropWithAmbientDeclarationInJs.baseline | 15 + ...foCircularInstantiationExpression.baseline | 11 + .../hover/QuickInfoCommentsClass.baseline | 241 ++++++ .../QuickInfoCommentsClassMembers.baseline | 780 ++++++++++++++++++ .../QuickInfoCommentsCommentParsing.baseline | 698 ++++++++++++++++ ...ckInfoCommentsFunctionDeclaration.baseline | 54 ++ ...ickInfoCommentsFunctionExpression.baseline | 121 +++ ...splayPartsArrowFunctionExpression.baseline | 62 ++ .../hover/QuickInfoDisplayPartsClass.baseline | 41 + ...ickInfoDisplayPartsClassAccessors.baseline | 261 ++++++ ...nfoDisplayPartsClassAutoAccessors.baseline | 213 +++++ ...kInfoDisplayPartsClassConstructor.baseline | 221 +++++ ...DisplayPartsClassDefaultAnonymous.baseline | 20 + ...InfoDisplayPartsClassDefaultNamed.baseline | 27 + ...ckInfoDisplayPartsClassIncomplete.baseline | 12 + .../QuickInfoDisplayPartsClassMethod.baseline | 133 +++ ...uickInfoDisplayPartsClassProperty.baseline | 133 +++ .../hover/QuickInfoDisplayPartsConst.baseline | 135 +++ .../hover/QuickInfoDisplayPartsEnum1.baseline | 230 ++++++ .../hover/QuickInfoDisplayPartsEnum2.baseline | 230 ++++++ .../hover/QuickInfoDisplayPartsEnum3.baseline | 230 ++++++ .../hover/QuickInfoDisplayPartsEnum4.baseline | 22 + ...foDisplayPartsExternalModuleAlias.baseline | 30 + ...ckInfoDisplayPartsExternalModules.baseline | 130 +++ .../QuickInfoDisplayPartsFunction.baseline | 130 +++ ...nfoDisplayPartsFunctionExpression.baseline | 52 ++ ...nfoDisplayPartsFunctionIncomplete.baseline | 22 + .../QuickInfoDisplayPartsInterface.baseline | 26 + ...kInfoDisplayPartsInterfaceMembers.baseline | 75 ++ ...foDisplayPartsInternalModuleAlias.baseline | 72 ++ .../hover/QuickInfoDisplayPartsLet.baseline | 135 +++ ...nfoDisplayPartsLiteralLikeNames01.baseline | 85 ++ ...uickInfoDisplayPartsLocalFunction.baseline | 147 ++++ .../QuickInfoDisplayPartsModules.baseline | 130 +++ .../QuickInfoDisplayPartsParameters.baseline | 74 ++ .../QuickInfoDisplayPartsTypeAlias.baseline | 48 ++ ...oDisplayPartsTypeParameterInClass.baseline | 309 +++++++ ...splayPartsTypeParameterInFunction.baseline | 94 +++ ...arameterInFunctionLikeInTypeAlias.baseline | 25 + ...playPartsTypeParameterInInterface.baseline | 475 +++++++++++ ...playPartsTypeParameterInTypeAlias.baseline | 46 ++ .../hover/QuickInfoDisplayPartsUsing.baseline | 20 + .../hover/QuickInfoDisplayPartsVar.baseline | 115 +++ ...oDisplayPartsVarWithStringTypes01.baseline | 26 + ...ForArgumentsPropertyNameInJsMode1.baseline | 25 + ...ForArgumentsPropertyNameInJsMode2.baseline | 21 + .../QuickInfoForConstAssertions.baseline | 34 + .../hover/QuickInfoForJSDocCodefence.baseline | 45 + .../QuickInfoForJSDocUnknownTag.baseline | 112 +++ .../QuickInfoForJSDocWithHttpLinks.baseline | 57 ++ ...foForJSDocWithUnresolvedHttpLinks.baseline | 23 + ...InfoForObjectBindingElementName03.baseline | 19 + ...InfoForObjectBindingElementName04.baseline | 32 + ...InfoForObjectBindingElementName05.baseline | 22 + ...InfoForObjectBindingElementName06.baseline | 27 + .../hover/QuickInfoImportMeta.baseline | 16 + .../hover/QuickInfoInheritDoc.baseline | 96 +++ .../hover/QuickInfoInheritDoc2.baseline | 26 + .../hover/QuickInfoInheritDoc3.baseline | 27 + .../hover/QuickInfoInheritDoc4.baseline | 21 + .../hover/QuickInfoInheritDoc5.baseline | 21 + .../hover/QuickInfoInheritDoc6.baseline | 19 + .../QuickInfoJSDocAtBeforeSpace.baseline | 46 ++ .../hover/QuickInfoJSDocTags.baseline | 181 ++++ .../fourslash/hover/QuickInfoJsDoc.baseline | 162 ++++ .../hover/QuickInfoJsDocAlias.baseline | 8 + .../hover/QuickInfoJsDocGetterSetter.baseline | 136 +++ .../hover/QuickInfoJsDocInheritage.baseline | 274 ++++++ .../hover/QuickInfoJsDocTags1.baseline | 22 + .../hover/QuickInfoJsDocTags10.baseline | 22 + .../hover/QuickInfoJsDocTags11.baseline | 26 + .../hover/QuickInfoJsDocTags12.baseline | 26 + .../hover/QuickInfoJsDocTags14.baseline | 27 + .../hover/QuickInfoJsDocTags15.baseline | 29 + .../hover/QuickInfoJsDocTags16.baseline | 32 + .../hover/QuickInfoJsDocTags3.baseline | 26 + .../hover/QuickInfoJsDocTags4.baseline | 29 + .../hover/QuickInfoJsDocTags5.baseline | 29 + .../hover/QuickInfoJsDocTags6.baseline | 32 + .../hover/QuickInfoJsDocTags7.baseline | 20 + .../hover/QuickInfoJsDocTags8.baseline | 20 + .../hover/QuickInfoJsDocTags9.baseline | 21 + .../hover/QuickInfoJsDocTagsCallback.baseline | 24 + ...ckInfoJsDocTagsFunctionOverload01.baseline | 28 + ...ckInfoJsDocTagsFunctionOverload03.baseline | 25 + ...ckInfoJsDocTagsFunctionOverload05.baseline | 24 + .../hover/QuickInfoJsDocTagsTypedef.baseline | 28 + .../hover/QuickInfoJsDocThisTag.baseline | 15 + .../fourslash/hover/QuickInfoLink10.baseline | 13 + .../fourslash/hover/QuickInfoLink11.baseline | 21 + .../fourslash/hover/QuickInfoLink5.baseline | 14 + .../fourslash/hover/QuickInfoLink6.baseline | 14 + .../fourslash/hover/QuickInfoLink7.baseline | 13 + .../fourslash/hover/QuickInfoLink8.baseline | 14 + .../fourslash/hover/QuickInfoLink9.baseline | 12 + ...nfoNestedExportEqualExportDefault.baseline | 17 + ...laredUsingCatchCallIndexSignature.baseline | 13 + ...singTemplateLiteralTypeSignatures.baseline | 24 + .../QuickInfoOnJsxNamespacedName.baseline | 7 + .../QuickInfoOnParameterProperties.baseline | 41 + .../fourslash/hover/QuickInfoOnThis5.baseline | 61 ++ ...rtiesWithIdenticalJSDocComments01.baseline | 34 + ...hodsOnAssignedFunctionExpressions.baseline | 19 + .../hover/QuickInfoSatisfiesTag.baseline | 13 + .../hover/QuickInfoTypedefTag.baseline | 45 + .../hover/QuickInfoUniqueSymbolJsDoc.baseline | 12 + 118 files changed, 9087 insertions(+) create mode 100644 testdata/baselines/reference/fourslash/findAllRef/FindReferencesAfterEdit.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/hover/CompletionDetailsOfContextSensitiveParameterNoCrash.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/DeprecatedInheritedJSDocOverload.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/JsDocAliasQuickInfo.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo1.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo2.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/JsDocTypedefQuickInfo1.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/JsdocLink1.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/JsdocLink4.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/JsdocLink5.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers1.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers2.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoAtPropWithAmbientDeclarationInJs.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoCircularInstantiationExpression.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClass.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClassMembers.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoCommentsCommentParsing.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionDeclaration.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionExpression.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsArrowFunctionExpression.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClass.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAccessors.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAutoAccessors.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassConstructor.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultAnonymous.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultNamed.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassIncomplete.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassMethod.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassProperty.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsConst.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum1.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum2.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum3.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum4.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModuleAlias.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModules.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunction.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionExpression.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionIncomplete.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterface.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterfaceMembers.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInternalModuleAlias.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLet.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLiteralLikeNames01.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLocalFunction.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsModules.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsParameters.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeAlias.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInClass.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunction.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInInterface.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInTypeAlias.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsUsing.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVar.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVarWithStringTypes01.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode1.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode2.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoForConstAssertions.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocCodefence.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocUnknownTag.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithUnresolvedHttpLinks.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName03.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName04.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName05.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName06.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoImportMeta.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc2.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc3.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc4.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc5.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc6.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJSDocAtBeforeSpace.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJSDocTags.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDoc.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocAlias.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocGetterSetter.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocInheritage.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags1.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags10.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags11.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags12.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags14.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags16.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags3.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags4.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags5.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags6.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags7.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags8.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags9.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsCallback.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload01.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload03.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload05.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoJsDocThisTag.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoLink10.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoLink11.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoLink5.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoLink6.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoLink7.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoLink8.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoLink9.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoNestedExportEqualExportDefault.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxNamespacedName.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoOnParameterProperties.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoOnThis5.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoOnUnionPropertiesWithIdenticalJSDocComments01.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoSalsaMethodsOnAssignedFunctionExpressions.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoSatisfiesTag.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoTypedefTag.baseline create mode 100644 testdata/baselines/reference/fourslash/hover/QuickInfoUniqueSymbolJsDoc.baseline diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesAfterEdit.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesAfterEdit.baseline.jsonc new file mode 100644 index 0000000000..9123c0f239 --- /dev/null +++ b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesAfterEdit.baseline.jsonc @@ -0,0 +1,36 @@ +// === findAllReferences === +// === /a.ts === + +// interface A { +// /*FIND ALL REFS*/[|foo|]: string; +// } + + +// === /b.ts === + +// /// +// +// +// function foo(x: A) { +// x.[|foo|] +// } + + + + +// === findAllReferences === +// === /a.ts === + +// interface A { +// [|foo|]: string; +// } + + +// === /b.ts === + +// /// +// +// +// function foo(x: A) { +// x./*FIND ALL REFS*/[|foo|] +// } diff --git a/testdata/baselines/reference/fourslash/hover/CompletionDetailsOfContextSensitiveParameterNoCrash.baseline b/testdata/baselines/reference/fourslash/hover/CompletionDetailsOfContextSensitiveParameterNoCrash.baseline new file mode 100644 index 0000000000..dd25c25279 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/CompletionDetailsOfContextSensitiveParameterNoCrash.baseline @@ -0,0 +1,95 @@ +// === QuickInfo === +=== /completionDetailsOfContextSensitiveParameterNoCrash.ts === +// type __ = never; +// +// interface CurriedFunction1 { +// (): CurriedFunction1; +// (t1: T1): R; +// } +// interface CurriedFunction2 { +// (): CurriedFunction2; +// (t1: T1): CurriedFunction1; +// (t1: __, t2: T2): CurriedFunction1; +// (t1: T1, t2: T2): R; +// } +// +// interface CurriedFunction3 { +// (): CurriedFunction3; +// (t1: T1): CurriedFunction2; +// (t1: __, t2: T2): CurriedFunction2; +// (t1: T1, t2: T2): CurriedFunction1; +// (t1: __, t2: __, t3: T3): CurriedFunction2; +// (t1: T1, t2: __, t3: T3): CurriedFunction1; +// (t1: __, t2: T2, t3: T3): CurriedFunction1; +// (t1: T1, t2: T2, t3: T3): R; +// } +// +// interface CurriedFunction4 { +// (): CurriedFunction4; +// (t1: T1): CurriedFunction3; +// (t1: __, t2: T2): CurriedFunction3; +// (t1: T1, t2: T2): CurriedFunction2; +// (t1: __, t2: __, t3: T3): CurriedFunction3; +// (t1: __, t2: __, t3: T3): CurriedFunction2; +// (t1: __, t2: T2, t3: T3): CurriedFunction2; +// (t1: T1, t2: T2, t3: T3): CurriedFunction1; +// (t1: __, t2: __, t3: __, t4: T4): CurriedFunction3; +// (t1: T1, t2: __, t3: __, t4: T4): CurriedFunction2; +// (t1: __, t2: T2, t3: __, t4: T4): CurriedFunction2; +// (t1: __, t2: __, t3: T3, t4: T4): CurriedFunction2; +// (t1: T1, t2: T2, t3: __, t4: T4): CurriedFunction1; +// (t1: T1, t2: __, t3: T3, t4: T4): CurriedFunction1; +// (t1: __, t2: T2, t3: T3, t4: T4): CurriedFunction1; +// (t1: T1, t2: T2, t3: T3, t4: T4): R; +// } +// +// declare var curry: { +// (func: (t1: T1) => R, arity?: number): CurriedFunction1; +// (func: (t1: T1, t2: T2) => R, arity?: number): CurriedFunction2; +// (func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): CurriedFunction3; +// (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): CurriedFunction4; +// (func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; +// placeholder: __; +// }; +// +// export type StylingFunction = ( +// keys: (string | false | undefined) | (string | false | undefined)[], +// ...rest: unknown[] +// ) => object; +// +// declare const getStylingByKeys: ( +// mergedStyling: object, +// keys: (string | false | undefined) | (string | false | undefined)[], +// ...args: unknown[] +// ) => object; +// +// declare var mergedStyling: object; +// +// export const createStyling: CurriedFunction3< +// (base16Theme: object) => unknown, +// object | undefined, +// object | undefined, +// StylingFunction +// > = curry< +// (base16Theme: object) => unknown, +// object | undefined, +// object | undefined, +// StylingFunction +// >( +// ( +// getStylingFromBase16: (base16Theme: object) => unknown, +// options: object = {}, +// themeOrStyling: object = {}, +// ...args +// ): StylingFunction => { +// return curry(getStylingByKeys, 2)(mergedStyling, ...args); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) args: [] +// | ``` +// | +// | ---------------------------------------------------------------------- +// }, +// 3 +// ); diff --git a/testdata/baselines/reference/fourslash/hover/DeprecatedInheritedJSDocOverload.baseline b/testdata/baselines/reference/fourslash/hover/DeprecatedInheritedJSDocOverload.baseline new file mode 100644 index 0000000000..138063e2ea --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/DeprecatedInheritedJSDocOverload.baseline @@ -0,0 +1,34 @@ +// === QuickInfo === +=== /deprecatedInheritedJSDocOverload.ts === +// interface PartialObserver {} +// interface Subscription {} +// interface Unsubscribable {} +// +// export interface Subscribable { +// subscribe(observer?: PartialObserver): Unsubscribable; +// /** @deprecated Base deprecation 1 */ +// subscribe(next: null | undefined, error: null | undefined, complete: () => void): Unsubscribable; +// /** @deprecated Base deprecation 2 */ +// subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Unsubscribable; +// /** @deprecated Base deprecation 3 */ +// subscribe(next: (value: T) => void, error: null | undefined, complete: () => void): Unsubscribable; +// subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Unsubscribable; +// } +// interface ThingWithDeprecations extends Subscribable { +// subscribe(observer?: PartialObserver): Subscription; +// /** @deprecated 'real' deprecation */ +// subscribe(next: null | undefined, error: null | undefined, complete: () => void): Subscription; +// /** @deprecated 'real' deprecation */ +// subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Subscription; +// } +// declare const a: ThingWithDeprecations +// a.subscribe(() => { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) ThingWithDeprecations.subscribe(observer?: PartialObserver): Subscription +// | ``` +// | +// | ---------------------------------------------------------------------- +// console.log('something happened'); +// }); diff --git a/testdata/baselines/reference/fourslash/hover/JsDocAliasQuickInfo.baseline b/testdata/baselines/reference/fourslash/hover/JsDocAliasQuickInfo.baseline new file mode 100644 index 0000000000..6c61a22d1e --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/JsDocAliasQuickInfo.baseline @@ -0,0 +1,23 @@ +// === QuickInfo === +=== /jsDocAliasQuickInfo.ts === +// /** +// * Comment +// * @type {number} +// */ +// export default 10; +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +=== /test.ts === +// export { default as test } from "./jsDocAliasQuickInfo"; +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*2*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*3*/. +// | ---------------------------------------------------------------------- + + diff --git a/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo1.baseline b/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo1.baseline new file mode 100644 index 0000000000..d8b09c1108 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo1.baseline @@ -0,0 +1,119 @@ +// === QuickInfo === +=== /jsDocTypeTag1.js === +// /** @type {String} */ +// var S; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var S: String +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {Number} */ +// var N; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var N: Number +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {Boolean} */ +// var B; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var B: Boolean +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {Void} */ +// var V; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var V: Void +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {Undefined} */ +// var U; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var U: Undefined +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {Null} */ +// var Nl; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var Nl: Null +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {Array} */ +// var A; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var A: any[] +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {Promise} */ +// var P; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var P: Promise +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {Object} */ +// var Obj; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var Obj: Object +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {Function} */ +// var Func; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var Func: Function +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {*} */ +// var AnyType; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var AnyType: any +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {?} */ +// var QType; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var QType: any +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {String|Number} */ +// var SOrN; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var SOrN: Number | String +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo2.baseline b/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo2.baseline new file mode 100644 index 0000000000..4805d85636 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo2.baseline @@ -0,0 +1,110 @@ +// === QuickInfo === +=== /jsDocTypeTag2.js === +// /** @type {string} */ +// var s; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var s: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {number} */ +// var n; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var n: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {boolean} */ +// var b; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var b: boolean +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {void} */ +// var v; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var v: void +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {undefined} */ +// var u; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var u: undefined +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {null} */ +// var nl; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var nl: null +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {array} */ +// var a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var a: array +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {promise} */ +// var p; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var p: promise +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {?number} */ +// var nullable; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var nullable: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {function} */ +// var func; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var func: function +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {function (number): number} */ +// var func1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var func1: function +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** @type {string | number} */ +// var sOrn; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var sOrn: string | number +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/JsDocTypedefQuickInfo1.baseline b/testdata/baselines/reference/fourslash/hover/JsDocTypedefQuickInfo1.baseline new file mode 100644 index 0000000000..6f08eefdff --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/JsDocTypedefQuickInfo1.baseline @@ -0,0 +1,42 @@ +// === QuickInfo === +=== /jsDocTypedef1.js === +// /** +// * @typedef {Object} Opts +// * @property {string} x +// * @property {string=} y +// * @property {string} [z] +// * @property {string} [w="hi"] +// * +// * @param {Opts} opts +// */ +// function foo(opts) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) opts: Opts +// | ``` +// | +// | ---------------------------------------------------------------------- +// opts.x; +// } +// foo({x: 'abc'}); +// /** +// * @typedef {object} Opts1 +// * @property {string} x +// * @property {string=} y +// * @property {string} [z] +// * @property {string} [w="hi"] +// * +// * @param {Opts1} opts +// */ +// function foo1(opts1) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) opts1: any +// | ``` +// | +// | ---------------------------------------------------------------------- +// opts1.x; +// } +// foo1({x: 'abc'}); diff --git a/testdata/baselines/reference/fourslash/hover/JsdocLink1.baseline b/testdata/baselines/reference/fourslash/hover/JsdocLink1.baseline new file mode 100644 index 0000000000..9b62932940 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/JsdocLink1.baseline @@ -0,0 +1,29 @@ +// === QuickInfo === +=== /jsdocLink1.ts === +// class C { +// } +// /** +// * {@link C} +// * @wat Makes a {@link C}. A default one. +// * {@link C()} +// * {@link C|postfix text} +// * {@link unformatted postfix text} +// * @see {@link C} its great +// */ +// function CC() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function CC(): void +// | ``` +// | `C` +// | +// | *@wat* — Makes a `C`. A default one. +// | C() +// | C|postfix text +// | unformattedpostfix text +// | +// | *@see* — `C` its great +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/JsdocLink4.baseline b/testdata/baselines/reference/fourslash/hover/JsdocLink4.baseline new file mode 100644 index 0000000000..6b0cb597e8 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/JsdocLink4.baseline @@ -0,0 +1,39 @@ +// === QuickInfo === +=== /jsdocLink4.ts === +// declare class I { +// /** {@link I} */ +// bar(): void +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) I.bar(): void +// | ``` +// | `I` +// | ---------------------------------------------------------------------- +// } +// /** {@link I} */ +// var n = 1 +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var n: number +// | ``` +// | `I` +// | ---------------------------------------------------------------------- +// /** +// * A real, very serious {@link I to an interface}. Right there. +// * @param x one {@link Pos here too} +// */ +// function f(x) { +// } +// f() +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f(x: any): void +// | ``` +// | A real, very serious Ito an interface. Right there. +// | +// | *@param* `x` — one Poshere too +// | ---------------------------------------------------------------------- +// type Pos = [number, number] diff --git a/testdata/baselines/reference/fourslash/hover/JsdocLink5.baseline b/testdata/baselines/reference/fourslash/hover/JsdocLink5.baseline new file mode 100644 index 0000000000..6d5e6ae2c0 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/JsdocLink5.baseline @@ -0,0 +1,18 @@ +// === QuickInfo === +=== /jsdocLink5.ts === +// function g() { } +// /** +// * {@link g()} {@link g() } {@link g ()} {@link g () 0} {@link g()1} {@link g() 2} +// * {@link u()} {@link u() } {@link u ()} {@link u () 0} {@link u()1} {@link u() 2} +// */ +// function f(x) { +// } +// f() +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f(x: any): void +// | ``` +// | g() g() g() g() 0 g()1 g() 2 +// | u() u() u() u() 0 u()1 u() 2 +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers1.baseline b/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers1.baseline new file mode 100644 index 0000000000..329297f715 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers1.baseline @@ -0,0 +1,22 @@ +// === QuickInfo === +=== /a.js === +// /** @template T */ +// class A { +// /** Method documentation. */ +// method() {} +// } +// +// /** @extends {A} */ +// class B extends A { +// method() {} +// } +// +// const b = new B(); +// b.method; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) B.method(): void +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers2.baseline b/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers2.baseline new file mode 100644 index 0000000000..d5371c3d44 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers2.baseline @@ -0,0 +1,22 @@ +// === QuickInfo === +=== /a.js === +// /** @template T */ +// class A { +// /** Method documentation. */ +// method() {} +// } +// +// /** @extends {A} */ +// const B = class extends A { +// method() {} +// } +// +// const b = new B(); +// b.method; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) B.method(): void +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoAtPropWithAmbientDeclarationInJs.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoAtPropWithAmbientDeclarationInJs.baseline new file mode 100644 index 0000000000..8cf9f12d36 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoAtPropWithAmbientDeclarationInJs.baseline @@ -0,0 +1,15 @@ +// === QuickInfo === +=== /a.js === +// class C { +// constructor() { +// this.prop = ""; +// } +// declare prop: string; +// method() { +// this.prop.foo +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /**/. +// | ---------------------------------------------------------------------- +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCircularInstantiationExpression.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCircularInstantiationExpression.baseline new file mode 100644 index 0000000000..7f8f0dbf54 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCircularInstantiationExpression.baseline @@ -0,0 +1,11 @@ +// === QuickInfo === +=== /quickInfoCircularInstantiationExpression.ts === +// declare function foo(t: T): typeof foo; +// foo(""); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(t: string): (t: string) => ... +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClass.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClass.baseline new file mode 100644 index 0000000000..a6231800b1 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClass.baseline @@ -0,0 +1,241 @@ +// === QuickInfo === +=== /quickInfoCommentsClass.ts === +// /** This is class c2 without constructor*/ +// class c2 { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c2 +// | ``` +// | This is class c2 without constructor +// | ---------------------------------------------------------------------- +// } +// var i2 = new c2(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i2: c2 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c2 +// | ``` +// | This is class c2 without constructor +// | ---------------------------------------------------------------------- +// var i2_c = c2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i2_c: typeof c2 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c2 +// | ``` +// | This is class c2 without constructor +// | ---------------------------------------------------------------------- +// class c3 { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c3 +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** Constructor comment*/ +// constructor() { +// } +// } +// var i3 = new c3(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i3: c3 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor c3(): c3 +// | ``` +// | Constructor comment +// | ---------------------------------------------------------------------- +// var i3_c = c3; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i3_c: typeof c3 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c3 +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** Class comment*/ +// class c4 { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c4 +// | ``` +// | Class comment +// | ---------------------------------------------------------------------- +// /** Constructor comment*/ +// constructor() { +// } +// } +// var i4 = new c4(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i4: c4 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor c4(): c4 +// | ``` +// | Constructor comment +// | ---------------------------------------------------------------------- +// var i4_c = c4; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i4_c: typeof c4 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c4 +// | ``` +// | Class comment +// | ---------------------------------------------------------------------- +// /** Class with statics*/ +// class c5 { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c5 +// | ``` +// | Class with statics +// | ---------------------------------------------------------------------- +// static s1: number; +// } +// var i5 = new c5(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i5: c5 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c5 +// | ``` +// | Class with statics +// | ---------------------------------------------------------------------- +// var i5_c = c5; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i5_c: typeof c5 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c5 +// | ``` +// | Class with statics +// | ---------------------------------------------------------------------- +// /** class with statics and constructor*/ +// class c6 { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c6 +// | ``` +// | class with statics and constructor +// | ---------------------------------------------------------------------- +// /** s1 comment*/ +// static s1: number; +// /** constructor comment*/ +// constructor() { +// } +// } +// var i6 = new c6(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i6: c6 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor c6(): c6 +// | ``` +// | constructor comment +// | ---------------------------------------------------------------------- +// var i6_c = c6; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i6_c: typeof c6 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c6 +// | ``` +// | class with statics and constructor +// | ---------------------------------------------------------------------- +// +// class a { +// /** +// constructor for a +// @param a this is my a +// */ +// constructor(a: string) { +// } +// } +// new a("Hello"); +// module m { +// export module m2 { +// /** class comment */ +// export class c1 { +// /** constructor comment*/ +// constructor() { +// } +// } +// } +// } +// var myVar = new m.m2.c1(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor m.m2.c1(): m.m2.c1 +// | ``` +// | constructor comment +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClassMembers.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClassMembers.baseline new file mode 100644 index 0000000000..241ad4ca6b --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClassMembers.baseline @@ -0,0 +1,780 @@ +// === QuickInfo === +=== /quickInfoCommentsClassMembers.ts === +// /** This is comment for c1*/ +// class c1 { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c1 +// | ``` +// | This is comment for c1 +// | ---------------------------------------------------------------------- +// /** p1 is property of c1*/ +// public p1: number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c1.p1: number +// | ``` +// | p1 is property of c1 +// | ---------------------------------------------------------------------- +// /** sum with property*/ +// public p2(/** number to add*/b: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.p2(b: number): number +// | ``` +// | sum with property +// | ---------------------------------------------------------------------- +// return this.p1 + b; +// } +// /** getter property 1*/ +// public get p3() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.p3: number +// | ``` +// | getter property 1 +// | ---------------------------------------------------------------------- +// return this.p2(this.p1); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.p2(b: number): number +// | ``` +// | sum with property +// | ---------------------------------------------------------------------- +// } +// /** setter property 1*/ +// public set p3(/** this is value*/value: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.p3: number +// | ``` +// | getter property 1 +// | ---------------------------------------------------------------------- +// this.p1 = this.p2(value); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.p2(b: number): number +// | ``` +// | sum with property +// | ---------------------------------------------------------------------- +// } +// /** pp1 is property of c1*/ +// private pp1: number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c1.pp1: number +// | ``` +// | pp1 is property of c1 +// | ---------------------------------------------------------------------- +// /** sum with property*/ +// private pp2(/** number to add*/b: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.pp2(b: number): number +// | ``` +// | sum with property +// | ---------------------------------------------------------------------- +// return this.p1 + b; +// } +// /** getter property 2*/ +// private get pp3() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.pp3: number +// | ``` +// | getter property 2 +// | ---------------------------------------------------------------------- +// return this.pp2(this.pp1); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.pp2(b: number): number +// | ``` +// | sum with property +// | ---------------------------------------------------------------------- +// } +// /** setter property 2*/ +// private set pp3( /** this is value*/value: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.pp3: number +// | ``` +// | getter property 2 +// | ---------------------------------------------------------------------- +// this.pp1 = this.pp2(value); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.pp2(b: number): number +// | ``` +// | sum with property +// | ---------------------------------------------------------------------- +// } +// /** Constructor method*/ +// constructor() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor c1(): c1 +// | ``` +// | Constructor method +// | ---------------------------------------------------------------------- +// } +// /** s1 is static property of c1*/ +// static s1: number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c1.s1: number +// | ``` +// | s1 is static property of c1 +// | ---------------------------------------------------------------------- +// /** static sum with property*/ +// static s2(/** number to add*/b: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.s2(b: number): number +// | ``` +// | static sum with property +// | ---------------------------------------------------------------------- +// return c1.s1 + b; +// } +// /** static getter property*/ +// static get s3() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.s3: number +// | ``` +// | static getter property +// | ---------------------------------------------------------------------- +// return c1.s2(c1.s1); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.s2(b: number): number +// | ``` +// | static sum with property +// | ---------------------------------------------------------------------- +// } +// /** setter property 3*/ +// static set s3( /** this is value*/value: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.s3: number +// | ``` +// | static getter property +// | ---------------------------------------------------------------------- +// c1.s1 = c1.s2(value); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.s2(b: number): number +// | ``` +// | static sum with property +// | ---------------------------------------------------------------------- +// } +// public nc_p1: number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c1.nc_p1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// public nc_p2(b: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_p2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// return this.nc_p1 + b; +// } +// public get nc_p3() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.nc_p3: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// return this.nc_p2(this.nc_p1); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_p2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// public set nc_p3(value: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.nc_p3: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.nc_p1 = this.nc_p2(value); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_p2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// private nc_pp1: number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c1.nc_pp1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// private nc_pp2(b: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_pp2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// return this.nc_pp1 + b; +// } +// private get nc_pp3() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.nc_pp3: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// return this.nc_pp2(this.nc_pp1); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_pp2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// private set nc_pp3(value: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.nc_pp3: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.nc_pp1 = this.nc_pp2(value); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_pp2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// static nc_s1: number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c1.nc_s1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// static nc_s2(b: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_s2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// return c1.nc_s1 + b; +// } +// static get nc_s3() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.nc_s3: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// return c1.nc_s2(c1.nc_s1); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_s2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// static set nc_s3(value: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.nc_s3: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// c1.nc_s1 = c1.nc_s2(value); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_s2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// var i1 = new c1(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1: c1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor c1(): c1 +// | ``` +// | Constructor method +// | ---------------------------------------------------------------------- +// var i1_p = i1.p1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_p: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i1_f = i1.p2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_f: (b: number) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.p2(b: number): number +// | ``` +// | sum with property +// | ---------------------------------------------------------------------- +// var i1_r = i1.p2(20); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_r: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.p2(b: number): number +// | ``` +// | sum with property +// | ---------------------------------------------------------------------- +// var i1_prop = i1.p3; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_prop: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.p3: number +// | ``` +// | getter property 1 +// | ---------------------------------------------------------------------- +// i1.p3 = i1_prop; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.p3: number +// | ``` +// | getter property 1 +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_prop: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i1_nc_p = i1.nc_p1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_nc_p: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c1.nc_p1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i1_ncf = i1.nc_p2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_ncf: (b: number) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_p2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i1_ncr = i1.nc_p2(20); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_ncr: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_p2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i1_ncprop = i1.nc_p3; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_ncprop: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.nc_p3: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// i1.nc_p3 = i1_ncprop; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.nc_p3: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_ncprop: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i1_s_p = c1.s1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_s_p: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c1 +// | ``` +// | This is comment for c1 +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c1.s1: number +// | ``` +// | s1 is static property of c1 +// | ---------------------------------------------------------------------- +// var i1_s_f = c1.s2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_s_f: (b: number) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.s2(b: number): number +// | ``` +// | static sum with property +// | ---------------------------------------------------------------------- +// var i1_s_r = c1.s2(20); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_s_r: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.s2(b: number): number +// | ``` +// | static sum with property +// | ---------------------------------------------------------------------- +// var i1_s_prop = c1.s3; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_s_prop: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.s3: number +// | ``` +// | static getter property +// | ---------------------------------------------------------------------- +// c1.s3 = i1_s_prop; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.s3: number +// | ``` +// | static getter property +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_s_prop: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i1_s_nc_p = c1.nc_s1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_s_nc_p: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c1.nc_s1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i1_s_ncf = c1.nc_s2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_s_ncf: (b: number) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_s2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i1_s_ncr = c1.nc_s2(20); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_s_ncr: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c1.nc_s2(b: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i1_s_ncprop = c1.nc_s3; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_s_ncprop: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.nc_s3: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// c1.nc_s3 = i1_s_ncprop; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c1.nc_s3: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_s_ncprop: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i1_c = c1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i1_c: typeof c1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c1 +// | ``` +// | This is comment for c1 +// | ---------------------------------------------------------------------- +// +// class cProperties { +// private val: number; +// /** getter only property*/ +// public get p1() { +// return this.val; +// } +// public get nc_p1() { +// return this.val; +// } +// /**setter only property*/ +// public set p2(value: number) { +// this.val = value; +// } +// public set nc_p2(value: number) { +// this.val = value; +// } +// } +// var cProperties_i = new cProperties(); +// cProperties_i.p2 = cProperties_i.p1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) cProperties.p2: number +// | ``` +// | setter only property +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) cProperties.p1: number +// | ``` +// | getter only property +// | ---------------------------------------------------------------------- +// cProperties_i.nc_p2 = cProperties_i.nc_p1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) cProperties.nc_p2: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) cProperties.nc_p1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// class cWithConstructorProperty { +// /** +// * this is class cWithConstructorProperty's constructor +// * @param a this is first parameter a +// */ +// constructor(/**more info about a*/public a: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithConstructorProperty(a: number): cWithConstructorProperty +// | ``` +// | this is class cWithConstructorProperty's constructor +// | +// | *@param* `a` — this is first parameter a +// | +// | ---------------------------------------------------------------------- +// var bbbb = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var bbbb: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.a = a + 2 + bbbb; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | this +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) cWithConstructorProperty.a: number +// | ``` +// | more info about a +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: number +// | ``` +// | more info about a +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var bbbb: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsCommentParsing.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsCommentParsing.baseline new file mode 100644 index 0000000000..430a5c24c1 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsCommentParsing.baseline @@ -0,0 +1,698 @@ +// === QuickInfo === +=== /quickInfoCommentsCommentParsing.ts === +// /// This is simple /// comments +// function simple() { +// } +// +// simple( ); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function simple(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// +// /// multiLine /// Comments +// /// This is example of multiline /// comments +// /// Another multiLine +// function multiLine() { +// } +// multiLine( ); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function multiLine(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// +// /** this is eg of single line jsdoc style comment */ +// function jsDocSingleLine() { +// } +// jsDocSingleLine(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function jsDocSingleLine(): void +// | ``` +// | this is eg of single line jsdoc style comment +// | ---------------------------------------------------------------------- +// +// +// /** this is multiple line jsdoc stule comment +// *New line1 +// *New Line2*/ +// function jsDocMultiLine() { +// } +// jsDocMultiLine(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function jsDocMultiLine(): void +// | ``` +// | this is multiple line jsdoc stule comment +// | New line1 +// | New Line2 +// | ---------------------------------------------------------------------- +// +// /** multiple line jsdoc comments no longer merge +// *New line1 +// *New Line2*/ +// /** Shoul mege this line as well +// * and this too*/ /** Another this one too*/ +// function jsDocMultiLineMerge() { +// } +// jsDocMultiLineMerge(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function jsDocMultiLineMerge(): void +// | ``` +// | Another this one too +// | ---------------------------------------------------------------------- +// +// +// /// Triple slash comment +// /** jsdoc comment */ +// function jsDocMixedComments1() { +// } +// jsDocMixedComments1(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function jsDocMixedComments1(): void +// | ``` +// | jsdoc comment +// | ---------------------------------------------------------------------- +// +// /// Triple slash comment +// /** jsdoc comment */ /** another jsDocComment*/ +// function jsDocMixedComments2() { +// } +// jsDocMixedComments2(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function jsDocMixedComments2(): void +// | ``` +// | another jsDocComment +// | ---------------------------------------------------------------------- +// +// /** jsdoc comment */ /*** triplestar jsDocComment*/ +// /// Triple slash comment +// function jsDocMixedComments3() { +// } +// jsDocMixedComments3(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function jsDocMixedComments3(): void +// | ``` +// | * triplestar jsDocComment +// | ---------------------------------------------------------------------- +// +// /** jsdoc comment */ /** another jsDocComment*/ +// /// Triple slash comment +// /// Triple slash comment 2 +// function jsDocMixedComments4() { +// } +// jsDocMixedComments4(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function jsDocMixedComments4(): void +// | ``` +// | another jsDocComment +// | ---------------------------------------------------------------------- +// +// /// Triple slash comment 1 +// /** jsdoc comment */ /** another jsDocComment*/ +// /// Triple slash comment +// /// Triple slash comment 2 +// function jsDocMixedComments5() { +// } +// jsDocMixedComments5(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function jsDocMixedComments5(): void +// | ``` +// | another jsDocComment +// | ---------------------------------------------------------------------- +// +// /** another jsDocComment*/ +// /// Triple slash comment 1 +// /// Triple slash comment +// /// Triple slash comment 2 +// /** jsdoc comment */ +// function jsDocMixedComments6() { +// } +// jsDocMixedComments6(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function jsDocMixedComments6(): void +// | ``` +// | jsdoc comment +// | ---------------------------------------------------------------------- +// +// // This shoulnot be help comment +// function noHelpComment1() { +// } +// noHelpComment1(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function noHelpComment1(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// +// /* This shoulnot be help comment */ +// function noHelpComment2() { +// } +// noHelpComment2(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function noHelpComment2(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// +// function noHelpComment3() { +// } +// noHelpComment3(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function noHelpComment3(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** Adds two integers and returns the result +// * @param {number} a first number +// * @param b second number +// */ +// function sum(a: number, b: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: number +// | ``` +// | first number +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: number +// | ``` +// | second number +// | +// | ---------------------------------------------------------------------- +// return a + b; +// } +// sum(10, 20); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function 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 +// * @param a first number +// * @param b +// * @param c { +// @param d @anotherTag +// * @param e LastParam @anotherTag*/ +// function multiply(a: number, b: number, c?: number, d?, e?) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: number +// | ``` +// | first number +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) c: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) d: any +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) e: any +// | ``` +// | LastParam +// | ---------------------------------------------------------------------- +// } +// multiply(10, 20, 30, 40, 50); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function 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 +// */ +// function f1(a: number); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// function f1(b: string); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// /**@param opt optional parameter*/ +// function f1(aOrb, opt?) { +// return aOrb; +// } +// f1(10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f1(a: number): any +// | ``` +// | fn f1 with number +// | +// | *@param* `b` — about b +// | +// | ---------------------------------------------------------------------- +// f1("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f1(b: string): any +// | ``` +// | +// | ---------------------------------------------------------------------- +// +// /** This is subtract function +// @param { a +// *@param { number | } b this is about b +// @param { { () => string; } } c this is optional param c +// @param { { () => string; } d this is optional param d +// @param { { () => string; } } e this is optional param e +// @param { { { () => string; } } f this is optional param f +// */ +// function subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: number +// | ``` +// | this is about b +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) c: () => string +// | ``` +// | this is optional param c +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) d: () => string +// | ``` +// | this is optional param d +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) e: () => string +// | ``` +// | this is optional param e +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) f: () => string +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// subtract(10, 20, null, null, null, null); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function 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 +// @param { number } a this is input number +// @returnType { number } it is return type +// */ +// function square(a: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: number +// | ``` +// | this is input number +// | +// | ---------------------------------------------------------------------- +// return a * a; +// } +// square(10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function 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 +// @paramTag { number } g this is optional param g +// @param { number} b this is b +// */ +// function divide(a: number, b: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: number +// | ``` +// | this is a +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: number +// | ``` +// | this is b +// | +// | ---------------------------------------------------------------------- +// } +// divide(10, 20); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function 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 +// @param {string} foo is string +// @param {string} bar is second string +// */ +// function fooBar(foo: string, bar: string) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) foo: string +// | ``` +// | is string +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) bar: string +// | ``` +// | is second string +// | +// | ---------------------------------------------------------------------- +// return foo + bar; +// } +// fooBar("foo","bar"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function 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; +// /** +// * This is a comment +// */ +// var y; +// /** 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 +// */ +// function jsDocParamTest(/** this is inline comment for a */a: number, /** this is inline comment for b*/ b: number, c: number, d: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: number +// | ``` +// | this is inline comment for a +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: number +// | ``` +// | this is inline comment for b +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) c: number +// | ``` +// | it is third parameter +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) d: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// return a + b + c + d; +// } +// jsDocParamTest(30, 40, 50, 60); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function 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 +// */ +// function jsDocCommentAlignmentTest1() { +// } +// jsDocCommentAlignmentTest1(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function jsDocCommentAlignmentTest1(): void +// | ``` +// | This is function comment +// | And properly aligned comment +// | ---------------------------------------------------------------------- +// /** This is function comment +// * And aligned with 4 space char margin +// */ +// function jsDocCommentAlignmentTest2() { +// } +// jsDocCommentAlignmentTest2(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function jsDocCommentAlignmentTest2(): void +// | ``` +// | This is function comment +// | And aligned with 4 space char margin +// | ---------------------------------------------------------------------- +// /** This is function comment +// * And aligned with 4 space char margin +// * @param {string} 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 +// */ +// function jsDocCommentAlignmentTest3(a: string, b, c) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: string +// | ``` +// | this is info about a +// | spanning on two lines and aligned perfectly +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: any +// | ``` +// | this is info about b +// | spanning on two lines and aligned perfectly +// | spanning one more line alined perfectly +// | spanning another line with more margin +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) c: any +// | ``` +// | this is info about b +// | not aligned text about parameter will eat only one space +// | +// | ---------------------------------------------------------------------- +// } +// jsDocCommentAlignmentTest3("hello",1, 2); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function 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 +// | +// | ---------------------------------------------------------------------- +// +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /**/. +// | ---------------------------------------------------------------------- +// class NoQuickInfoClass { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class NoQuickInfoClass +// | ``` +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionDeclaration.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionDeclaration.baseline new file mode 100644 index 0000000000..4f79bce00c --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionDeclaration.baseline @@ -0,0 +1,54 @@ +// === QuickInfo === +=== /quickInfoCommentsFunctionDeclaration.ts === +// /** This comment should appear for foo*/ +// function foo() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): void +// | ``` +// | This comment should appear for foo +// | ---------------------------------------------------------------------- +// } +// foo(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): void +// | ``` +// | This comment should appear for foo +// | ---------------------------------------------------------------------- +// /** This is comment for function signature*/ +// function fooWithParameters(/** this is comment about a*/a: string, +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function fooWithParameters(a: string, b: number): void +// | ``` +// | This is comment for function signature +// | ---------------------------------------------------------------------- +// /** this is comment for b*/ +// b: number) { +// var d = a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var d: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// fooWithParameters("a",10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function fooWithParameters(a: string, b: number): void +// | ``` +// | This is comment for function signature +// | ---------------------------------------------------------------------- +// /** +// * Does something +// * @param a a string +// */ +// declare function fn(a: string); +// fn("hello"); diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionExpression.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionExpression.baseline new file mode 100644 index 0000000000..e4e658bbc0 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionExpression.baseline @@ -0,0 +1,121 @@ +// === QuickInfo === +=== /quickInfoCommentsFunctionExpression.ts === +// /** lambdaFoo var comment*/ +// var lambdaFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => a + b; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var lambdaFoo: (a: number, b: number) => number +// | ``` +// | lambdaFoo var comment +// | ---------------------------------------------------------------------- +// var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var lambddaNoVarComment: (a: number, b: number) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// lambdaFoo(10, 20); +// function anotherFunc(a: number) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function anotherFunc(a: number): string +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** documentation +// @param b {string} inner parameter */ +// var lambdaVar = /** inner docs */(b: string) => { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var lambdaVar: (b: string) => string +// | ``` +// | documentation +// | +// | *@param* `b` — inner parameter +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// var localVar = "Hello "; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var localVar: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// return localVar + b; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var localVar: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// return lambdaVar("World") + a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var lambdaVar: (b: string) => string +// | ``` +// | documentation +// | +// | *@param* `b` — inner parameter +// | ---------------------------------------------------------------------- +// } +// /** +// * On variable +// * @param s the first parameter! +// * @returns the parameter's length +// */ +// var assigned = /** +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var assigned: (s: string) => number +// | ``` +// | On variable +// | +// | *@param* `s` — the first parameter! +// | +// | +// | *@returns* — the parameter's length +// | +// | ---------------------------------------------------------------------- +// * Summary on expression +// * @param s param on expression +// * @returns return on expression +// */function(/** On parameter */s: string) { +// return s.length; +// } +// assigned("hey"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var assigned: (s: string) => number +// | ``` +// | On variable +// | +// | *@param* `s` — the first parameter! +// | +// | +// | *@returns* — the parameter's length +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsArrowFunctionExpression.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsArrowFunctionExpression.baseline new file mode 100644 index 0000000000..52dc944bc6 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsArrowFunctionExpression.baseline @@ -0,0 +1,62 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsArrowFunctionExpression.ts === +// var x = a => 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var x: (a: any) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: any +// | ``` +// | +// | ---------------------------------------------------------------------- +// var y = (a, b) => 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var y: (a: any, b: any) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: any +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: any +// | ``` +// | +// | ---------------------------------------------------------------------- +// var z = (a: number) => 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var z: (a: number) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var z2 = () => 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var z2: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClass.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClass.baseline new file mode 100644 index 0000000000..b9984b6193 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClass.baseline @@ -0,0 +1,41 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsClass.ts === +// class c { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var cInstance = new c(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// var cVal = c; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cVal: typeof c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAccessors.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAccessors.baseline new file mode 100644 index 0000000000..0be147c6a0 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAccessors.baseline @@ -0,0 +1,261 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsClassAccessors.ts === +// class c { +// public get publicProperty() { return ""; } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// public set publicProperty(x: string) { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// private get privateProperty() { return ""; } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// private set privateProperty(x: string) { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// protected get protectedProperty() { return ""; } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// protected set protectedProperty(x: string) { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// static get staticProperty() { return ""; } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// static set staticProperty(x: string) { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// private static get privateStaticProperty() { return ""; } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// private static set privateStaticProperty(x: string) { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// protected static get protectedStaticProperty() { return ""; } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// protected static set protectedStaticProperty(x: string) { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// method() { +// var x : string; +// x = this.publicProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// x = this.privateProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// x = this.protectedProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// x = c.staticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// x = c.privateStaticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// x = c.protectedStaticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.publicProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.privateProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.protectedProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.staticProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.privateStaticProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.protectedStaticProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// var cInstance = new c(); +// var y: string; +// y = cInstance.publicProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// y = c.staticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// cInstance.publicProperty = y; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.staticProperty = y; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAutoAccessors.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAutoAccessors.baseline new file mode 100644 index 0000000000..8dbfcd96ce --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAutoAccessors.baseline @@ -0,0 +1,213 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsClassAutoAccessors.ts === +// class c { +// public accessor publicProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// private accessor privateProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// protected accessor protectedProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// static accessor staticProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// private static accessor privateStaticProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// protected static accessor protectedStaticProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// method() { +// var x: string; +// x = this.publicProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// x = this.privateProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// x = this.protectedProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// x = c.staticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// x = c.privateStaticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// x = c.protectedStaticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.publicProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.privateProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.protectedProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.staticProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.privateStaticProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.privateStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.protectedStaticProperty = ""; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.protectedStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// var cInstance = new c(); +// var y: string; +// y = cInstance.publicProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// y = c.staticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// cInstance.publicProperty = y; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.staticProperty = y; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassConstructor.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassConstructor.baseline new file mode 100644 index 0000000000..5ed122f9c3 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassConstructor.baseline @@ -0,0 +1,221 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsClassConstructor.ts === +// class c { +// constructor() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor c(): c +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// var cInstance = new c(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor c(): c +// | ``` +// | +// | ---------------------------------------------------------------------- +// var cVal = c; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cVal: typeof c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// class cWithOverloads { +// constructor(x: string); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithOverloads(x: string): cWithOverloads +// | constructor cWithOverloads(x: number): cWithOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// constructor(x: number); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithOverloads(x: string): cWithOverloads +// | constructor cWithOverloads(x: number): cWithOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// constructor(x: any) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithOverloads(x: string): cWithOverloads +// | constructor cWithOverloads(x: number): cWithOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// var cWithOverloadsInstance = new cWithOverloads("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cWithOverloadsInstance: cWithOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithOverloads(x: string): cWithOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// var cWithOverloadsInstance2 = new cWithOverloads(10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cWithOverloadsInstance2: cWithOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithOverloads(x: number): cWithOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// var cWithOverloadsVal = cWithOverloads; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cWithOverloadsVal: typeof cWithOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class cWithOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// class cWithMultipleOverloads { +// constructor(x: string); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithMultipleOverloads(x: string): cWithMultipleOverloads +// | constructor cWithMultipleOverloads(x: number): cWithMultipleOverloads +// | constructor cWithMultipleOverloads(x: boolean): cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// constructor(x: number); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithMultipleOverloads(x: string): cWithMultipleOverloads +// | constructor cWithMultipleOverloads(x: number): cWithMultipleOverloads +// | constructor cWithMultipleOverloads(x: boolean): cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// constructor(x: boolean); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithMultipleOverloads(x: string): cWithMultipleOverloads +// | constructor cWithMultipleOverloads(x: number): cWithMultipleOverloads +// | constructor cWithMultipleOverloads(x: boolean): cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// constructor(x: any) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithMultipleOverloads(x: string): cWithMultipleOverloads +// | constructor cWithMultipleOverloads(x: number): cWithMultipleOverloads +// | constructor cWithMultipleOverloads(x: boolean): cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// var cWithMultipleOverloadsInstance = new cWithMultipleOverloads("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cWithMultipleOverloadsInstance: cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithMultipleOverloads(x: string): cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// var cWithMultipleOverloadsInstance2 = new cWithMultipleOverloads(10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cWithMultipleOverloadsInstance2: cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithMultipleOverloads(x: number): cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// var cWithMultipleOverloadsInstance3 = new cWithMultipleOverloads(true); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cWithMultipleOverloadsInstance3: cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor cWithMultipleOverloads(x: boolean): cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// var cWithMultipleOverloadsVal = cWithMultipleOverloads; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cWithMultipleOverloadsVal: typeof cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class cWithMultipleOverloads +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultAnonymous.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultAnonymous.baseline new file mode 100644 index 0000000000..cd8b2aafbe --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultAnonymous.baseline @@ -0,0 +1,20 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsClassDefaultAnonymous.ts === +// export default class { +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*2*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*3*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*4*/. +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultNamed.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultNamed.baseline new file mode 100644 index 0000000000..7b7a77a6bd --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultNamed.baseline @@ -0,0 +1,27 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsClassDefaultNamed.ts === +// export default class C { +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*2*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*3*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class C +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*5*/. +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassIncomplete.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassIncomplete.baseline new file mode 100644 index 0000000000..e1dbedb3a6 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassIncomplete.baseline @@ -0,0 +1,12 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsClassIncomplete.ts === +// class { +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*2*/. +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassMethod.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassMethod.baseline new file mode 100644 index 0000000000..986e411dc8 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassMethod.baseline @@ -0,0 +1,133 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsClassMethod.ts === +// class c { +// public publicMethod() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.publicMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// private privateMethod() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.privateMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// protected protectedMethod() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.protectedMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// static staticMethod() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.staticMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// private static privateStaticMethod() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.privateStaticMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// protected static protectedStaticMethod() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.protectedStaticMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// method() { +// this.publicMethod(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.publicMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.privateMethod(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.privateMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.protectedMethod(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.protectedMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.staticMethod(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.staticMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.privateStaticMethod(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.privateStaticMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.protectedStaticMethod(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.protectedStaticMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// var cInstance = new c(); +// cInstance.publicMethod(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.publicMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.staticMethod(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.staticMethod(): void +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassProperty.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassProperty.baseline new file mode 100644 index 0000000000..5b94d551e9 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassProperty.baseline @@ -0,0 +1,133 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsClassProperty.ts === +// class c { +// public publicProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// private privateProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.privateProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// protected protectedProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.protectedProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// static staticProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// private static privateStaticProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.privateStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// protected static protectedStaticProperty: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.protectedStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// method() { +// this.publicProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.privateProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.privateProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.protectedProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.protectedProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.staticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.privateStaticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.privateStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.protectedStaticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.protectedStaticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// var cInstance = new c(); +// cInstance.publicProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.publicProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// c.staticProperty; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) c.staticProperty: string +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsConst.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsConst.baseline new file mode 100644 index 0000000000..54adf77b7d --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsConst.baseline @@ -0,0 +1,135 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsConst.ts === +// const a = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const a: 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foo() { +// const b = a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const b: 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const a: 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// if (b) { +// const b1 = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const b1: 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// module m { +// const c = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const c: 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// export const d = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const d: 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// if (c) { +// const e = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const e: 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// const f: () => number = () => 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const f: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// const g = f; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const g: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const f: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// f(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const f: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// const h: { (a: string): number; (a: number): string; } = a => a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// const i = h; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const i: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// h(10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// h("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum1.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum1.baseline new file mode 100644 index 0000000000..a6410c87fc --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum1.baseline @@ -0,0 +1,230 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsEnum1.ts === +// enum E { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// e1, +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// e2 = 10, +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// e3 +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var eInstance: E; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance = E.e1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance = E.e2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance = E.e3; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- +// const enum constE { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// e1, +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// e2 = 10, +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// e3 +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var eInstance1: constE; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance1 = constE.e1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance1 = constE.e2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance1 = constE.e3; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum2.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum2.baseline new file mode 100644 index 0000000000..bd8cf3c6a7 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum2.baseline @@ -0,0 +1,230 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsEnum2.ts === +// enum E { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// "e1", +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// 'e2' = 10, +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// "e3" +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var eInstance: E; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance = E.e1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance = E.e2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance = E.e3; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- +// const enum constE { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// "e1", +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// 'e2' = 10, +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// "e3" +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var eInstance1: constE; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance1 = constE.e1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance1 = constE.e2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance1 = constE.e3; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum3.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum3.baseline new file mode 100644 index 0000000000..3e443748f8 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum3.baseline @@ -0,0 +1,230 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsEnum3.ts === +// enum E { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// "e1", +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// 'e2' = 10, +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// "e3" +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var eInstance: E; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance = E["e1"]; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance = E["e2"]; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance = E['e3']; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance: E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum E +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) E.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- +// const enum constE { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// "e1", +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// 'e2' = 10, +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// "e3" +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var eInstance1: constE; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance1 = constE["e1"]; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e1 = 0 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance1 = constE["e2"]; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e2 = 10 +// | ``` +// | +// | ---------------------------------------------------------------------- +// eInstance1 = constE['e3']; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var eInstance1: constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | enum constE +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) constE.e3 = 11 +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum4.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum4.baseline new file mode 100644 index 0000000000..6feb058187 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum4.baseline @@ -0,0 +1,22 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsEnum4.ts === +// const enum Foo { +// "\t" = 9, +// "\u007f" = 127, +// } +// Foo["\t"] +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) typeof Foo["\t"] = 9 +// | ``` +// | +// | ---------------------------------------------------------------------- +// Foo["\u007f"] +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (enum member) typeof Foo[""] = 127 +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModuleAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModuleAlias.baseline new file mode 100644 index 0000000000..3ff21ba582 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModuleAlias.baseline @@ -0,0 +1,30 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsExternalModuleAlias_file1.ts === +// import a1 = require("./quickInfoDisplayPartsExternalModuleAlias_file0"); +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*mod1*/. +// | ---------------------------------------------------------------------- +// new a1.m1.c(); +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*2*/. +// | ---------------------------------------------------------------------- +// export import a2 = require("./quickInfoDisplayPartsExternalModuleAlias_file0"); +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*3*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*mod2*/. +// | ---------------------------------------------------------------------- +// new a2.m1.c(); +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*4*/. +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModules.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModules.baseline new file mode 100644 index 0000000000..f4e8abfc79 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModules.baseline @@ -0,0 +1,130 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsExternalModules.ts === +// export namespace m { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m +// | ``` +// | +// | ---------------------------------------------------------------------- +// var namespaceElemWithoutExport = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var namespaceElemWithoutExport: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// export var namespaceElemWithExport = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var namespaceElemWithExport: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// export var a = m; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var a: typeof m +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m +// | ``` +// | +// | ---------------------------------------------------------------------- +// export var b: typeof m; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var b: typeof m +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m +// | ``` +// | +// | ---------------------------------------------------------------------- +// export namespace m1.m2 { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*9*/. +// | ---------------------------------------------------------------------- +// var namespaceElemWithoutExport = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var namespaceElemWithoutExport: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// export var namespaceElemWithExport = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var namespaceElemWithExport: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// export var x = m1.m2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var x: typeof m1.m2 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m1.m2 +// | ``` +// | +// | ---------------------------------------------------------------------- +// export var y: typeof m1.m2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var y: typeof m1.m2 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m1.m2 +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunction.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunction.baseline new file mode 100644 index 0000000000..ce5f43b046 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunction.baseline @@ -0,0 +1,130 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsFunction.ts === +// function foo(param: string, optionalParam?: string, paramWithInitializer = "hello", ...restParam: string[]) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(param: string, optionalParam?: string, paramWithInitializer?: string, ...restParam: string[]): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// function foowithoverload(a: string): string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowithoverload(a: string): string +// | function foowithoverload(a: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foowithoverload(a: number): number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowithoverload(a: string): string +// | function foowithoverload(a: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foowithoverload(a: any): any { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowithoverload(a: string): string +// | function foowithoverload(a: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// return a; +// } +// function foowith3overload(a: string): string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: string): string +// | function foowith3overload(a: number): number +// | function foowith3overload(a: boolean): boolean +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foowith3overload(a: number): number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: string): string +// | function foowith3overload(a: number): number +// | function foowith3overload(a: boolean): boolean +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foowith3overload(a: boolean): boolean; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: string): string +// | function foowith3overload(a: number): number +// | function foowith3overload(a: boolean): boolean +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foowith3overload(a: any): any { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: string): string +// | function foowith3overload(a: number): number +// | function foowith3overload(a: boolean): boolean +// | ``` +// | +// | ---------------------------------------------------------------------- +// return a; +// } +// foo("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(param: string, optionalParam?: string, paramWithInitializer?: string, ...restParam: string[]): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// foowithoverload("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowithoverload(a: string): string +// | ``` +// | +// | ---------------------------------------------------------------------- +// foowithoverload(10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowithoverload(a: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// foowith3overload("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: string): string +// | ``` +// | +// | ---------------------------------------------------------------------- +// foowith3overload(10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// foowith3overload(true); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: boolean): boolean +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionExpression.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionExpression.baseline new file mode 100644 index 0000000000..1d902f1e26 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionExpression.baseline @@ -0,0 +1,52 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsFunctionExpression.ts === +// var x = function foo() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var x: () => void +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// foo(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// }; +// var y = function () { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var y: () => void +// | ``` +// | +// | ---------------------------------------------------------------------- +// }; +// (function foo1() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo1(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// foo1(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo1(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// })(); diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionIncomplete.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionIncomplete.baseline new file mode 100644 index 0000000000..569f8a736a --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionIncomplete.baseline @@ -0,0 +1,22 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsFunctionIncomplete.ts === +// function (param: string) { +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*2*/. +// | ---------------------------------------------------------------------- +// }\ +// function { +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*3*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*4*/. +// | ---------------------------------------------------------------------- +// }\ diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterface.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterface.baseline new file mode 100644 index 0000000000..4872e066af --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterface.baseline @@ -0,0 +1,26 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsInterface.ts === +// interface i { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | interface i +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var iInstance: i; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iInstance: i +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | interface i +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterfaceMembers.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterfaceMembers.baseline new file mode 100644 index 0000000000..890b4f4abd --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterfaceMembers.baseline @@ -0,0 +1,75 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsInterfaceMembers.ts === +// interface I { +// property: string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) I.property: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// method(): string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) I.method(): string +// | ``` +// | +// | ---------------------------------------------------------------------- +// (): string; +// new (): I; +// } +// var iInstance: I; +// iInstance.property = iInstance.method(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iInstance: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) I.property: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iInstance: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) I.method(): string +// | ``` +// | +// | ---------------------------------------------------------------------- +// iInstance(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iInstance: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// var anotherInstance = new iInstance(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var anotherInstance: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iInstance: I +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInternalModuleAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInternalModuleAlias.baseline new file mode 100644 index 0000000000..c4150af0d6 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInternalModuleAlias.baseline @@ -0,0 +1,72 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsInternalModuleAlias.ts === +// module m.m1 { +// export class c { +// } +// } +// module m2 { +// import a1 = m; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (alias) namespace m +// | ``` +// | +// | ---------------------------------------------------------------------- +// new a1.m1.c(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (alias) namespace m +// | ``` +// | +// | ---------------------------------------------------------------------- +// import a2 = m.m1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (alias) namespace m.m1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// new a2.c(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (alias) namespace m.m1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// export import a3 = m; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (alias) namespace m +// | ``` +// | +// | ---------------------------------------------------------------------- +// new a3.m1.c(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (alias) namespace m +// | ``` +// | +// | ---------------------------------------------------------------------- +// export import a4 = m.m1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (alias) namespace m.m1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// new a4.c(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (alias) namespace m.m1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLet.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLet.baseline new file mode 100644 index 0000000000..bad0ba56e1 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLet.baseline @@ -0,0 +1,135 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsLet.ts === +// let a = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let a: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foo() { +// let b = a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let b: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let a: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// if (b) { +// let b1 = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let b1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// module m { +// let c = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let c: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// export let d = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let d: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// if (c) { +// let e = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let e: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// let f: () => number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let f: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// let g = f; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let g: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let f: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// f(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let f: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// let h: { (a: string): number; (a: number): string; }; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// let i = h; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let i: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// h(10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// h("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLiteralLikeNames01.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLiteralLikeNames01.baseline new file mode 100644 index 0000000000..b7be0c6122 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLiteralLikeNames01.baseline @@ -0,0 +1,85 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsLiteralLikeNames01.ts === +// class C { +// public 1() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C[1](): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// private Infinity() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C.Infinity(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// protected NaN() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C.NaN(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// static "stringLiteralName"() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C["stringLiteralName"](): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// method() { +// this[1](); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C[1](): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// this["1"](); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C[1](): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.Infinity(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C.Infinity(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// this["Infinity"](); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C.Infinity(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// this.NaN(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C.NaN(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// C.stringLiteralName(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C["stringLiteralName"](): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLocalFunction.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLocalFunction.baseline new file mode 100644 index 0000000000..4c6143c705 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLocalFunction.baseline @@ -0,0 +1,147 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsLocalFunction.ts === +// function outerFoo() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function outerFoo(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foo(param: string, optionalParam?: string, paramWithInitializer = "hello", ...restParam: string[]) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(param: string, optionalParam?: string, paramWithInitializer?: string, ...restParam: string[]): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// function foowithoverload(a: string): string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowithoverload(a: string): string +// | function foowithoverload(a: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foowithoverload(a: number): number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowithoverload(a: string): string +// | function foowithoverload(a: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foowithoverload(a: any): any { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowithoverload(a: string): string +// | function foowithoverload(a: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// return a; +// } +// function foowith3overload(a: string): string; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: string): string +// | function foowith3overload(a: number): number +// | function foowith3overload(a: boolean): boolean +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foowith3overload(a: number): number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: string): string +// | function foowith3overload(a: number): number +// | function foowith3overload(a: boolean): boolean +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foowith3overload(a: boolean): boolean; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: string): string +// | function foowith3overload(a: number): number +// | function foowith3overload(a: boolean): boolean +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foowith3overload(a: any): any { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: string): string +// | function foowith3overload(a: number): number +// | function foowith3overload(a: boolean): boolean +// | ``` +// | +// | ---------------------------------------------------------------------- +// return a; +// } +// foo("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(param: string, optionalParam?: string, paramWithInitializer?: string, ...restParam: string[]): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// foowithoverload("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowithoverload(a: string): string +// | ``` +// | +// | ---------------------------------------------------------------------- +// foowithoverload(10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowithoverload(a: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// foowith3overload("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: string): string +// | ``` +// | +// | ---------------------------------------------------------------------- +// foowith3overload(10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// foowith3overload(true); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foowith3overload(a: boolean): boolean +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// outerFoo(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function outerFoo(): void +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsModules.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsModules.baseline new file mode 100644 index 0000000000..3858c8f6b4 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsModules.baseline @@ -0,0 +1,130 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsModules.ts === +// namespace m { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m +// | ``` +// | +// | ---------------------------------------------------------------------- +// var namespaceElemWithoutExport = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var namespaceElemWithoutExport: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// export var namespaceElemWithExport = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var namespaceElemWithExport: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var a = m; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var a: typeof m +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m +// | ``` +// | +// | ---------------------------------------------------------------------- +// var b: typeof m; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var b: typeof m +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m +// | ``` +// | +// | ---------------------------------------------------------------------- +// namespace m1.m2 { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*9*/. +// | ---------------------------------------------------------------------- +// var namespaceElemWithoutExport = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var namespaceElemWithoutExport: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// export var namespaceElemWithExport = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var namespaceElemWithExport: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var x = m1.m2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var x: typeof m1.m2 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m1.m2 +// | ``` +// | +// | ---------------------------------------------------------------------- +// var y: typeof m1.m2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var y: typeof m1.m2 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m1 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | namespace m1.m2 +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsParameters.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsParameters.baseline new file mode 100644 index 0000000000..695fdc649e --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsParameters.baseline @@ -0,0 +1,74 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsParameters.ts === +// /** @return *crunch* */ +// function foo(param: string, optionalParam?: string, paramWithInitializer = "hello", ...restParam: string[]) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(param: string, optionalParam?: string, paramWithInitializer?: string, ...restParam: string[]): void +// | ``` +// | +// | +// | *@return* — *crunch* +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) param: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) optionalParam: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) paramWithInitializer: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) restParam: string[] +// | ``` +// | +// | ---------------------------------------------------------------------- +// param = "Hello"; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) param: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// optionalParam = "World"; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) optionalParam: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// paramWithInitializer = "Hello"; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) paramWithInitializer: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// restParam[0] = "World"; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) restParam: string[] +// | ``` +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeAlias.baseline new file mode 100644 index 0000000000..b11c6414d5 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeAlias.baseline @@ -0,0 +1,48 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsTypeAlias.ts === +// class c { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// type t1 = c; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | type t1 = c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// var cInstance: t1 = new c(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | type t1 = c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInClass.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInClass.baseline new file mode 100644 index 0000000000..d1c1884398 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInClass.baseline @@ -0,0 +1,309 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsTypeParameterInClass.ts === +// class c { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T +// | ``` +// | +// | ---------------------------------------------------------------------- +// constructor(a: T) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor c(a: T): c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// method(a: U, b: T) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.method(a: U, b: T): U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T +// | ``` +// | +// | ---------------------------------------------------------------------- +// return a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// var cInstance = new c("Hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor c(a: string): c +// | ``` +// | +// | ---------------------------------------------------------------------- +// var cVal = c; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cVal: typeof c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// cInstance.method("hello", "cello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c.method<"hello">(a: "hello", b: string): "hello" +// | ``` +// | +// | ---------------------------------------------------------------------- +// class c2> { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c2> +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T extends c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// constructor(a: T) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor c2>(a: T): c2 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T extends c +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// method>(a: U, b: T) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c2.method>(a: U, b: T): U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T extends c +// | ``` +// | +// | ---------------------------------------------------------------------- +// return a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// var cInstance1 = new c2(cInstance); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance1: c2> +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor c2>(a: c): c2> +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// var cVal2 = c2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cVal2: typeof c2 +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class c2> +// | ``` +// | +// | ---------------------------------------------------------------------- +// cInstance1.method(cInstance, cInstance); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance1: c2> +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) c2.method>(a: c, b: c): c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var cInstance: c +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunction.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunction.baseline new file mode 100644 index 0000000000..2347735616 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunction.baseline @@ -0,0 +1,94 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsTypeParameterInFunction.ts === +// function foo(a: U) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(a: U): U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// return a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// foo("Hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo<"Hello">(a: "Hello"): "Hello" +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foo2(a: U) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo2(a: U): U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends string +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends string +// | ``` +// | +// | ---------------------------------------------------------------------- +// return a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// foo2("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo2<"hello">(a: "hello"): "hello" +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.baseline new file mode 100644 index 0000000000..8cc4870b01 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.baseline @@ -0,0 +1,25 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.ts === +// type MixinCtor = new () => A & { constructor: MixinCtor }; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) A +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) A +// | ``` +// | +// | ---------------------------------------------------------------------- +// type MixinCtor = new () => A & { constructor: { constructor: MixinCtor } }; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) A +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInInterface.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInInterface.baseline new file mode 100644 index 0000000000..6955aadf53 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInInterface.baseline @@ -0,0 +1,475 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsTypeParameterInInterface.ts === +// interface I { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | interface I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T +// | ``` +// | +// | ---------------------------------------------------------------------- +// new (a: U, b: T): U; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// (a: U, b: T): U; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// method(a: U, b: T): U; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) I.method(a: U, b: T): U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var iVal: I; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | interface I +// | ``` +// | +// | ---------------------------------------------------------------------- +// new iVal("hello", "hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// iVal("hello", "hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// iVal.method("hello", "hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) I.method<"hello">(a: "hello", b: string): "hello" +// | ``` +// | +// | ---------------------------------------------------------------------- +// interface I1> { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | interface I1> +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | interface I +// | ``` +// | +// | ---------------------------------------------------------------------- +// new >(a: U, b: T): U; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | interface I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// >(a: U, b: T): U; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | interface I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// method>(a: U, b: T): U; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) I1.method>(a: U, b: T): U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | interface I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) a: U +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) b: T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) U extends I +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var iVal1: I1>; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal1: I1> +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | interface I1> +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | interface I +// | ``` +// | +// | ---------------------------------------------------------------------- +// new iVal1(iVal, iVal); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal1: I1> +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// iVal1(iVal, iVal); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal1: I1> +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// iVal1.method(iVal, iVal); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal1: I1> +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) I1.method>(a: I, b: I): I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal: I +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var iVal: I +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInTypeAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInTypeAlias.baseline new file mode 100644 index 0000000000..44524e6e81 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInTypeAlias.baseline @@ -0,0 +1,46 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsTypeParameterInTypeAlias.ts === +// type List = T[] +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | type List = T[] +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T +// | ``` +// | +// | ---------------------------------------------------------------------- +// type List2 = T[]; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | type List2 = T[] +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T extends string +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (type parameter) T extends string +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsUsing.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsUsing.baseline new file mode 100644 index 0000000000..8d462dbe9d --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsUsing.baseline @@ -0,0 +1,20 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsUsing.ts === +// using a = "a"; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | using a: "a" +// | ``` +// | +// | ---------------------------------------------------------------------- +// const f = async () => { +// await using b = { async [Symbol.asyncDispose]() {} }; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | await using b: { [Symbol.asyncDispose](): Promise; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// }; diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVar.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVar.baseline new file mode 100644 index 0000000000..21027f2d08 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVar.baseline @@ -0,0 +1,115 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsVar.ts === +// var a = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var a: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// function foo() { +// var b = a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var b: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var a: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// module m { +// var c = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var c: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// export var d = 10; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var d: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// var f: () => number; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var f: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var g = f; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var g: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var f: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// f(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var f: () => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// var h: { (a: string): number; (a: number): string; }; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// var i = h; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var i: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// h(10); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// h("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var h: { (a: string): number; (a: number): string; } +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVarWithStringTypes01.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVarWithStringTypes01.baseline new file mode 100644 index 0000000000..0c74fcf968 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVarWithStringTypes01.baseline @@ -0,0 +1,26 @@ +// === QuickInfo === +=== /quickInfoDisplayPartsVarWithStringTypes01.ts === +// let hello: "hello" | 'hello' = "hello"; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let hello: "hello" +// | ``` +// | +// | ---------------------------------------------------------------------- +// let world: 'world' = "world"; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let world: "world" +// | ``` +// | +// | ---------------------------------------------------------------------- +// let helloOrWorld: "hello" | 'world'; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | let helloOrWorld: "hello" | "world" +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode1.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode1.baseline new file mode 100644 index 0000000000..f840ae6183 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode1.baseline @@ -0,0 +1,25 @@ +// === QuickInfo === +=== /a.js === +// const foo = { +// f1: (params) => { } +// } +// +// function f2(x) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f2(x: any): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// foo.f1({ x, arguments: [] }); +// } +// +// f2(''); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f2(x: any): void +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode2.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode2.baseline new file mode 100644 index 0000000000..eb2095beaf --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode2.baseline @@ -0,0 +1,21 @@ +// === QuickInfo === +=== /a.js === +// function f(x) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f(x: any): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// arguments; +// } +// +// f(''); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f(x: any): void +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForConstAssertions.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForConstAssertions.baseline new file mode 100644 index 0000000000..0d1852b1a1 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForConstAssertions.baseline @@ -0,0 +1,34 @@ +// === QuickInfo === +=== /quickInfoForConstAssertions.ts === +// const a = { a: 1 } as const; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | type const +// | ``` +// | +// | ---------------------------------------------------------------------- +// const b = 1 as const; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | type const +// | ``` +// | +// | ---------------------------------------------------------------------- +// const c = "c" as const; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | type const +// | ``` +// | +// | ---------------------------------------------------------------------- +// const d = [1, 2] as const; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | type const +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocCodefence.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocCodefence.baseline new file mode 100644 index 0000000000..670ef6a555 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocCodefence.baseline @@ -0,0 +1,45 @@ +// === QuickInfo === +=== /quickInfoForJSDocCodefence.ts === +// /** +// * @example +// * ``` +// * 1 + 2 +// * ``` +// */ +// function foo() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): string +// | ``` +// | +// | +// | *@example* +// | ``` +// | 1 + 2 +// | ``` +// | +// | ---------------------------------------------------------------------- +// return '2'; +// } +// /** +// * @example +// * `` +// * 1 + 2 +// * ` +// */ +// function boo() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function boo(): string +// | ``` +// | +// | +// | *@example* — `` +// | 1 + 2 +// | ` +// | +// | ---------------------------------------------------------------------- +// return '2'; +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocUnknownTag.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocUnknownTag.baseline new file mode 100644 index 0000000000..e9a162ae03 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocUnknownTag.baseline @@ -0,0 +1,112 @@ +// === QuickInfo === +=== /quickInfoForJSDocUnknownTag.ts === +// /** +// * @example +// * if (true) { +// * foo() +// * } +// */ +// function foo() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): string +// | ``` +// | +// | +// | *@example* — if (true) { +// | foo() +// | } +// | +// | ---------------------------------------------------------------------- +// return '2'; +// } +// /** +// @example +// { +// foo() +// } +// */ +// function foo2() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo2(): string +// | ``` +// | +// | +// | *@example* — { +// | foo() +// | } +// | +// | ---------------------------------------------------------------------- +// return '2'; +// } +// /** +// * @example +// * x y +// * 12345 +// * b +// */ +// function moo() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function moo(): string +// | ``` +// | +// | +// | *@example* — x y +// | 12345 +// | b +// | +// | ---------------------------------------------------------------------- +// return '2'; +// } +// /** +// * @func +// * @example +// * x y +// * 12345 +// * b +// */ +// function boo() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function boo(): string +// | ``` +// | +// | +// | *@func* +// | +// | *@example* — x y +// | 12345 +// | b +// | +// | ---------------------------------------------------------------------- +// return '2'; +// } +// /** +// * @func +// * @example x y +// * 12345 +// * b +// */ +// function goo() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function goo(): string +// | ``` +// | +// | +// | *@func* +// | +// | *@example* — x y +// | 12345 +// | b +// | +// | ---------------------------------------------------------------------- +// return '2'; +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline new file mode 100644 index 0000000000..fc4bc2a8ea --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline @@ -0,0 +1,57 @@ +// === QuickInfo === +=== /quickInfoForJSDocWithHttpLinks.js === +// /** @typedef {number} https://wat */ +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +// +// /** +// * @typedef {Object} Oops +// * @property {number} https://wass +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*2*/. +// | ---------------------------------------------------------------------- +// */ +// +// +// /** @callback http://vad */ +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*3*/. +// | ---------------------------------------------------------------------- +// +// /** @see https://hvad */ +// var see1 = true +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var see1: boolean +// | ``` +// | +// | +// | *@see* `https` — ://hvad +// | ---------------------------------------------------------------------- +// +// /** @see {@link https://hva} */ +// var see2 = true +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var see2: boolean +// | ``` +// | +// | +// | *@see* — https://hva +// | ---------------------------------------------------------------------- +// +// /** {@link https://hvaD} */ +// var see3 = true +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var see3: boolean +// | ``` +// | https://hvaD +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithUnresolvedHttpLinks.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithUnresolvedHttpLinks.baseline new file mode 100644 index 0000000000..2581d4b65d --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithUnresolvedHttpLinks.baseline @@ -0,0 +1,23 @@ +// === QuickInfo === +=== /quickInfoForJSDocWithHttpLinks.js === +// /** @see {@link https://hva} */ +// var see2 = true +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var see2: boolean +// | ``` +// | +// | +// | *@see* — https://hva +// | ---------------------------------------------------------------------- +// +// /** {@link https://hvaD} */ +// var see3 = true +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var see3: boolean +// | ``` +// | https://hvaD +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName03.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName03.baseline new file mode 100644 index 0000000000..3320d86157 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName03.baseline @@ -0,0 +1,19 @@ +// === QuickInfo === +=== /quickInfoForObjectBindingElementName03.ts === +// interface Options { +// /** +// * A description of foo +// */ +// foo: string; +// } +// +// function f({ foo }: Options) { +// foo; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var foo: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName04.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName04.baseline new file mode 100644 index 0000000000..00db50daf7 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName04.baseline @@ -0,0 +1,32 @@ +// === QuickInfo === +=== /quickInfoForObjectBindingElementName04.ts === +// interface Options { +// /** +// * A description of 'a' +// */ +// a: { +// /** +// * A description of 'b' +// */ +// b: string; +// } +// } +// +// function f({ a, a: { b } }: Options) { +// a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var a: { b: string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// b; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var b: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName05.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName05.baseline new file mode 100644 index 0000000000..6b2c5d65e6 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName05.baseline @@ -0,0 +1,22 @@ +// === QuickInfo === +=== /quickInfoForObjectBindingElementName05.ts === +// interface A { +// /** +// * A description of a +// */ +// a: number; +// } +// interface B { +// a: string; +// } +// +// function f({ a }: A | B) { +// a; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var a: string | number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName06.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName06.baseline new file mode 100644 index 0000000000..b6bd456ee1 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName06.baseline @@ -0,0 +1,27 @@ +// === QuickInfo === +=== /quickInfoForObjectBindingElementName06.ts === +// type Foo = { +// /** +// * Thing is a bar +// */ +// isBar: boolean +// +// /** +// * Thing is a baz +// */ +// isBaz: boolean +// } +// +// function f(): Foo { +// return undefined as any +// } +// +// const { isBaz: isBar } = f(); +// isBar; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const isBar: boolean +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoImportMeta.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoImportMeta.baseline new file mode 100644 index 0000000000..11695542ea --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoImportMeta.baseline @@ -0,0 +1,16 @@ +// === QuickInfo === +=== /foo.ts === +// /// +// /// +// import.meta; +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) ImportMetaExpression.meta: ImportMeta +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc.baseline new file mode 100644 index 0000000000..a308752d5f --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc.baseline @@ -0,0 +1,96 @@ +// === QuickInfo === +=== /quickInfoInheritDoc.ts === +// abstract class BaseClass { +// /** +// * Useful description always applicable +// * +// * @returns {string} Useful description of return value always applicable. +// */ +// public static doSomethingUseful(stuff?: any): string { +// throw new Error('Must be implemented by subclass'); +// } +// +// /** +// * BaseClass.func1 +// * @param {any} stuff1 BaseClass.func1.stuff1 +// * @returns {void} BaseClass.func1.returns +// */ +// public static func1(stuff1: any): void { +// } +// +// /** +// * Applicable description always. +// */ +// public static readonly someProperty: string = 'general value'; +// } +// +// +// +// +// class SubClass extends BaseClass { +// +// /** +// * @inheritDoc +// * +// * @param {{ tiger: string; lion: string; }} [mySpecificStuff] Description of my specific parameter. +// */ +// public static doSomethingUseful(mySpecificStuff?: { tiger: string; lion: string; }): string { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) SubClass.doSomethingUseful(mySpecificStuff?: { tiger: string; lion: string; }): string +// | ``` +// | +// | +// | *@inheritDoc* +// | +// | *@param* `mySpecificStuff` — Description of my specific parameter. +// | +// | ---------------------------------------------------------------------- +// let useful = ''; +// +// // do something useful to useful +// +// return useful; +// } +// +// /** +// * @inheritDoc +// * @param {any} stuff1 SubClass.func1.stuff1 +// * @returns {void} SubClass.func1.returns +// */ +// public static func1(stuff1: any): void { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) SubClass.func1(stuff1: any): void +// | ``` +// | +// | +// | *@inheritDoc* +// | +// | *@param* `stuff1` — SubClass.func1.stuff1 +// | +// | +// | *@returns* — SubClass.func1.returns +// | +// | ---------------------------------------------------------------------- +// } +// +// /** +// * text over tag +// * @inheritDoc +// * text after tag +// */ +// public static readonly someProperty: string = 'specific to this class value' +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) SubClass.someProperty: string +// | ``` +// | text over tag +// | +// | *@inheritDoc* — text after tag +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc2.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc2.baseline new file mode 100644 index 0000000000..d2de06b982 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc2.baseline @@ -0,0 +1,26 @@ +// === QuickInfo === +=== /quickInfoInheritDoc2.ts === +// class Base { +// /** +// * Base.prop +// */ +// prop: T | undefined; +// } +// +// class SubClass extends Base { +// /** +// * @inheritdoc +// * SubClass.prop +// */ +// prop: T | undefined; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) SubClass.prop: T +// | ``` +// | +// | +// | *@inheritdoc* — SubClass.prop +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc3.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc3.baseline new file mode 100644 index 0000000000..452ee43d1f --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc3.baseline @@ -0,0 +1,27 @@ +// === QuickInfo === +=== /quickInfoInheritDoc3.ts === +// function getBaseClass() { +// return class Base { +// /** +// * Base.prop +// */ +// prop: string | undefined; +// } +// } +// class SubClass extends getBaseClass() { +// /** +// * @inheritdoc +// * SubClass.prop +// */ +// prop: string | undefined; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) SubClass.prop: string +// | ``` +// | +// | +// | *@inheritdoc* — SubClass.prop +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc4.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc4.baseline new file mode 100644 index 0000000000..4e68998145 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc4.baseline @@ -0,0 +1,21 @@ +// === QuickInfo === +=== /quickInfoInheritDoc4.ts === +// var A: any; +// +// class B extends A { +// /** +// * @inheritdoc +// */ +// static value() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) B.value(): any +// | ``` +// | +// | +// | *@inheritdoc* +// | ---------------------------------------------------------------------- +// return undefined; +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc5.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc5.baseline new file mode 100644 index 0000000000..4faa25edb4 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc5.baseline @@ -0,0 +1,21 @@ +// === QuickInfo === +=== /quickInfoInheritDoc5.js === +// function A() {} +// +// class B extends A { +// /** +// * @inheritdoc +// */ +// static value() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) B.value(): any +// | ``` +// | +// | +// | *@inheritdoc* +// | ---------------------------------------------------------------------- +// return undefined; +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc6.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc6.baseline new file mode 100644 index 0000000000..424235d43e --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc6.baseline @@ -0,0 +1,19 @@ +// === QuickInfo === +=== /quickInfoInheritDoc6.js === +// class B extends UNRESOLVED_VALUE_DEFINITELY_DOES_NOT_EXIST { +// /** +// * @inheritdoc +// */ +// static value() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) B.value(): any +// | ``` +// | +// | +// | *@inheritdoc* +// | ---------------------------------------------------------------------- +// return undefined; +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocAtBeforeSpace.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocAtBeforeSpace.baseline new file mode 100644 index 0000000000..17272b66e4 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocAtBeforeSpace.baseline @@ -0,0 +1,46 @@ +// === QuickInfo === +=== /quickInfoJSDocAtBeforeSpace.ts === +// /** +// * @return Don't @ me +// */ +// function f() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f(): void +// | ``` +// | +// | +// | *@return* — Don't @ me +// | +// | ---------------------------------------------------------------------- +// /** +// * @return One final @ +// */ +// function g() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function g(): void +// | ``` +// | +// | +// | *@return* — One final @ +// | +// | ---------------------------------------------------------------------- +// /** +// * @return An @ +// * But another line +// */ +// function h() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function h(): void +// | ``` +// | +// | +// | *@return* — An @ +// | But another line +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocTags.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocTags.baseline new file mode 100644 index 0000000000..25e36c64cc --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocTags.baseline @@ -0,0 +1,181 @@ +// === QuickInfo === +=== /quickInfoJSDocTags.ts === +// /** +// * This is class Foo. +// * @mytag comment1 comment2 +// */ +// class Foo { +// /** +// * This is the constructor. +// * @myjsdoctag this is a comment +// */ +// constructor(value: number) {} +// /** +// * method1 documentation +// * @mytag comment1 comment2 +// */ +// static method1() {} +// /** +// * @mytag +// */ +// method2() {} +// /** +// * @mytag comment1 comment2 +// */ +// property1: string; +// /** +// * @mytag1 some comments +// * some more comments about mytag1 +// * @mytag2 +// * here all the comments are on a new line +// * @mytag3 +// * @mytag +// */ +// property2: number; +// /** +// * @returns {number} a value +// */ +// method3(): number { return 3; } +// /** +// * @param {string} foo A value. +// * @returns {number} Another value +// * @mytag +// */ +// method4(foo: string): number { return 3; } +// /** @mytag */ +// method5() {} +// /** method documentation +// * @mytag a JSDoc tag +// */ +// newMethod() {} +// } +// var foo = new Foo(4); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | constructor Foo(value: number): Foo +// | ``` +// | This is the constructor. +// | +// | *@myjsdoctag* — this is a comment +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*10*/. +// | ---------------------------------------------------------------------- +// Foo.method1(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class Foo +// | ``` +// | This is class Foo. +// | +// | *@mytag* — comment1 comment2 +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Foo.method1(): void +// | ``` +// | method1 documentation +// | +// | *@mytag* — comment1 comment2 +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*11*/. +// | ---------------------------------------------------------------------- +// foo.method2(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Foo.method2(): void +// | ``` +// | +// | +// | *@mytag* +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*12*/. +// | ---------------------------------------------------------------------- +// foo.method3(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Foo.method3(): number +// | ``` +// | +// | +// | *@returns* — a value +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*13*/. +// | ---------------------------------------------------------------------- +// foo.method4(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Foo.method4(foo: string): number +// | ``` +// | +// | +// | *@param* `foo` — A value. +// | +// | +// | *@returns* — Another value +// | +// | +// | *@mytag* +// | ---------------------------------------------------------------------- +// foo.property1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Foo.property1: string +// | ``` +// | +// | +// | *@mytag* — comment1 comment2 +// | +// | ---------------------------------------------------------------------- +// foo.property2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Foo.property2: number +// | ``` +// | +// | +// | *@mytag1* — some comments +// | some more comments about mytag1 +// | +// | +// | *@mytag2* — here all the comments are on a new line +// | +// | +// | *@mytag3* +// | +// | *@mytag* +// | ---------------------------------------------------------------------- +// foo.method5(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Foo.method5(): void +// | ``` +// | +// | +// | *@mytag* +// | ---------------------------------------------------------------------- +// foo.newMet +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*14*/. +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDoc.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDoc.baseline new file mode 100644 index 0000000000..ad13e15fd5 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDoc.baseline @@ -0,0 +1,162 @@ +// === QuickInfo === +=== /quickInfoJsDoc.ts === +// /** +// * A constant +// * @deprecated +// */ +// var foo = "foo"; +// +// /** +// * A function +// * @deprecated +// */ +// function fn() { } +// +// /** +// * A class +// * @deprecated +// */ +// class C { +// /** +// * A field +// * @deprecated +// */ +// field = "field"; +// +// /** +// * A getter +// * @deprecated +// */ +// get getter() { +// return; +// } +// +// /** +// * A method +// * @deprecated +// */ +// m() { } +// +// get a() { +// this.field; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) C.field: string +// | ``` +// | A field +// | +// | *@deprecated* +// | ---------------------------------------------------------------------- +// this.getter; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) C.getter: void +// | ``` +// | A getter +// | +// | *@deprecated* +// | ---------------------------------------------------------------------- +// this.m; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C.m(): void +// | ``` +// | A method +// | +// | *@deprecated* +// | ---------------------------------------------------------------------- +// foo; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var foo: string +// | ``` +// | A constant +// | +// | *@deprecated* +// | ---------------------------------------------------------------------- +// C/; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class C +// | ``` +// | A class +// | +// | *@deprecated* +// | ---------------------------------------------------------------------- +// fn(); +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*5*/. +// | ---------------------------------------------------------------------- +// +// return 1; +// } +// +// set a(value: number) { +// this.field; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) C.field: string +// | ``` +// | A field +// | +// | *@deprecated* +// | ---------------------------------------------------------------------- +// this.getter; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) C.getter: void +// | ``` +// | A getter +// | +// | *@deprecated* +// | ---------------------------------------------------------------------- +// this.m; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C.m(): void +// | ``` +// | A method +// | +// | *@deprecated* +// | ---------------------------------------------------------------------- +// foo; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var foo: string +// | ``` +// | A constant +// | +// | *@deprecated* +// | ---------------------------------------------------------------------- +// C; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | class C +// | ``` +// | A class +// | +// | *@deprecated* +// | ---------------------------------------------------------------------- +// fn(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function fn(): void +// | ``` +// | A function +// | +// | *@deprecated* +// | ---------------------------------------------------------------------- +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocAlias.baseline new file mode 100644 index 0000000000..a551bffa69 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocAlias.baseline @@ -0,0 +1,8 @@ +// === QuickInfo === +=== /b.ts === +// import { A } from "./a"; +// A() +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /**/. +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocGetterSetter.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocGetterSetter.baseline new file mode 100644 index 0000000000..1d5482274c --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocGetterSetter.baseline @@ -0,0 +1,136 @@ +// === QuickInfo === +=== /quickInfoJsDocGetterSetter.ts === +// class A { +// /** +// * getter A +// * @returns return A +// */ +// get x(): string { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) A.x: string +// | ``` +// | getter A +// | +// | *@returns* — return A +// | +// | ---------------------------------------------------------------------- +// return ""; +// } +// /** +// * setter A +// * @param value foo A +// * @todo empty jsdoc +// */ +// set x(value) { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) A.x: string +// | ``` +// | getter A +// | +// | *@returns* — return A +// | +// | ---------------------------------------------------------------------- +// } +// // override both getter and setter +// class B extends A { +// /** +// * getter B +// * @returns return B +// */ +// get x(): string { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) B.x: string +// | ``` +// | getter B +// | +// | *@returns* — return B +// | +// | ---------------------------------------------------------------------- +// return ""; +// } +// /** +// * setter B +// * @param value foo B +// */ +// set x(vale) { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) B.x: string +// | ``` +// | getter B +// | +// | *@returns* — return B +// | +// | ---------------------------------------------------------------------- +// } +// // not override +// class C extends A { } +// // only override setter +// class D extends A { +// /** +// * setter D +// * @param value foo D +// */ +// set x(val: string) { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) D.x: string +// | ``` +// | setter D +// | +// | *@param* `value` — foo D +// | +// | ---------------------------------------------------------------------- +// } +// new A().x = "1"; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) A.x: string +// | ``` +// | getter A +// | +// | *@returns* — return A +// | +// | ---------------------------------------------------------------------- +// new B().x = "1"; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) B.x: string +// | ``` +// | getter B +// | +// | *@returns* — return B +// | +// | ---------------------------------------------------------------------- +// new C().x = "1"; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) A.x: string +// | ``` +// | getter A +// | +// | *@returns* — return A +// | +// | ---------------------------------------------------------------------- +// new D().x = "1"; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (accessor) D.x: string +// | ``` +// | setter D +// | +// | *@param* `value` — foo D +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocInheritage.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocInheritage.baseline new file mode 100644 index 0000000000..c57720d00b --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocInheritage.baseline @@ -0,0 +1,274 @@ +// === QuickInfo === +=== /quickInfoJsDocInheritage.ts === +// interface A { +// /** +// * @description A.foo1 +// */ +// foo1: number; +// /** +// * @description A.foo2 +// */ +// foo2: (para1: string) => number; +// } +// +// interface B { +// /** +// * @description B.foo1 +// */ +// foo1: number; +// /** +// * @description B.foo2 +// */ +// foo2: (para2: string) => number; +// } +// +// // implement multi interfaces with duplicate name +// // method for function signature +// class C implements A, B { +// foo1: number = 1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) C.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// foo2(q: string) { return 1 } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C.foo2(q: string): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// +// // implement multi interfaces with duplicate name +// // property for function signature +// class D implements A, B { +// foo1: number = 1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) D.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// foo2 = (q: string) => { return 1 } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) D.foo2: (q: string) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// +// new C().foo1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) C.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// new C().foo2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C.foo2(q: string): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// new D().foo1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) D.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// new D().foo2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) D.foo2: (q: string) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// +// class Base1 { +// /** +// * @description Base1.foo1 +// */ +// foo1: number = 1; +// +// /** +// * +// * @param q Base1.foo2 parameter +// * @returns Base1.foo2 return +// */ +// foo2(q: string) { return 1 } +// } +// +// // extends class and implement interfaces with duplicate name +// // property override method +// class Drived1 extends Base1 implements A { +// foo1: number = 1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived1.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// foo2(para1: string) { return 1 }; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Drived1.foo2(para1: string): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// +// // extends class and implement interfaces with duplicate name +// // method override method +// class Drived2 extends Base1 implements B { +// foo1: number = 1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived2.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// foo2 = (para1: string) => { return 1; }; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived2.foo2: (para1: string) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// +// class Base2 { +// /** +// * @description Base2.foo1 +// */ +// foo1: number = 1; +// /** +// * +// * @param q Base2.foo2 parameter +// * @returns Base2.foo2 return +// */ +// foo2(q: string) { return 1 } +// } +// +// // extends class and implement interfaces with duplicate name +// // property override method +// class Drived3 extends Base2 implements A { +// foo1: number = 1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived3.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// foo2(para1: string) { return 1 }; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Drived3.foo2(para1: string): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// +// // extends class and implement interfaces with duplicate name +// // method override method +// class Drived4 extends Base2 implements B { +// foo1: number = 1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived4.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// foo2 = (para1: string) => { return 1; }; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived4.foo2: (para1: string) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// +// new Drived1().foo1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived1.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// new Drived1().foo2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Drived1.foo2(para1: string): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// new Drived2().foo1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived2.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// new Drived2().foo2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived2.foo2: (para1: string) => number +// | ``` +// | +// | ---------------------------------------------------------------------- +// new Drived3().foo1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived3.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// new Drived3().foo2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Drived3.foo2(para1: string): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// new Drived4().foo1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived4.foo1: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// new Drived4().foo2; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Drived4.foo2: (para1: string) => number +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags1.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags1.baseline new file mode 100644 index 0000000000..8ffe4d1325 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags1.baseline @@ -0,0 +1,22 @@ +// === QuickInfo === +=== /quickInfoJsDocTags1.ts === +// /** +// * Doc +// * @author Me +// * @augments {C} Augments it +// * @template T A template +// * @type {number | string} A type +// * @typedef {number | string} NumOrStr +// * @property {number} x The prop +// * @param {number} x The param +// * @returns The result +// * @see x (the parameter) +// */ +// function foo(x) {} +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(x: any): void +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags10.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags10.baseline new file mode 100644 index 0000000000..172ccc6e35 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags10.baseline @@ -0,0 +1,22 @@ +// === QuickInfo === +=== /quickInfoJsDocTags10.js === +// /** +// * @param {T1} a +// * @param {T2} a +// * @template T1,T2 Comment Text +// */ +// const foo = (a, b) => {}; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const foo: (a: T1, b: any) => void +// | ``` +// | +// | +// | *@param* `a` +// | +// | *@param* `a` +// | +// | *@template* `T1`, `T2` — Comment Text +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags11.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags11.baseline new file mode 100644 index 0000000000..29766b8060 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags11.baseline @@ -0,0 +1,26 @@ +// === QuickInfo === +=== /quickInfoJsDocTags11.js === +// /** +// * @param {T1} a +// * @param {T2} b +// * @template {number} T1 Comment T1 +// * @template {number} T2 Comment T2 +// */ +// const foo = (a, b) => {}; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const foo: (a: T1, b: T2) => void +// | ``` +// | +// | +// | *@param* `a` +// | +// | *@param* `b` +// | +// | *@template* `T1` — Comment T1 +// | +// | +// | *@template* `T2` — Comment T2 +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags12.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags12.baseline new file mode 100644 index 0000000000..42d89ca7fa --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags12.baseline @@ -0,0 +1,26 @@ +// === QuickInfo === +=== /quickInfoJsDocTags12.ts === +// /** +// * @param {Object} options the args object +// * @param {number} options.a first number +// * @param {number} options.b second number +// * @param {Function} callback the callback function +// * @returns {number} +// */ +// function f(options, callback = null) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f(options: any, callback?: any): void +// | ``` +// | +// | +// | *@param* `options` — the args object +// | +// | +// | *@param* `callback` — the callback function +// | +// | +// | *@returns* +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags14.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags14.baseline new file mode 100644 index 0000000000..0544832e75 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags14.baseline @@ -0,0 +1,27 @@ +// === QuickInfo === +=== /quickInfoJsDocTags14.ts === +// /** +// * @param {Object} options the args object +// * @param {number} options.a first number +// * @param {number} options.b second number +// * @param {Object} options.c sub-object +// * @param {number} options.c.d third number +// * @param {Function} callback the callback function +// * @returns {number} +// */ +// function fn(options, callback = null) { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function fn(options: any, callback?: any): void +// | ``` +// | +// | +// | *@param* `options` — the args object +// | +// | +// | *@param* `callback` — the callback function +// | +// | +// | *@returns* +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline new file mode 100644 index 0000000000..fa8384ae26 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline @@ -0,0 +1,29 @@ +// === QuickInfo === +=== /b.js === +// import * as _a from "./a.js"; +// /** +// * @implements {_a.Foo} +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +// */ +// class C1 { } +// +// /** +// * @extends {_a.Foo} +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*2*/. +// | ---------------------------------------------------------------------- +// */ +// class C2 { } +// +// /** +// * @augments {_a.Foo} +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*3*/. +// | ---------------------------------------------------------------------- +// */ +// class C3 { } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags16.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags16.baseline new file mode 100644 index 0000000000..e68d355323 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags16.baseline @@ -0,0 +1,32 @@ +// === QuickInfo === +=== /quickInfoJsDocTags16.ts === +// class A { +// /** +// * Description text here. +// * +// * @virtual +// */ +// foo() { } +// } +// +// class B extends A { +// override foo() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) B.foo(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// +// class C extends B { +// override foo() { } +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) C.foo(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags3.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags3.baseline new file mode 100644 index 0000000000..d3fbbc4547 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags3.baseline @@ -0,0 +1,26 @@ +// === QuickInfo === +=== /quickInfoJsDocTags3.ts === +// interface Foo { +// /** +// * comment +// * @author Me +// * @see x (the parameter) +// * @param {number} x - x comment +// * @param {number} y - y comment +// * @throws {Error} comment +// */ +// method(x: number, y: number): void; +// } +// +// class Bar implements Foo { +// method(): void { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Bar.method(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// throw new Error("Method not implemented."); +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags4.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags4.baseline new file mode 100644 index 0000000000..c5d26b158d --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags4.baseline @@ -0,0 +1,29 @@ +// === QuickInfo === +=== /quickInfoJsDocTags4.ts === +// class Foo { +// /** +// * comment +// * @author Me +// * @see x (the parameter) +// * @param {number} x - x comment +// * @param {number} y - y comment +// * @returns The result +// */ +// method(x: number, y: number): number { +// return x + y; +// } +// } +// +// class Bar extends Foo { +// method(x: number, y: number): number { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Bar.method(x: number, y: number): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// const res = super.method(x, y) + 100; +// return res; +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags5.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags5.baseline new file mode 100644 index 0000000000..0ea752b75f --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags5.baseline @@ -0,0 +1,29 @@ +// === QuickInfo === +=== /quickInfoJsDocTags5.js === +// class Foo { +// /** +// * comment +// * @author Me +// * @see x (the parameter) +// * @param {number} x - x comment +// * @param {number} y - y comment +// * @returns The result +// */ +// method(x, y) { +// return x + y; +// } +// } +// +// class Bar extends Foo { +// method(x, y) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Bar.method(x: any, y: any): number +// | ``` +// | +// | ---------------------------------------------------------------------- +// const res = super.method(x, y) + 100; +// return res; +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags6.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags6.baseline new file mode 100644 index 0000000000..243837e6bf --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags6.baseline @@ -0,0 +1,32 @@ +// === QuickInfo === +=== /quickInfoJsDocTags6.js === +// class Foo { +// /** +// * comment +// * @author Me +// * @see x (the parameter) +// * @param {number} x - x comment +// * @param {number} y - y comment +// * @returns The result +// */ +// method(x, y) { +// return x + y; +// } +// } +// +// class Bar extends Foo { +// /** @inheritDoc */ +// method(x, y) { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (method) Bar.method(x: any, y: any): number +// | ``` +// | +// | +// | *@inheritDoc* +// | ---------------------------------------------------------------------- +// const res = super.method(x, y) + 100; +// return res; +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags7.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags7.baseline new file mode 100644 index 0000000000..b38d9fcc8c --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags7.baseline @@ -0,0 +1,20 @@ +// === QuickInfo === +=== /quickInfoJsDocTags7.js === +// /** +// * @typedef {{ [x: string]: any, y: number }} Foo +// */ +// +// /** +// * @type {(t: T) => number} +// * @template T +// */ +// const foo = t => t.y; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const foo: (t: T) => number +// | ``` +// | +// | +// | *@template* `T` +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags8.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags8.baseline new file mode 100644 index 0000000000..1ea979c859 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags8.baseline @@ -0,0 +1,20 @@ +// === QuickInfo === +=== /quickInfoJsDocTags8.js === +// /** +// * @typedef {{ [x: string]: any, y: number }} Foo +// */ +// +// /** +// * @type {(t: T) => number} +// * @template {Foo} T +// */ +// const foo = t => t.y; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const foo: (t: T) => number +// | ``` +// | +// | +// | *@template* `T` +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags9.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags9.baseline new file mode 100644 index 0000000000..5e8b33ab57 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags9.baseline @@ -0,0 +1,21 @@ +// === QuickInfo === +=== /quickInfoJsDocTags9.js === +// /** +// * @typedef {{ [x: string]: any, y: number }} Foo +// */ +// +// /** +// * @type {(t: T) => number} +// * @template {Foo} T Comment Text +// */ +// const foo = t => t.y; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const foo: (t: T) => number +// | ``` +// | +// | +// | *@template* `T` — Comment Text +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsCallback.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsCallback.baseline new file mode 100644 index 0000000000..31d873747d --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsCallback.baseline @@ -0,0 +1,24 @@ +// === QuickInfo === +=== /quickInfoJsDocTagsCallback.js === +// /** +// * @callback cb +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +// * @param {string} x - x comment +// */ +// +// /** +// * @param {cb} bar -callback comment +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | type cb = (x: string) => any +// | ``` +// | +// | ---------------------------------------------------------------------- +// */ +// function foo(bar) { +// bar(bar); +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload01.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload01.baseline new file mode 100644 index 0000000000..4112126630 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload01.baseline @@ -0,0 +1,28 @@ +// === QuickInfo === +=== /quickInfoJsDocTagsFunctionOverload01.ts === +// /** +// * Doc foo +// */ +// declare function foo(): void; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): void +// | function foo(x: number): void +// | ``` +// | Doc foo +// | ---------------------------------------------------------------------- +// +// /** +// * Doc foo overloaded +// * @tag Tag text +// */ +// declare function foo(x: number): void +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): void +// | function foo(x: number): void +// | ``` +// | Doc foo +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload03.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload03.baseline new file mode 100644 index 0000000000..440203757a --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload03.baseline @@ -0,0 +1,25 @@ +// === QuickInfo === +=== /quickInfoJsDocTagsFunctionOverload03.ts === +// declare function foo(): void; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): void +// | function foo(x: number): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// +// /** +// * Doc foo overloaded +// * @tag Tag text +// */ +// declare function foo(x: number): void +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): void +// | function foo(x: number): void +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload05.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload05.baseline new file mode 100644 index 0000000000..8a04085aa5 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload05.baseline @@ -0,0 +1,24 @@ +// === QuickInfo === +=== /quickInfoJsDocTagsFunctionOverload05.ts === +// declare function foo(): void; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): void +// | function foo(x: number): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// +// /** +// * @tag Tag text +// */ +// declare function foo(x: number): void +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function foo(): void +// | function foo(x: number): void +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline new file mode 100644 index 0000000000..2afdaa9eab --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline @@ -0,0 +1,28 @@ +// === QuickInfo === +=== /quickInfoJsDocTagsTypedef.js === +// /** +// * Bar comment +// * @typedef {Object} Bar +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +// * @property {string} baz - baz comment +// * @property {string} qux - qux comment +// */ +// +// /** +// * foo comment +// * @param {Bar} x - x comment +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | type Bar = { baz: string; qux: string; } +// | ``` +// | +// | ---------------------------------------------------------------------- +// * @returns {Bar} +// */ +// function foo(x) { +// return x; +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocThisTag.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocThisTag.baseline new file mode 100644 index 0000000000..3c1acbcc3f --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocThisTag.baseline @@ -0,0 +1,15 @@ +// === QuickInfo === +=== /a.ts === +// /** @this {number} */ +// function f() { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f(): void +// | ``` +// | +// | +// | *@this* +// | ---------------------------------------------------------------------- +// this +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink10.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink10.baseline new file mode 100644 index 0000000000..b44ae3c76b --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink10.baseline @@ -0,0 +1,13 @@ +// === QuickInfo === +=== /quickInfoLink10.ts === +// /** +// * start {@link https://vscode.dev/ | end} +// */ +// const a = () => 1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const a: () => number +// | ``` +// | start https://vscode.dev/ | end +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink11.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink11.baseline new file mode 100644 index 0000000000..99d3131f96 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink11.baseline @@ -0,0 +1,21 @@ +// === QuickInfo === +=== /quickInfoLink11.ts === +// /** +// * {@link https://vscode.dev} +// * [link text]{https://vscode.dev} +// * {@link https://vscode.dev|link text} +// * {@link https://vscode.dev link text} +// */ +// function f() {} +// +// f(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f(): void +// | ``` +// | https://vscode.dev +// | [link text]{https://vscode.dev} +// | https://vscode.dev|link text +// | https://vscode.dev link text +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink5.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink5.baseline new file mode 100644 index 0000000000..806166835d --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink5.baseline @@ -0,0 +1,14 @@ +// === QuickInfo === +=== /quickInfoLink5.ts === +// const A = 123; +// /** +// * See {@link A| constant A} instead +// */ +// const B = 456; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const B: 456 +// | ``` +// | See A| constant A instead +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink6.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink6.baseline new file mode 100644 index 0000000000..888fd00b6d --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink6.baseline @@ -0,0 +1,14 @@ +// === QuickInfo === +=== /quickInfoLink6.ts === +// const A = 123; +// /** +// * See {@link A |constant A} instead +// */ +// const B = 456; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const B: 456 +// | ``` +// | See A|constant A instead +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink7.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink7.baseline new file mode 100644 index 0000000000..a7330c2d83 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink7.baseline @@ -0,0 +1,13 @@ +// === QuickInfo === +=== /quickInfoLink7.ts === +// /** +// * See {@link | } instead +// */ +// const B = 456; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const B: 456 +// | ``` +// | See | instead +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink8.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink8.baseline new file mode 100644 index 0000000000..967fa89a1b --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink8.baseline @@ -0,0 +1,14 @@ +// === QuickInfo === +=== /quickInfoLink8.ts === +// const A = 123; +// /** +// * See {@link A | constant A} instead +// */ +// const B = 456; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const B: 456 +// | ``` +// | See A| constant A instead +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink9.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink9.baseline new file mode 100644 index 0000000000..816d7f6fd5 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink9.baseline @@ -0,0 +1,12 @@ +// === QuickInfo === +=== /quickInfoLink9.ts === +// type Foo = { +// /** +// * Text before {@link a} text after +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /**/. +// | ---------------------------------------------------------------------- +// */ +// c: (a: number) => void; +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoNestedExportEqualExportDefault.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoNestedExportEqualExportDefault.baseline new file mode 100644 index 0000000000..99f75e9df5 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoNestedExportEqualExportDefault.baseline @@ -0,0 +1,17 @@ +// === QuickInfo === +=== /quickInfoNestedExportEqualExportDefault.ts === +// export = (state, messages) => { +// export default { +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) (Anonymous function).default: {} +// | ``` +// | +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*2*/. +// | ---------------------------------------------------------------------- +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature.baseline new file mode 100644 index 0000000000..d54731d3be --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature.baseline @@ -0,0 +1,13 @@ +// === QuickInfo === +=== /a.tsx === +// declare namespace JSX { +// interface IntrinsicElements { [elemName: string]: any; } +// } +//
; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | any +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures.baseline new file mode 100644 index 0000000000..5c5f910849 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures.baseline @@ -0,0 +1,24 @@ +// === QuickInfo === +=== /a.tsx === +// declare namespace JSX { +// interface IntrinsicElements { +// [k: `foo${string}`]: any; +// [k: `foobar${string}`]: any; +// } +// } +// ; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | any +// | ``` +// | +// | ---------------------------------------------------------------------- +// ; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | any +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxNamespacedName.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxNamespacedName.baseline new file mode 100644 index 0000000000..8b789a7b48 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxNamespacedName.baseline @@ -0,0 +1,7 @@ +// === QuickInfo === +=== /a.tsx === +// ; +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /**/. +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnParameterProperties.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnParameterProperties.baseline new file mode 100644 index 0000000000..adcb369c60 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnParameterProperties.baseline @@ -0,0 +1,41 @@ +// === QuickInfo === +=== /quickInfoOnParameterProperties.ts === +// interface IFoo { +// /** this is the name of blabla +// * - use blabla +// * @example blabla +// */ +// name?: string; +// } +// +// // test1 should work +// class Foo implements IFoo { +// //public name: string = ''; +// constructor( +// public name: string, // documentation should leech and work ! +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Foo.name: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// ) { +// } +// } +// +// // test2 work +// class Foo2 implements IFoo { +// public name: string = ''; // documentation leeched and work ! +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) Foo2.name: string +// | ``` +// | +// | ---------------------------------------------------------------------- +// constructor( +// //public name: string, +// ) { +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnThis5.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnThis5.baseline new file mode 100644 index 0000000000..65f1ca7abb --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnThis5.baseline @@ -0,0 +1,61 @@ +// === QuickInfo === +=== /quickInfoOnThis5.ts === +// const foo = { +// num: 0, +// f() { +// type Y = typeof this; +// ^ +// | ---------------------------------------------------------------------- +// | No quickinfo at /*1*/. +// | ---------------------------------------------------------------------- +// type Z = typeof this.num; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | any +// | ``` +// | +// | ---------------------------------------------------------------------- +// }, +// g(this: number) { +// type X = typeof this; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) this: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } +// class Foo { +// num = 0; +// f() { +// type Y = typeof this; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | this +// | ``` +// | +// | ---------------------------------------------------------------------- +// type Z = typeof this.num; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | this +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// g(this: number) { +// type X = typeof this; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (parameter) this: number +// | ``` +// | +// | ---------------------------------------------------------------------- +// } +// } diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnUnionPropertiesWithIdenticalJSDocComments01.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnUnionPropertiesWithIdenticalJSDocComments01.baseline new file mode 100644 index 0000000000..a6c6b6428d --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnUnionPropertiesWithIdenticalJSDocComments01.baseline @@ -0,0 +1,34 @@ +// === QuickInfo === +=== /quickInfoOnUnionPropertiesWithIdenticalJSDocComments01.ts === +// export type DocumentFilter = { +// /** A language id, like `typescript`. */ +// language: string; +// /** A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */ +// scheme?: string; +// /** A glob pattern, like `*.{ts,js}`. */ +// pattern?: string; +// } | { +// /** A language id, like `typescript`. */ +// language?: string; +// /** A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */ +// scheme: string; +// /** A glob pattern, like `*.{ts,js}`. */ +// pattern?: string; +// } | { +// /** A language id, like `typescript`. */ +// language?: string; +// /** A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */ +// scheme?: string; +// /** A glob pattern, like `*.{ts,js}`. */ +// pattern: string; +// }; +// +// declare let x: DocumentFilter; +// x.language +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | (property) language: string +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoSalsaMethodsOnAssignedFunctionExpressions.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoSalsaMethodsOnAssignedFunctionExpressions.baseline new file mode 100644 index 0000000000..0b7eb58e14 --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoSalsaMethodsOnAssignedFunctionExpressions.baseline @@ -0,0 +1,19 @@ +// === QuickInfo === +=== /something.js === +// var C = function () { } +// /** +// * The prototype method. +// * @param {string} a Parameter definition. +// */ +// function f(a) {} +// C.prototype.m = f; +// +// var x = new C(); +// x.m(); +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | var x: any +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoSatisfiesTag.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoSatisfiesTag.baseline new file mode 100644 index 0000000000..997b1c0fed --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoSatisfiesTag.baseline @@ -0,0 +1,13 @@ +// === QuickInfo === +=== /a.js === +// /** @satisfies {number} comment */ +// const a = 1; +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const a: 1 +// | ``` +// | +// | +// | *@satisfies* — comment +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoTypedefTag.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoTypedefTag.baseline new file mode 100644 index 0000000000..664cc9dafd --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoTypedefTag.baseline @@ -0,0 +1,45 @@ +// === QuickInfo === +=== /a.js === +// /** +// * The typedef tag should not appear in the quickinfo. +// * @typedef {{ foo: 'foo' }} Foo +// */ +// function f() { } +// f() +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function f(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** +// * A removed comment +// * @tag Usage shows that non-param tags in comments explain the typedef instead of using it +// * @typedef {{ nope: any }} Nope not here +// * @tag comment 2 +// */ +// function g() { } +// g() +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function g(): void +// | ``` +// | +// | ---------------------------------------------------------------------- +// /** +// * The whole thing is kept +// * @param {Local} keep +// * @typedef {{ local: any }} Local kept too +// * @returns {void} also kept +// */ +// function h(keep) { } +// h({ nope: 1 }) +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | function h(keep: Local): void +// | ``` +// | +// | ---------------------------------------------------------------------- diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoUniqueSymbolJsDoc.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoUniqueSymbolJsDoc.baseline new file mode 100644 index 0000000000..993934bd4b --- /dev/null +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoUniqueSymbolJsDoc.baseline @@ -0,0 +1,12 @@ +// === QuickInfo === +=== /a.js === +// /** @type {unique symbol} */ +// const foo = Symbol(); +// foo +// ^ +// | ---------------------------------------------------------------------- +// | ```tsx +// | const foo: typeof foo +// | ``` +// | +// | ---------------------------------------------------------------------- From b3bd925da09259b840cdb657d51149ca50a3de86 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 15:17:39 -0700 Subject: [PATCH 07/12] Update failing tests. --- internal/fourslash/_scripts/failingTests.txt | 4 ++++ internal/fourslash/tests/gen/jsdocLink2_test.go | 2 +- internal/fourslash/tests/gen/jsdocLink3_test.go | 2 +- internal/fourslash/tests/gen/jsdocLink6_test.go | 2 +- internal/fourslash/tests/gen/quickInfoAlias_test.go | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/internal/fourslash/_scripts/failingTests.txt b/internal/fourslash/_scripts/failingTests.txt index c7553c5785..6f6953f10c 100644 --- a/internal/fourslash/_scripts/failingTests.txt +++ b/internal/fourslash/_scripts/failingTests.txt @@ -231,6 +231,9 @@ TestJsDocFunctionTypeCompletionsNoCrash TestJsdocExtendsTagCompletion TestJsdocImplementsTagCompletion TestJsdocImportTagCompletion1 +TestJsdocLink2 +TestJsdocLink3 +TestJsdocLink6 TestJsdocLink_findAllReferences1 TestJsdocOverloadTagCompletion TestJsdocParameterNameCompletion @@ -302,6 +305,7 @@ TestPathCompletionsTypesVersionsWildcard4 TestPathCompletionsTypesVersionsWildcard5 TestPathCompletionsTypesVersionsWildcard6 TestProtoVarVisibleWithOuterScopeUnderscoreProto +TestQuickInfoAlias TestReferencesForExportedValues TestReferencesForStatementKeywords TestReferencesInComment diff --git a/internal/fourslash/tests/gen/jsdocLink2_test.go b/internal/fourslash/tests/gen/jsdocLink2_test.go index 5058b64a72..5da1a8bd51 100644 --- a/internal/fourslash/tests/gen/jsdocLink2_test.go +++ b/internal/fourslash/tests/gen/jsdocLink2_test.go @@ -9,7 +9,7 @@ import ( func TestJsdocLink2(t *testing.T) { t.Parallel() - + t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @Filename: jsdocLink2.ts class C { diff --git a/internal/fourslash/tests/gen/jsdocLink3_test.go b/internal/fourslash/tests/gen/jsdocLink3_test.go index ec3606c751..b8b21773f0 100644 --- a/internal/fourslash/tests/gen/jsdocLink3_test.go +++ b/internal/fourslash/tests/gen/jsdocLink3_test.go @@ -9,7 +9,7 @@ import ( func TestJsdocLink3(t *testing.T) { t.Parallel() - + t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @Filename: /jsdocLink3.ts export class C { diff --git a/internal/fourslash/tests/gen/jsdocLink6_test.go b/internal/fourslash/tests/gen/jsdocLink6_test.go index bafe0bbb1f..ce6d540900 100644 --- a/internal/fourslash/tests/gen/jsdocLink6_test.go +++ b/internal/fourslash/tests/gen/jsdocLink6_test.go @@ -9,7 +9,7 @@ import ( func TestJsdocLink6(t *testing.T) { t.Parallel() - + t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @filename: /a.ts export default function A() { } diff --git a/internal/fourslash/tests/gen/quickInfoAlias_test.go b/internal/fourslash/tests/gen/quickInfoAlias_test.go index f7a5a0edec..0dd9bda634 100644 --- a/internal/fourslash/tests/gen/quickInfoAlias_test.go +++ b/internal/fourslash/tests/gen/quickInfoAlias_test.go @@ -9,7 +9,7 @@ import ( func TestQuickInfoAlias(t *testing.T) { t.Parallel() - + t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @Filename: /a.ts /** From bcaca0b0655ef26d9676597517fd9b37160e3112 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 15:33:44 -0700 Subject: [PATCH 08/12] Add JSON to the end of the baseline. --- internal/fourslash/baselineutil.go | 12 ++++++------ internal/fourslash/fourslash.go | 11 ++++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/internal/fourslash/baselineutil.go b/internal/fourslash/baselineutil.go index ac0318b27e..98b9224024 100644 --- a/internal/fourslash/baselineutil.go +++ b/internal/fourslash/baselineutil.go @@ -446,8 +446,8 @@ func (t *textWithContext) readableJsoncBaseline(text string) { } type markerAndItem[T any] struct { - marker *Marker - item T + Marker *Marker `json:"marker"` + Item T `json:"item"` } func annotateContentWithTooltips[T comparable]( @@ -464,17 +464,17 @@ func annotateContentWithTooltips[T comparable]( // so we can insert multiple times on a line without counting sorted := slices.Clone(markersAndItems) slices.SortFunc(sorted, func(a, b markerAndItem[T]) int { - if c := cmp.Compare(a.marker.FileName(), b.marker.FileName()); c != 0 { + if c := cmp.Compare(a.Marker.FileName(), b.Marker.FileName()); c != 0 { return c } - return -cmp.Compare(a.marker.Position, b.marker.Position) + return -cmp.Compare(a.Marker.Position, b.Marker.Position) }) filesToLines := collections.NewOrderedMapWithSizeHint[string, []string](1) var previous T for _, itemAndMarker := range sorted { - marker := itemAndMarker.marker - item := itemAndMarker.item + marker := itemAndMarker.Marker + item := itemAndMarker.Item textRange := getRange(item) if textRange == nil { diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go index 7187a7e5fa..2c6de8cc23 100644 --- a/internal/fourslash/fourslash.go +++ b/internal/fourslash/fourslash.go @@ -919,7 +919,7 @@ func (f *FourslashTest) VerifyBaselineHover(t *testing.T) { f.baseline = nil }() - itemsMarkers := core.MapFiltered(f.Markers(), func(marker *Marker) (markerAndItem[*lsproto.Hover], bool) { + markersAndItems := core.MapFiltered(f.Markers(), func(marker *Marker) (markerAndItem[*lsproto.Hover], bool) { if marker.Name == nil { return markerAndItem[*lsproto.Hover]{}, false } @@ -945,7 +945,7 @@ func (f *FourslashTest) VerifyBaselineHover(t *testing.T) { t.Fatalf(prefix+"Unexpected response type for quick info request: %T", resMsg.AsResponse().Result) } - return markerAndItem[*lsproto.Hover]{marker: marker, item: result.Hover}, true + return markerAndItem[*lsproto.Hover]{Marker: marker, Item: result.Hover}, true }) getRange := func(item *lsproto.Hover) *lsproto.Range { @@ -980,7 +980,12 @@ func (f *FourslashTest) VerifyBaselineHover(t *testing.T) { return result } - f.baseline.addResult("QuickInfo", annotateContentWithTooltips(t, f, itemsMarkers, "quickinfo", getRange, getTooltipLines)) + f.baseline.addResult("QuickInfo", annotateContentWithTooltips(t, f, markersAndItems, "quickinfo", getRange, getTooltipLines)) + if jsonStr, err := core.StringifyJson(markersAndItems, "", " "); err == nil { + f.baseline.content.WriteString(jsonStr) + } else { + t.Fatalf("Failed to stringify markers and items for baseline: %v", err) + } baseline.Run(t, f.baseline.getBaselineFileName(), f.baseline.content.String(), baseline.Options{}) } From 17afdd5e3eae8ebcc17d907501b169b69f0405ce Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 15:33:59 -0700 Subject: [PATCH 09/12] Accept baselines. --- ...fContextSensitiveParameterNoCrash.baseline | 19 + .../DeprecatedInheritedJSDocOverload.baseline | 19 + .../hover/JsDocAliasQuickInfo.baseline | 38 + .../hover/JsDocTypeTagQuickInfo1.baseline | 223 +++ .../hover/JsDocTypeTagQuickInfo2.baseline | 206 +++ .../hover/JsDocTypedefQuickInfo1.baseline | 36 + .../fourslash/hover/JsdocLink1.baseline | 19 + .../fourslash/hover/JsdocLink4.baseline | 53 + .../fourslash/hover/JsdocLink5.baseline | 19 + .../hover/JsdocOnInheritedMembers1.baseline | 19 + .../hover/JsdocOnInheritedMembers2.baseline | 19 + ...oAtPropWithAmbientDeclarationInJs.baseline | 14 + ...foCircularInstantiationExpression.baseline | 19 + .../hover/QuickInfoCommentsClass.baseline | 444 +++++ .../QuickInfoCommentsClassMembers.baseline | 1566 +++++++++++++++++ .../QuickInfoCommentsCommentParsing.baseline | 932 ++++++++++ ...ckInfoCommentsFunctionDeclaration.baseline | 87 + ...ickInfoCommentsFunctionExpression.baseline | 189 ++ ...splayPartsArrowFunctionExpression.baseline | 138 ++ .../hover/QuickInfoDisplayPartsClass.baseline | 87 + ...ickInfoDisplayPartsClassAccessors.baseline | 546 ++++++ ...nfoDisplayPartsClassAutoAccessors.baseline | 444 +++++ ...kInfoDisplayPartsClassConstructor.baseline | 444 +++++ ...DisplayPartsClassDefaultAnonymous.baseline | 50 + ...InfoDisplayPartsClassDefaultNamed.baseline | 67 + ...ckInfoDisplayPartsClassIncomplete.baseline | 26 + .../QuickInfoDisplayPartsClassMethod.baseline | 274 +++ ...uickInfoDisplayPartsClassProperty.baseline | 274 +++ .../hover/QuickInfoDisplayPartsConst.baseline | 274 +++ .../hover/QuickInfoDisplayPartsEnum1.baseline | 512 ++++++ .../hover/QuickInfoDisplayPartsEnum2.baseline | 512 ++++++ .../hover/QuickInfoDisplayPartsEnum3.baseline | 512 ++++++ .../hover/QuickInfoDisplayPartsEnum4.baseline | 36 + ...foDisplayPartsExternalModuleAlias.baseline | 74 + ...ckInfoDisplayPartsExternalModules.baseline | 286 +++ .../QuickInfoDisplayPartsFunction.baseline | 240 +++ ...nfoDisplayPartsFunctionExpression.baseline | 104 ++ ...nfoDisplayPartsFunctionIncomplete.baseline | 50 + .../QuickInfoDisplayPartsInterface.baseline | 53 + ...kInfoDisplayPartsInterfaceMembers.baseline | 155 ++ ...foDisplayPartsInternalModuleAlias.baseline | 138 ++ .../hover/QuickInfoDisplayPartsLet.baseline | 274 +++ ...nfoDisplayPartsLiteralLikeNames01.baseline | 172 ++ ...uickInfoDisplayPartsLocalFunction.baseline | 274 +++ .../QuickInfoDisplayPartsModules.baseline | 286 +++ .../QuickInfoDisplayPartsParameters.baseline | 155 ++ .../QuickInfoDisplayPartsTypeAlias.baseline | 104 ++ ...oDisplayPartsTypeParameterInClass.baseline | 699 ++++++++ ...splayPartsTypeParameterInFunction.baseline | 206 +++ ...arameterInFunctionLikeInTypeAlias.baseline | 53 + ...playPartsTypeParameterInInterface.baseline | 1107 ++++++++++++ ...playPartsTypeParameterInTypeAlias.baseline | 104 ++ .../hover/QuickInfoDisplayPartsUsing.baseline | 36 + .../hover/QuickInfoDisplayPartsVar.baseline | 240 +++ ...oDisplayPartsVarWithStringTypes01.baseline | 53 + ...ForArgumentsPropertyNameInJsMode1.baseline | 36 + ...ForArgumentsPropertyNameInJsMode2.baseline | 36 + .../QuickInfoForConstAssertions.baseline | 70 + .../hover/QuickInfoForJSDocCodefence.baseline | 36 + .../QuickInfoForJSDocUnknownTag.baseline | 87 + .../QuickInfoForJSDocWithHttpLinks.baseline | 89 + ...foForJSDocWithUnresolvedHttpLinks.baseline | 36 + ...InfoForObjectBindingElementName03.baseline | 19 + ...InfoForObjectBindingElementName04.baseline | 36 + ...InfoForObjectBindingElementName05.baseline | 19 + ...InfoForObjectBindingElementName06.baseline | 19 + .../hover/QuickInfoImportMeta.baseline | 31 + .../hover/QuickInfoInheritDoc.baseline | 53 + .../hover/QuickInfoInheritDoc2.baseline | 19 + .../hover/QuickInfoInheritDoc3.baseline | 19 + .../hover/QuickInfoInheritDoc4.baseline | 19 + .../hover/QuickInfoInheritDoc5.baseline | 19 + .../hover/QuickInfoInheritDoc6.baseline | 19 + .../QuickInfoJSDocAtBeforeSpace.baseline | 53 + .../hover/QuickInfoJSDocTags.baseline | 215 +++ .../fourslash/hover/QuickInfoJsDoc.baseline | 201 +++ .../hover/QuickInfoJsDocAlias.baseline | 14 + .../hover/QuickInfoJsDocGetterSetter.baseline | 155 ++ .../hover/QuickInfoJsDocInheritage.baseline | 410 +++++ .../hover/QuickInfoJsDocTags1.baseline | 19 + .../hover/QuickInfoJsDocTags10.baseline | 19 + .../hover/QuickInfoJsDocTags11.baseline | 19 + .../hover/QuickInfoJsDocTags12.baseline | 19 + .../hover/QuickInfoJsDocTags14.baseline | 19 + .../hover/QuickInfoJsDocTags15.baseline | 38 + .../hover/QuickInfoJsDocTags16.baseline | 36 + .../hover/QuickInfoJsDocTags3.baseline | 19 + .../hover/QuickInfoJsDocTags4.baseline | 19 + .../hover/QuickInfoJsDocTags5.baseline | 19 + .../hover/QuickInfoJsDocTags6.baseline | 19 + .../hover/QuickInfoJsDocTags7.baseline | 19 + .../hover/QuickInfoJsDocTags8.baseline | 19 + .../hover/QuickInfoJsDocTags9.baseline | 19 + .../hover/QuickInfoJsDocTagsCallback.baseline | 31 + ...ckInfoJsDocTagsFunctionOverload01.baseline | 36 + ...ckInfoJsDocTagsFunctionOverload03.baseline | 36 + ...ckInfoJsDocTagsFunctionOverload05.baseline | 36 + .../hover/QuickInfoJsDocTagsTypedef.baseline | 31 + .../hover/QuickInfoJsDocThisTag.baseline | 19 + .../fourslash/hover/QuickInfoLink10.baseline | 19 + .../fourslash/hover/QuickInfoLink11.baseline | 19 + .../fourslash/hover/QuickInfoLink5.baseline | 19 + .../fourslash/hover/QuickInfoLink6.baseline | 19 + .../fourslash/hover/QuickInfoLink7.baseline | 19 + .../fourslash/hover/QuickInfoLink8.baseline | 19 + .../fourslash/hover/QuickInfoLink9.baseline | 14 + ...nfoNestedExportEqualExportDefault.baseline | 31 + ...laredUsingCatchCallIndexSignature.baseline | 19 + ...singTemplateLiteralTypeSignatures.baseline | 36 + .../QuickInfoOnJsxNamespacedName.baseline | 14 + .../QuickInfoOnParameterProperties.baseline | 36 + .../fourslash/hover/QuickInfoOnThis5.baseline | 99 ++ ...rtiesWithIdenticalJSDocComments01.baseline | 19 + ...hodsOnAssignedFunctionExpressions.baseline | 19 + .../hover/QuickInfoSatisfiesTag.baseline | 19 + .../hover/QuickInfoTypedefTag.baseline | 53 + .../hover/QuickInfoUniqueSymbolJsDoc.baseline | 19 + 117 files changed, 15673 insertions(+) diff --git a/testdata/baselines/reference/fourslash/hover/CompletionDetailsOfContextSensitiveParameterNoCrash.baseline b/testdata/baselines/reference/fourslash/hover/CompletionDetailsOfContextSensitiveParameterNoCrash.baseline index dd25c25279..d2880773ac 100644 --- a/testdata/baselines/reference/fourslash/hover/CompletionDetailsOfContextSensitiveParameterNoCrash.baseline +++ b/testdata/baselines/reference/fourslash/hover/CompletionDetailsOfContextSensitiveParameterNoCrash.baseline @@ -93,3 +93,22 @@ // }, // 3 // ); +[ + { + "marker": { + "Position": 3101, + "LSPosition": { + "line": 82, + "character": 60 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) args: []\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/DeprecatedInheritedJSDocOverload.baseline b/testdata/baselines/reference/fourslash/hover/DeprecatedInheritedJSDocOverload.baseline index 138063e2ea..51e1d5da74 100644 --- a/testdata/baselines/reference/fourslash/hover/DeprecatedInheritedJSDocOverload.baseline +++ b/testdata/baselines/reference/fourslash/hover/DeprecatedInheritedJSDocOverload.baseline @@ -32,3 +32,22 @@ // | ---------------------------------------------------------------------- // console.log('something happened'); // }); +[ + { + "marker": { + "Position": 1183, + "LSPosition": { + "line": 22, + "character": 11 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) ThingWithDeprecations.subscribe(observer?: PartialObserver\u003cvoid\u003e): Subscription\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/JsDocAliasQuickInfo.baseline b/testdata/baselines/reference/fourslash/hover/JsDocAliasQuickInfo.baseline index 6c61a22d1e..a937d82c4b 100644 --- a/testdata/baselines/reference/fourslash/hover/JsDocAliasQuickInfo.baseline +++ b/testdata/baselines/reference/fourslash/hover/JsDocAliasQuickInfo.baseline @@ -21,3 +21,41 @@ // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 44, + "LSPosition": { + "line": 4, + "character": 7 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 9, + "LSPosition": { + "line": 0, + "character": 9 + }, + "Name": "2", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 20, + "LSPosition": { + "line": 0, + "character": 20 + }, + "Name": "3", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo1.baseline b/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo1.baseline index d8b09c1108..26cb913864 100644 --- a/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo1.baseline +++ b/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo1.baseline @@ -117,3 +117,226 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 26, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar S: String\n```\n" + } + } + }, + { + "marker": { + "Position": 55, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar N: Number\n```\n" + } + } + }, + { + "marker": { + "Position": 85, + "LSPosition": { + "line": 5, + "character": 4 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar B: Boolean\n```\n" + } + } + }, + { + "marker": { + "Position": 112, + "LSPosition": { + "line": 7, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar V: Void\n```\n" + } + } + }, + { + "marker": { + "Position": 144, + "LSPosition": { + "line": 9, + "character": 4 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar U: Undefined\n```\n" + } + } + }, + { + "marker": { + "Position": 171, + "LSPosition": { + "line": 11, + "character": 4 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar Nl: Null\n```\n" + } + } + }, + { + "marker": { + "Position": 200, + "LSPosition": { + "line": 13, + "character": 4 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar A: any[]\n```\n" + } + } + }, + { + "marker": { + "Position": 230, + "LSPosition": { + "line": 15, + "character": 4 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar P: Promise\u003cany\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 259, + "LSPosition": { + "line": 17, + "character": 4 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar Obj: Object\n```\n" + } + } + }, + { + "marker": { + "Position": 292, + "LSPosition": { + "line": 19, + "character": 4 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar Func: Function\n```\n" + } + } + }, + { + "marker": { + "Position": 319, + "LSPosition": { + "line": 21, + "character": 4 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar AnyType: any\n```\n" + } + } + }, + { + "marker": { + "Position": 349, + "LSPosition": { + "line": 23, + "character": 4 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar QType: any\n```\n" + } + } + }, + { + "marker": { + "Position": 389, + "LSPosition": { + "line": 25, + "character": 4 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar SOrN: Number | String\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo2.baseline b/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo2.baseline index 4805d85636..8256aae55f 100644 --- a/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo2.baseline +++ b/testdata/baselines/reference/fourslash/hover/JsDocTypeTagQuickInfo2.baseline @@ -108,3 +108,209 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 26, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar s: string\n```\n" + } + } + }, + { + "marker": { + "Position": 55, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar n: number\n```\n" + } + } + }, + { + "marker": { + "Position": 85, + "LSPosition": { + "line": 5, + "character": 4 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar b: boolean\n```\n" + } + } + }, + { + "marker": { + "Position": 112, + "LSPosition": { + "line": 7, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar v: void\n```\n" + } + } + }, + { + "marker": { + "Position": 144, + "LSPosition": { + "line": 9, + "character": 4 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar u: undefined\n```\n" + } + } + }, + { + "marker": { + "Position": 171, + "LSPosition": { + "line": 11, + "character": 4 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar nl: null\n```\n" + } + } + }, + { + "marker": { + "Position": 200, + "LSPosition": { + "line": 13, + "character": 4 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar a: array\n```\n" + } + } + }, + { + "marker": { + "Position": 230, + "LSPosition": { + "line": 15, + "character": 4 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar p: promise\n```\n" + } + } + }, + { + "marker": { + "Position": 260, + "LSPosition": { + "line": 17, + "character": 4 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar nullable: number\n```\n" + } + } + }, + { + "marker": { + "Position": 298, + "LSPosition": { + "line": 19, + "character": 4 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar func: function\n```\n" + } + } + }, + { + "marker": { + "Position": 349, + "LSPosition": { + "line": 21, + "character": 4 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar func1: function\n```\n" + } + } + }, + { + "marker": { + "Position": 391, + "LSPosition": { + "line": 23, + "character": 4 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar sOrn: string | number\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/JsDocTypedefQuickInfo1.baseline b/testdata/baselines/reference/fourslash/hover/JsDocTypedefQuickInfo1.baseline index 6f08eefdff..dd0f3ea79a 100644 --- a/testdata/baselines/reference/fourslash/hover/JsDocTypedefQuickInfo1.baseline +++ b/testdata/baselines/reference/fourslash/hover/JsDocTypedefQuickInfo1.baseline @@ -40,3 +40,39 @@ // opts1.x; // } // foo1({x: 'abc'}); +[ + { + "marker": { + "Position": 179, + "LSPosition": { + "line": 9, + "character": 13 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) opts: Opts\n```\n" + } + } + }, + { + "marker": { + "Position": 400, + "LSPosition": { + "line": 22, + "character": 14 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) opts1: any\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/JsdocLink1.baseline b/testdata/baselines/reference/fourslash/hover/JsdocLink1.baseline index 9b62932940..02e82b260b 100644 --- a/testdata/baselines/reference/fourslash/hover/JsdocLink1.baseline +++ b/testdata/baselines/reference/fourslash/hover/JsdocLink1.baseline @@ -27,3 +27,22 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 189, + "LSPosition": { + "line": 10, + "character": 9 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction CC(): void\n```\n`C`\n\n*@wat* — Makes a `C`. A default one.\nC()\nC|postfix text\nunformattedpostfix text\n\n*@see* — `C` its great\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/JsdocLink4.baseline b/testdata/baselines/reference/fourslash/hover/JsdocLink4.baseline index 6b0cb597e8..3459cd2bd8 100644 --- a/testdata/baselines/reference/fourslash/hover/JsdocLink4.baseline +++ b/testdata/baselines/reference/fourslash/hover/JsdocLink4.baseline @@ -37,3 +37,56 @@ // | *@param* `x` — one Poshere too // | ---------------------------------------------------------------------- // type Pos = [number, number] +[ + { + "marker": { + "Position": 42, + "LSPosition": { + "line": 2, + "character": 5 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) I.bar(): void\n```\n`I`" + } + } + }, + { + "marker": { + "Position": 75, + "LSPosition": { + "line": 5, + "character": 5 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar n: number\n```\n`I`" + } + } + }, + { + "marker": { + "Position": 208, + "LSPosition": { + "line": 12, + "character": 1 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f(x: any): void\n```\nA real, very serious Ito an interface. Right there.\n\n*@param* `x` — one Poshere too" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/JsdocLink5.baseline b/testdata/baselines/reference/fourslash/hover/JsdocLink5.baseline index 6d5e6ae2c0..98c33ab3e3 100644 --- a/testdata/baselines/reference/fourslash/hover/JsdocLink5.baseline +++ b/testdata/baselines/reference/fourslash/hover/JsdocLink5.baseline @@ -16,3 +16,22 @@ // | g() g() g() g() 0 g()1 g() 2 // | u() u() u() u() 0 u()1 u() 2 // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 210, + "LSPosition": { + "line": 7, + "character": 1 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f(x: any): void\n```\ng() g() g() g() 0 g()1 g() 2\nu() u() u() u() 0 u()1 u() 2" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers1.baseline b/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers1.baseline index 329297f715..ed5386f3b6 100644 --- a/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers1.baseline +++ b/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers1.baseline @@ -20,3 +20,22 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 175, + "LSPosition": { + "line": 12, + "character": 8 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) B.method(): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers2.baseline b/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers2.baseline index d5371c3d44..da3f7741f2 100644 --- a/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers2.baseline +++ b/testdata/baselines/reference/fourslash/hover/JsdocOnInheritedMembers2.baseline @@ -20,3 +20,22 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 183, + "LSPosition": { + "line": 12, + "character": 8 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) B.method(): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoAtPropWithAmbientDeclarationInJs.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoAtPropWithAmbientDeclarationInJs.baseline index 8cf9f12d36..087baa1130 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoAtPropWithAmbientDeclarationInJs.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoAtPropWithAmbientDeclarationInJs.baseline @@ -13,3 +13,17 @@ // | ---------------------------------------------------------------------- // } // } +[ + { + "marker": { + "Position": 122, + "LSPosition": { + "line": 6, + "character": 21 + }, + "Name": "", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCircularInstantiationExpression.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCircularInstantiationExpression.baseline index 7f8f0dbf54..07bd858191 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoCircularInstantiationExpression.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCircularInstantiationExpression.baseline @@ -9,3 +9,22 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 46, + "LSPosition": { + "line": 1, + "character": 0 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo\u003cstring\u003e(t: string): (t: string) =\u003e ...\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClass.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClass.baseline index a6231800b1..8d13ffc6ff 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClass.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClass.baseline @@ -239,3 +239,447 @@ // | ``` // | constructor comment // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 50, + "LSPosition": { + "line": 1, + "character": 7 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c2\n```\nThis is class c2 without constructor" + } + } + }, + { + "marker": { + "Position": 61, + "LSPosition": { + "line": 3, + "character": 5 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i2: c2\n```\n" + } + } + }, + { + "marker": { + "Position": 70, + "LSPosition": { + "line": 3, + "character": 14 + }, + "Name": "28", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c2\n```\nThis is class c2 without constructor" + } + } + }, + { + "marker": { + "Position": 81, + "LSPosition": { + "line": 4, + "character": 6 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i2_c: typeof c2\n```\n" + } + } + }, + { + "marker": { + "Position": 87, + "LSPosition": { + "line": 4, + "character": 12 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c2\n```\nThis is class c2 without constructor" + } + } + }, + { + "marker": { + "Position": 97, + "LSPosition": { + "line": 5, + "character": 7 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c3\n```\n" + } + } + }, + { + "marker": { + "Position": 164, + "LSPosition": { + "line": 10, + "character": 5 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i3: c3\n```\n" + } + } + }, + { + "marker": { + "Position": 173, + "LSPosition": { + "line": 10, + "character": 14 + }, + "Name": "29", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor c3(): c3\n```\nConstructor comment" + } + } + }, + { + "marker": { + "Position": 184, + "LSPosition": { + "line": 11, + "character": 6 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i3_c: typeof c3\n```\n" + } + } + }, + { + "marker": { + "Position": 190, + "LSPosition": { + "line": 11, + "character": 12 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c3\n```\n" + } + } + }, + { + "marker": { + "Position": 220, + "LSPosition": { + "line": 13, + "character": 7 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c4\n```\nClass comment" + } + } + }, + { + "marker": { + "Position": 287, + "LSPosition": { + "line": 18, + "character": 5 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i4: c4\n```\n" + } + } + }, + { + "marker": { + "Position": 296, + "LSPosition": { + "line": 18, + "character": 14 + }, + "Name": "30", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor c4(): c4\n```\nConstructor comment" + } + } + }, + { + "marker": { + "Position": 307, + "LSPosition": { + "line": 19, + "character": 6 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i4_c: typeof c4\n```\n" + } + } + }, + { + "marker": { + "Position": 313, + "LSPosition": { + "line": 19, + "character": 12 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c4\n```\nClass comment" + } + } + }, + { + "marker": { + "Position": 348, + "LSPosition": { + "line": 21, + "character": 7 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c5\n```\nClass with statics" + } + } + }, + { + "marker": { + "Position": 382, + "LSPosition": { + "line": 24, + "character": 5 + }, + "Name": "17", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i5: c5\n```\n" + } + } + }, + { + "marker": { + "Position": 391, + "LSPosition": { + "line": 24, + "character": 14 + }, + "Name": "31", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c5\n```\nClass with statics" + } + } + }, + { + "marker": { + "Position": 403, + "LSPosition": { + "line": 25, + "character": 7 + }, + "Name": "19", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i5_c: typeof c5\n```\n" + } + } + }, + { + "marker": { + "Position": 408, + "LSPosition": { + "line": 25, + "character": 12 + }, + "Name": "20", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c5\n```\nClass with statics" + } + } + }, + { + "marker": { + "Position": 459, + "LSPosition": { + "line": 27, + "character": 7 + }, + "Name": "21", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c6\n```\nclass with statics and constructor" + } + } + }, + { + "marker": { + "Position": 570, + "LSPosition": { + "line": 34, + "character": 5 + }, + "Name": "22", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i6: c6\n```\n" + } + } + }, + { + "marker": { + "Position": 579, + "LSPosition": { + "line": 34, + "character": 14 + }, + "Name": "32", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor c6(): c6\n```\nconstructor comment" + } + } + }, + { + "marker": { + "Position": 590, + "LSPosition": { + "line": 35, + "character": 6 + }, + "Name": "24", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i6_c: typeof c6\n```\n" + } + } + }, + { + "marker": { + "Position": 596, + "LSPosition": { + "line": 35, + "character": 12 + }, + "Name": "25", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c6\n```\nclass with statics and constructor" + } + } + }, + { + "marker": { + "Position": 935, + "LSPosition": { + "line": 56, + "character": 22 + }, + "Name": "33", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor m.m2.c1(): m.m2.c1\n```\nconstructor comment" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClassMembers.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClassMembers.baseline index 241ad4ca6b..980bc06753 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClassMembers.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsClassMembers.baseline @@ -778,3 +778,1569 @@ // | ---------------------------------------------------------------------- // } // } +[ + { + "marker": { + "Position": 36, + "LSPosition": { + "line": 1, + "character": 7 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c1\n```\nThis is comment for c1" + } + } + }, + { + "marker": { + "Position": 83, + "LSPosition": { + "line": 3, + "character": 12 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c1.p1: number\n```\np1 is property of c1" + } + } + }, + { + "marker": { + "Position": 134, + "LSPosition": { + "line": 5, + "character": 12 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.p2(b: number): number\n```\nsum with property" + } + } + }, + { + "marker": { + "Position": 246, + "LSPosition": { + "line": 9, + "character": 16 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.p3: number\n```\ngetter property 1" + } + } + }, + { + "marker": { + "Position": 273, + "LSPosition": { + "line": 10, + "character": 21 + }, + "Name": "8q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.p2(b: number): number\n```\nsum with property" + } + } + }, + { + "marker": { + "Position": 335, + "LSPosition": { + "line": 13, + "character": 16 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.p3: number\n```\ngetter property 1" + } + } + }, + { + "marker": { + "Position": 397, + "LSPosition": { + "line": 14, + "character": 24 + }, + "Name": "13q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.p2(b: number): number\n```\nsum with property" + } + } + }, + { + "marker": { + "Position": 458, + "LSPosition": { + "line": 17, + "character": 13 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c1.pp1: number\n```\npp1 is property of c1" + } + } + }, + { + "marker": { + "Position": 511, + "LSPosition": { + "line": 19, + "character": 13 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.pp2(b: number): number\n```\nsum with property" + } + } + }, + { + "marker": { + "Position": 625, + "LSPosition": { + "line": 23, + "character": 17 + }, + "Name": "18", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.pp3: number\n```\ngetter property 2" + } + } + }, + { + "marker": { + "Position": 653, + "LSPosition": { + "line": 24, + "character": 21 + }, + "Name": "20q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.pp2(b: number): number\n```\nsum with property" + } + } + }, + { + "marker": { + "Position": 718, + "LSPosition": { + "line": 27, + "character": 17 + }, + "Name": "22", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.pp3: number\n```\ngetter property 2" + } + } + }, + { + "marker": { + "Position": 783, + "LSPosition": { + "line": 28, + "character": 25 + }, + "Name": "25q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.pp2(b: number): number\n```\nsum with property" + } + } + }, + { + "marker": { + "Position": 840, + "LSPosition": { + "line": 31, + "character": 11 + }, + "Name": "26", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor c1(): c1\n```\nConstructor method" + } + } + }, + { + "marker": { + "Position": 905, + "LSPosition": { + "line": 34, + "character": 12 + }, + "Name": "27", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c1.s1: number\n```\ns1 is static property of c1" + } + } + }, + { + "marker": { + "Position": 963, + "LSPosition": { + "line": 36, + "character": 12 + }, + "Name": "28", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.s2(b: number): number\n```\nstatic sum with property" + } + } + }, + { + "marker": { + "Position": 1078, + "LSPosition": { + "line": 40, + "character": 16 + }, + "Name": "32", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.s3: number\n```\nstatic getter property" + } + } + }, + { + "marker": { + "Position": 1103, + "LSPosition": { + "line": 41, + "character": 19 + }, + "Name": "35q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.s2(b: number): number\n```\nstatic sum with property" + } + } + }, + { + "marker": { + "Position": 1163, + "LSPosition": { + "line": 44, + "character": 16 + }, + "Name": "37", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.s3: number\n```\nstatic getter property" + } + } + }, + { + "marker": { + "Position": 1222, + "LSPosition": { + "line": 45, + "character": 20 + }, + "Name": "42q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.s2(b: number): number\n```\nstatic sum with property" + } + } + }, + { + "marker": { + "Position": 1252, + "LSPosition": { + "line": 47, + "character": 14 + }, + "Name": "43", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c1.nc_p1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1278, + "LSPosition": { + "line": 48, + "character": 14 + }, + "Name": "44", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_p2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1349, + "LSPosition": { + "line": 51, + "character": 18 + }, + "Name": "46", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.nc_p3: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1378, + "LSPosition": { + "line": 52, + "character": 22 + }, + "Name": "47q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_p2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1418, + "LSPosition": { + "line": 54, + "character": 17 + }, + "Name": "48", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.nc_p3: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1467, + "LSPosition": { + "line": 55, + "character": 28 + }, + "Name": "49q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_p2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1499, + "LSPosition": { + "line": 57, + "character": 14 + }, + "Name": "50", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c1.nc_pp1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1528, + "LSPosition": { + "line": 58, + "character": 15 + }, + "Name": "51", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_pp2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1601, + "LSPosition": { + "line": 61, + "character": 18 + }, + "Name": "53", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.nc_pp3: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1633, + "LSPosition": { + "line": 62, + "character": 23 + }, + "Name": "54q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_pp2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1677, + "LSPosition": { + "line": 64, + "character": 20 + }, + "Name": "55", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.nc_pp3: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1724, + "LSPosition": { + "line": 65, + "character": 27 + }, + "Name": "56q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_pp2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1758, + "LSPosition": { + "line": 67, + "character": 13 + }, + "Name": "57", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c1.nc_s1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1784, + "LSPosition": { + "line": 68, + "character": 13 + }, + "Name": "58", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_s2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1853, + "LSPosition": { + "line": 71, + "character": 17 + }, + "Name": "60", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.nc_s3: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1881, + "LSPosition": { + "line": 72, + "character": 20 + }, + "Name": "61q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_s2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1919, + "LSPosition": { + "line": 74, + "character": 17 + }, + "Name": "62", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.nc_s3: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1965, + "LSPosition": { + "line": 75, + "character": 25 + }, + "Name": "63q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_s2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1989, + "LSPosition": { + "line": 78, + "character": 5 + }, + "Name": "64", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1: c1\n```\n" + } + } + }, + { + "marker": { + "Position": 1998, + "LSPosition": { + "line": 78, + "character": 14 + }, + "Name": "65q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor c1(): c1\n```\nConstructor method" + } + } + }, + { + "marker": { + "Position": 2009, + "LSPosition": { + "line": 79, + "character": 6 + }, + "Name": "66", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_p: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2027, + "LSPosition": { + "line": 80, + "character": 6 + }, + "Name": "68", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_f: (b: number) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 2036, + "LSPosition": { + "line": 80, + "character": 15 + }, + "Name": "69", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.p2(b: number): number\n```\nsum with property" + } + } + }, + { + "marker": { + "Position": 2045, + "LSPosition": { + "line": 81, + "character": 6 + }, + "Name": "70", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_r: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2054, + "LSPosition": { + "line": 81, + "character": 15 + }, + "Name": "71q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.p2(b: number): number\n```\nsum with property" + } + } + }, + { + "marker": { + "Position": 2069, + "LSPosition": { + "line": 82, + "character": 8 + }, + "Name": "72", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_prop: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2078, + "LSPosition": { + "line": 82, + "character": 17 + }, + "Name": "73", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.p3: number\n```\ngetter property 1" + } + } + }, + { + "marker": { + "Position": 2085, + "LSPosition": { + "line": 83, + "character": 3 + }, + "Name": "74", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.p3: number\n```\ngetter property 1" + } + } + }, + { + "marker": { + "Position": 2093, + "LSPosition": { + "line": 83, + "character": 11 + }, + "Name": "75", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_prop: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2106, + "LSPosition": { + "line": 84, + "character": 7 + }, + "Name": "76", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_nc_p: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2117, + "LSPosition": { + "line": 84, + "character": 18 + }, + "Name": "77", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c1.nc_p1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2129, + "LSPosition": { + "line": 85, + "character": 6 + }, + "Name": "78", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_ncf: (b: number) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 2142, + "LSPosition": { + "line": 85, + "character": 19 + }, + "Name": "79", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_p2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 2153, + "LSPosition": { + "line": 86, + "character": 7 + }, + "Name": "80", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_ncr: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2164, + "LSPosition": { + "line": 86, + "character": 18 + }, + "Name": "81q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_p2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 2181, + "LSPosition": { + "line": 87, + "character": 8 + }, + "Name": "82", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_ncprop: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2193, + "LSPosition": { + "line": 87, + "character": 20 + }, + "Name": "83", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.nc_p3: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2204, + "LSPosition": { + "line": 88, + "character": 5 + }, + "Name": "84", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.nc_p3: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2213, + "LSPosition": { + "line": 88, + "character": 14 + }, + "Name": "85", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_ncprop: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2228, + "LSPosition": { + "line": 89, + "character": 7 + }, + "Name": "86", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_s_p: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2234, + "LSPosition": { + "line": 89, + "character": 13 + }, + "Name": "87", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c1\n```\nThis is comment for c1" + } + } + }, + { + "marker": { + "Position": 2237, + "LSPosition": { + "line": 89, + "character": 16 + }, + "Name": "88", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c1.s1: number\n```\ns1 is static property of c1" + } + } + }, + { + "marker": { + "Position": 2249, + "LSPosition": { + "line": 90, + "character": 8 + }, + "Name": "89", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_s_f: (b: number) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 2257, + "LSPosition": { + "line": 90, + "character": 16 + }, + "Name": "90", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.s2(b: number): number\n```\nstatic sum with property" + } + } + }, + { + "marker": { + "Position": 2268, + "LSPosition": { + "line": 91, + "character": 7 + }, + "Name": "91", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_s_r: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2278, + "LSPosition": { + "line": 91, + "character": 17 + }, + "Name": "92q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.s2(b: number): number\n```\nstatic sum with property" + } + } + }, + { + "marker": { + "Position": 2293, + "LSPosition": { + "line": 92, + "character": 8 + }, + "Name": "93", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_s_prop: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2305, + "LSPosition": { + "line": 92, + "character": 20 + }, + "Name": "94", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.s3: number\n```\nstatic getter property" + } + } + }, + { + "marker": { + "Position": 2312, + "LSPosition": { + "line": 93, + "character": 4 + }, + "Name": "95", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.s3: number\n```\nstatic getter property" + } + } + }, + { + "marker": { + "Position": 2320, + "LSPosition": { + "line": 93, + "character": 12 + }, + "Name": "96", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_s_prop: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2335, + "LSPosition": { + "line": 94, + "character": 8 + }, + "Name": "97", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_s_nc_p: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2347, + "LSPosition": { + "line": 94, + "character": 20 + }, + "Name": "98", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c1.nc_s1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2362, + "LSPosition": { + "line": 95, + "character": 9 + }, + "Name": "99", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_s_ncf: (b: number) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 2373, + "LSPosition": { + "line": 95, + "character": 20 + }, + "Name": "100", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_s2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 2387, + "LSPosition": { + "line": 96, + "character": 9 + }, + "Name": "101", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_s_ncr: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2397, + "LSPosition": { + "line": 96, + "character": 19 + }, + "Name": "102q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c1.nc_s2(b: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 2417, + "LSPosition": { + "line": 97, + "character": 10 + }, + "Name": "103", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_s_ncprop: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2430, + "LSPosition": { + "line": 97, + "character": 23 + }, + "Name": "104", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.nc_s3: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2440, + "LSPosition": { + "line": 98, + "character": 5 + }, + "Name": "105", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c1.nc_s3: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2453, + "LSPosition": { + "line": 98, + "character": 18 + }, + "Name": "106", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_s_ncprop: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2465, + "LSPosition": { + "line": 99, + "character": 6 + }, + "Name": "107", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i1_c: typeof c1\n```\n" + } + } + }, + { + "marker": { + "Position": 2471, + "LSPosition": { + "line": 99, + "character": 12 + }, + "Name": "108", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c1\n```\nThis is comment for c1" + } + } + }, + { + "marker": { + "Position": 2882, + "LSPosition": { + "line": 119, + "character": 14 + }, + "Name": "110", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) cProperties.p2: number\n```\nsetter only property" + } + } + }, + { + "marker": { + "Position": 2902, + "LSPosition": { + "line": 119, + "character": 34 + }, + "Name": "111", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) cProperties.p1: number\n```\ngetter only property" + } + } + }, + { + "marker": { + "Position": 2921, + "LSPosition": { + "line": 120, + "character": 16 + }, + "Name": "112", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) cProperties.nc_p2: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2943, + "LSPosition": { + "line": 120, + "character": 38 + }, + "Name": "113", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) cProperties.nc_p1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 3100, + "LSPosition": { + "line": 126, + "character": 4 + }, + "Name": "119", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithConstructorProperty(a: number): cWithConstructorProperty\n```\nthis is class cWithConstructorProperty's constructor\n\n*@param* `a` — this is first parameter a\n" + } + } + }, + { + "marker": { + "Position": 3167, + "LSPosition": { + "line": 127, + "character": 13 + }, + "Name": "118", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar bbbb: number\n```\n" + } + } + }, + { + "marker": { + "Position": 3187, + "LSPosition": { + "line": 128, + "character": 10 + }, + "Name": "116", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nthis\n```\n" + } + } + }, + { + "marker": { + "Position": 3190, + "LSPosition": { + "line": 128, + "character": 13 + }, + "Name": "114", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) cWithConstructorProperty.a: number\n```\nmore info about a" + } + } + }, + { + "marker": { + "Position": 3194, + "LSPosition": { + "line": 128, + "character": 17 + }, + "Name": "115", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: number\n```\nmore info about a" + } + } + }, + { + "marker": { + "Position": 3204, + "LSPosition": { + "line": 128, + "character": 27 + }, + "Name": "117", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar bbbb: number\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsCommentParsing.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsCommentParsing.baseline index 430a5c24c1..17a6773289 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsCommentParsing.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsCommentParsing.baseline @@ -696,3 +696,935 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 58, + "LSPosition": { + "line": 4, + "character": 3 + }, + "Name": "1q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction simple(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 190, + "LSPosition": { + "line": 11, + "character": 3 + }, + "Name": "2q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction multiLine(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 291, + "LSPosition": { + "line": 16, + "character": 5 + }, + "Name": "3q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocSingleLine(): void\n```\nthis is eg of single line jsdoc style comment" + } + } + }, + { + "marker": { + "Position": 413, + "LSPosition": { + "line": 24, + "character": 6 + }, + "Name": "4q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocMultiLine(): void\n```\nthis is multiple line jsdoc stule comment\nNew line1\nNew Line2" + } + } + }, + { + "marker": { + "Position": 618, + "LSPosition": { + "line": 33, + "character": 7 + }, + "Name": "5q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocMultiLineMerge(): void\n```\nAnother this one too" + } + } + }, + { + "marker": { + "Position": 725, + "LSPosition": { + "line": 40, + "character": 8 + }, + "Name": "6q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocMixedComments1(): void\n```\njsdoc comment" + } + } + }, + { + "marker": { + "Position": 856, + "LSPosition": { + "line": 46, + "character": 7 + }, + "Name": "7q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocMixedComments2(): void\n```\nanother jsDocComment" + } + } + }, + { + "marker": { + "Position": 994, + "LSPosition": { + "line": 52, + "character": 9 + }, + "Name": "8q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocMixedComments3(): void\n```\n* triplestar jsDocComment" + } + } + }, + { + "marker": { + "Position": 1154, + "LSPosition": { + "line": 59, + "character": 10 + }, + "Name": "9q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocMixedComments4(): void\n```\nanother jsDocComment" + } + } + }, + { + "marker": { + "Position": 1336, + "LSPosition": { + "line": 67, + "character": 6 + }, + "Name": "10q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocMixedComments5(): void\n```\nanother jsDocComment" + } + } + }, + { + "marker": { + "Position": 1524, + "LSPosition": { + "line": 76, + "character": 8 + }, + "Name": "11q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocMixedComments6(): void\n```\njsdoc comment" + } + } + }, + { + "marker": { + "Position": 1608, + "LSPosition": { + "line": 81, + "character": 5 + }, + "Name": "12q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction noHelpComment1(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 1695, + "LSPosition": { + "line": 86, + "character": 7 + }, + "Name": "13q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction noHelpComment2(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 1744, + "LSPosition": { + "line": 90, + "character": 7 + }, + "Name": "14q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction noHelpComment3(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 1880, + "LSPosition": { + "line": 95, + "character": 13 + }, + "Name": "16aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: number\n```\nfirst number\n" + } + } + }, + { + "marker": { + "Position": 1891, + "LSPosition": { + "line": 95, + "character": 24 + }, + "Name": "17aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: number\n```\nsecond number\n" + } + } + }, + { + "marker": { + "Position": 1925, + "LSPosition": { + "line": 98, + "character": 1 + }, + "Name": "16q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction sum(a: number, b: number): number\n```\nAdds two integers and returns the result\n\n*@param* `a` — first number\n\n\n*@param* `b` — second number\n" + } + } + }, + { + "marker": { + "Position": 2111, + "LSPosition": { + "line": 106, + "character": 18 + }, + "Name": "19aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: number\n```\nfirst number\n" + } + } + }, + { + "marker": { + "Position": 2122, + "LSPosition": { + "line": 106, + "character": 29 + }, + "Name": "20aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2133, + "LSPosition": { + "line": 106, + "character": 40 + }, + "Name": "21aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) c: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2145, + "LSPosition": { + "line": 106, + "character": 52 + }, + "Name": "22aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) d: any\n```\n" + } + } + }, + { + "marker": { + "Position": 2149, + "LSPosition": { + "line": 106, + "character": 56 + }, + "Name": "23aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) e: any\n```\nLastParam " + } + } + }, + { + "marker": { + "Position": 2161, + "LSPosition": { + "line": 108, + "character": 4 + }, + "Name": "19q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction multiply(a: number, b: number, c?: number, d?: any, e?: any): void\n```\nThis 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*" + } + } + }, + { + "marker": { + "Position": 2253, + "LSPosition": { + "line": 112, + "character": 12 + }, + "Name": "25aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2277, + "LSPosition": { + "line": 113, + "character": 12 + }, + "Name": "26aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: string\n```\n" + } + } + }, + { + "marker": { + "Position": 2370, + "LSPosition": { + "line": 118, + "character": 1 + }, + "Name": "25q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f1(a: number): any\n```\nfn f1 with number\n\n*@param* `b` — about b\n" + } + } + }, + { + "marker": { + "Position": 2378, + "LSPosition": { + "line": 119, + "character": 1 + }, + "Name": "26q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f1(b: string): any\n```\n" + } + } + }, + { + "marker": { + "Position": 2716, + "LSPosition": { + "line": 129, + "character": 18 + }, + "Name": "28aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2727, + "LSPosition": { + "line": 129, + "character": 29 + }, + "Name": "29aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: number\n```\nthis is about b\n" + } + } + }, + { + "marker": { + "Position": 2738, + "LSPosition": { + "line": 129, + "character": 40 + }, + "Name": "30aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) c: () =\u003e string\n```\nthis is optional param c\n" + } + } + }, + { + "marker": { + "Position": 2756, + "LSPosition": { + "line": 129, + "character": 58 + }, + "Name": "31aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) d: () =\u003e string\n```\nthis is optional param d\n" + } + } + }, + { + "marker": { + "Position": 2774, + "LSPosition": { + "line": 129, + "character": 76 + }, + "Name": "32aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) e: () =\u003e string\n```\nthis is optional param e\n" + } + } + }, + { + "marker": { + "Position": 2792, + "LSPosition": { + "line": 129, + "character": 94 + }, + "Name": "33aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) f: () =\u003e string\n```\n" + } + } + }, + { + "marker": { + "Position": 2818, + "LSPosition": { + "line": 131, + "character": 4 + }, + "Name": "28q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction subtract(a: number, b: number, c?: () =\u003e string, d?: () =\u003e string, e?: () =\u003e string, f?: () =\u003e string): void\n```\nThis 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* `` — { () =\u003e string; } } f this is optional param f\n" + } + } + }, + { + "marker": { + "Position": 3045, + "LSPosition": { + "line": 137, + "character": 16 + }, + "Name": "34aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: number\n```\nthis is input number\n" + } + } + }, + { + "marker": { + "Position": 3081, + "LSPosition": { + "line": 140, + "character": 3 + }, + "Name": "34q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction square(a: number): number\n```\nthis 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" + } + } + }, + { + "marker": { + "Position": 3243, + "LSPosition": { + "line": 146, + "character": 16 + }, + "Name": "35aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: number\n```\nthis is a\n" + } + } + }, + { + "marker": { + "Position": 3254, + "LSPosition": { + "line": 146, + "character": 27 + }, + "Name": "36aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: number\n```\nthis is b\n" + } + } + }, + { + "marker": { + "Position": 3272, + "LSPosition": { + "line": 148, + "character": 3 + }, + "Name": "35q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction divide(a: number, b: number): void\n```\nthis 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" + } + } + }, + { + "marker": { + "Position": 3432, + "LSPosition": { + "line": 154, + "character": 16 + }, + "Name": "37aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) foo: string\n```\nis string\n" + } + } + }, + { + "marker": { + "Position": 3445, + "LSPosition": { + "line": 154, + "character": 29 + }, + "Name": "38aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) bar: string\n```\nis second string\n" + } + } + }, + { + "marker": { + "Position": 3486, + "LSPosition": { + "line": 157, + "character": 2 + }, + "Name": "37q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction fooBar(foo: string, bar: string): string\n```\nFunction returns string concat of foo and bar\n\n*@param* `foo` — is string\n\n\n*@param* `bar` — is second string\n" + } + } + }, + { + "marker": { + "Position": 3782, + "LSPosition": { + "line": 168, + "character": 59 + }, + "Name": "40aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: number\n```\nthis is inline comment for a" + } + } + }, + { + "marker": { + "Position": 3828, + "LSPosition": { + "line": 168, + "character": 105 + }, + "Name": "41aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: number\n```\nthis is inline comment for b" + } + } + }, + { + "marker": { + "Position": 3839, + "LSPosition": { + "line": 168, + "character": 116 + }, + "Name": "42aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) c: number\n```\nit is third parameter\n" + } + } + }, + { + "marker": { + "Position": 3850, + "LSPosition": { + "line": 168, + "character": 127 + }, + "Name": "43aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) d: number\n```\n" + } + } + }, + { + "marker": { + "Position": 3894, + "LSPosition": { + "line": 171, + "character": 3 + }, + "Name": "40q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocParamTest(a: number, b: number, c: number, d: number): number\n```\nthis 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" + } + } + }, + { + "marker": { + "Position": 4040, + "LSPosition": { + "line": 177, + "character": 8 + }, + "Name": "45q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocCommentAlignmentTest1(): void\n```\nThis is function comment\nAnd properly aligned comment" + } + } + }, + { + "marker": { + "Position": 4193, + "LSPosition": { + "line": 183, + "character": 10 + }, + "Name": "46q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocCommentAlignmentTest2(): void\n```\nThis is function comment\n And aligned with 4 space char margin" + } + } + }, + { + "marker": { + "Position": 4778, + "LSPosition": { + "line": 195, + "character": 36 + }, + "Name": "47aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: string\n```\nthis is info about a\nspanning on two lines and aligned perfectly\n" + } + } + }, + { + "marker": { + "Position": 4789, + "LSPosition": { + "line": 195, + "character": 47 + }, + "Name": "48aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: any\n```\nthis 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" + } + } + }, + { + "marker": { + "Position": 4792, + "LSPosition": { + "line": 195, + "character": 50 + }, + "Name": "49aq", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) c: any\n```\nthis is info about b\nnot aligned text about parameter will eat only one space\n" + } + } + }, + { + "marker": { + "Position": 4809, + "LSPosition": { + "line": 197, + "character": 10 + }, + "Name": "47q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction jsDocCommentAlignmentTest3(a: string, b: any, c: any): void\n```\nThis 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" + } + } + }, + { + "marker": { + "Position": 4841, + "LSPosition": { + "line": 198, + "character": 0 + }, + "Name": "", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 4854, + "LSPosition": { + "line": 199, + "character": 12 + }, + "Name": "50q", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass NoQuickInfoClass\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionDeclaration.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionDeclaration.baseline index 4f79bce00c..7a35dc4cea 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionDeclaration.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionDeclaration.baseline @@ -52,3 +52,90 @@ // */ // declare function fn(a: string); // fn("hello"); +[ + { + "marker": { + "Position": 51, + "LSPosition": { + "line": 1, + "character": 10 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): void\n```\nThis comment should appear for foo" + } + } + }, + { + "marker": { + "Position": 61, + "LSPosition": { + "line": 3, + "character": 1 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): void\n```\nThis comment should appear for foo" + } + } + }, + { + "marker": { + "Position": 123, + "LSPosition": { + "line": 5, + "character": 11 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction fooWithParameters(a: string, b: number): void\n```\nThis is comment for function signature" + } + } + }, + { + "marker": { + "Position": 236, + "LSPosition": { + "line": 8, + "character": 8 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar d: string\n```\n" + } + } + }, + { + "marker": { + "Position": 257, + "LSPosition": { + "line": 10, + "character": 12 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction fooWithParameters(a: string, b: number): void\n```\nThis is comment for function signature" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionExpression.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionExpression.baseline index e4e658bbc0..bb2d2d7da6 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionExpression.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoCommentsFunctionExpression.baseline @@ -119,3 +119,192 @@ // | *@returns* — the parameter's length // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 36, + "LSPosition": { + "line": 1, + "character": 8 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar lambdaFoo: (a: number, b: number) =\u003e number\n```\nlambdaFoo var comment" + } + } + }, + { + "marker": { + "Position": 142, + "LSPosition": { + "line": 2, + "character": 12 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar lambddaNoVarComment: (a: number, b: number) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 277, + "LSPosition": { + "line": 4, + "character": 9 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction anotherFunc(a: number): string\n```\n" + } + } + }, + { + "marker": { + "Position": 377, + "LSPosition": { + "line": 7, + "character": 8 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar lambdaVar: (b: string) =\u003e string\n```\ndocumentation\n\n*@param* `b` — inner parameter " + } + } + }, + { + "marker": { + "Position": 407, + "LSPosition": { + "line": 7, + "character": 38 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: string\n```\n" + } + } + }, + { + "marker": { + "Position": 435, + "LSPosition": { + "line": 8, + "character": 12 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar localVar: string\n```\n" + } + } + }, + { + "marker": { + "Position": 471, + "LSPosition": { + "line": 9, + "character": 15 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar localVar: string\n```\n" + } + } + }, + { + "marker": { + "Position": 482, + "LSPosition": { + "line": 9, + "character": 26 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: string\n```\n" + } + } + }, + { + "marker": { + "Position": 506, + "LSPosition": { + "line": 11, + "character": 15 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar lambdaVar: (b: string) =\u003e string\n```\ndocumentation\n\n*@param* `b` — inner parameter " + } + } + }, + { + "marker": { + "Position": 627, + "LSPosition": { + "line": 18, + "character": 8 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar assigned: (s: string) =\u003e number\n```\nOn variable\n\n*@param* `s` — the first parameter!\n\n\n*@returns* — the parameter's length\n" + } + } + }, + { + "marker": { + "Position": 858, + "LSPosition": { + "line": 25, + "character": 5 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar assigned: (s: string) =\u003e number\n```\nOn variable\n\n*@param* `s` — the first parameter!\n\n\n*@returns* — the parameter's length\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsArrowFunctionExpression.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsArrowFunctionExpression.baseline index 52dc944bc6..f02e19c3b6 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsArrowFunctionExpression.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsArrowFunctionExpression.baseline @@ -60,3 +60,141 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 4, + "LSPosition": { + "line": 0, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar x: (a: any) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 8, + "LSPosition": { + "line": 0, + "character": 8 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: any\n```\n" + } + } + }, + { + "marker": { + "Position": 21, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar y: (a: any, b: any) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 26, + "LSPosition": { + "line": 1, + "character": 9 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: any\n```\n" + } + } + }, + { + "marker": { + "Position": 29, + "LSPosition": { + "line": 1, + "character": 12 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: any\n```\n" + } + } + }, + { + "marker": { + "Position": 43, + "LSPosition": { + "line": 2, + "character": 4 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar z: (a: number) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 48, + "LSPosition": { + "line": 2, + "character": 9 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: number\n```\n" + } + } + }, + { + "marker": { + "Position": 70, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar z2: () =\u003e number\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClass.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClass.baseline index b9984b6193..5e185e6668 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClass.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClass.baseline @@ -39,3 +39,90 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 6, + "LSPosition": { + "line": 0, + "character": 6 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + }, + { + "marker": { + "Position": 16, + "LSPosition": { + "line": 2, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\n```\n" + } + } + }, + { + "marker": { + "Position": 32, + "LSPosition": { + "line": 2, + "character": 20 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + }, + { + "marker": { + "Position": 41, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cVal: typeof c\n```\n" + } + } + }, + { + "marker": { + "Position": 48, + "LSPosition": { + "line": 3, + "character": 11 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAccessors.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAccessors.baseline index 0be147c6a0..95a368fee0 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAccessors.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAccessors.baseline @@ -259,3 +259,549 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 25, + "LSPosition": { + "line": 1, + "character": 15 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 72, + "LSPosition": { + "line": 2, + "character": 15 + }, + "Name": "1s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 118, + "LSPosition": { + "line": 3, + "character": 16 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 167, + "LSPosition": { + "line": 4, + "character": 16 + }, + "Name": "2s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 216, + "LSPosition": { + "line": 5, + "character": 18 + }, + "Name": "21", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 269, + "LSPosition": { + "line": 6, + "character": 18 + }, + "Name": "21s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 317, + "LSPosition": { + "line": 7, + "character": 15 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.staticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 364, + "LSPosition": { + "line": 8, + "character": 15 + }, + "Name": "3s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.staticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 418, + "LSPosition": { + "line": 9, + "character": 24 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 480, + "LSPosition": { + "line": 10, + "character": 23 + }, + "Name": "4s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 542, + "LSPosition": { + "line": 11, + "character": 25 + }, + "Name": "41", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 608, + "LSPosition": { + "line": 12, + "character": 25 + }, + "Name": "41s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 703, + "LSPosition": { + "line": 15, + "character": 17 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 736, + "LSPosition": { + "line": 16, + "character": 17 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 770, + "LSPosition": { + "line": 17, + "character": 17 + }, + "Name": "61", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 803, + "LSPosition": { + "line": 18, + "character": 14 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.staticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 833, + "LSPosition": { + "line": 19, + "character": 14 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 870, + "LSPosition": { + "line": 20, + "character": 14 + }, + "Name": "81", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 908, + "LSPosition": { + "line": 21, + "character": 13 + }, + "Name": "5s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 942, + "LSPosition": { + "line": 22, + "character": 13 + }, + "Name": "6s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 977, + "LSPosition": { + "line": 23, + "character": 13 + }, + "Name": "61s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 1011, + "LSPosition": { + "line": 24, + "character": 10 + }, + "Name": "7s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.staticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 1042, + "LSPosition": { + "line": 25, + "character": 10 + }, + "Name": "8s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 1080, + "LSPosition": { + "line": 26, + "character": 10 + }, + "Name": "81s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 1162, + "LSPosition": { + "line": 31, + "character": 4 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\n```\n" + } + } + }, + { + "marker": { + "Position": 1172, + "LSPosition": { + "line": 31, + "character": 14 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 1192, + "LSPosition": { + "line": 32, + "character": 4 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + }, + { + "marker": { + "Position": 1194, + "LSPosition": { + "line": 32, + "character": 6 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.staticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 1210, + "LSPosition": { + "line": 33, + "character": 0 + }, + "Name": "9s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\n```\n" + } + } + }, + { + "marker": { + "Position": 1220, + "LSPosition": { + "line": 33, + "character": 10 + }, + "Name": "10s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 1240, + "LSPosition": { + "line": 34, + "character": 0 + }, + "Name": "11s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + }, + { + "marker": { + "Position": 1242, + "LSPosition": { + "line": 34, + "character": 2 + }, + "Name": "12s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.staticProperty: string\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAutoAccessors.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAutoAccessors.baseline index 8dbfcd96ce..8d8327faa0 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAutoAccessors.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassAutoAccessors.baseline @@ -211,3 +211,447 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 30, + "LSPosition": { + "line": 1, + "character": 20 + }, + "Name": "1a", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 75, + "LSPosition": { + "line": 2, + "character": 21 + }, + "Name": "2a", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 123, + "LSPosition": { + "line": 3, + "character": 23 + }, + "Name": "3a", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 170, + "LSPosition": { + "line": 4, + "character": 20 + }, + "Name": "4a", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.staticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 222, + "LSPosition": { + "line": 5, + "character": 28 + }, + "Name": "5a", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 283, + "LSPosition": { + "line": 6, + "character": 30 + }, + "Name": "6a", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 371, + "LSPosition": { + "line": 9, + "character": 17 + }, + "Name": "1g", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 404, + "LSPosition": { + "line": 10, + "character": 17 + }, + "Name": "2g", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 438, + "LSPosition": { + "line": 11, + "character": 17 + }, + "Name": "3g", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 471, + "LSPosition": { + "line": 12, + "character": 14 + }, + "Name": "4g", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.staticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 501, + "LSPosition": { + "line": 13, + "character": 14 + }, + "Name": "5g", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 538, + "LSPosition": { + "line": 14, + "character": 14 + }, + "Name": "6g", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 576, + "LSPosition": { + "line": 15, + "character": 13 + }, + "Name": "1s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 610, + "LSPosition": { + "line": 16, + "character": 13 + }, + "Name": "2s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 645, + "LSPosition": { + "line": 17, + "character": 13 + }, + "Name": "3s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 679, + "LSPosition": { + "line": 18, + "character": 10 + }, + "Name": "4s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.staticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 710, + "LSPosition": { + "line": 19, + "character": 10 + }, + "Name": "5s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.privateStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 748, + "LSPosition": { + "line": 20, + "character": 10 + }, + "Name": "6s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.protectedStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 830, + "LSPosition": { + "line": 25, + "character": 4 + }, + "Name": "7g", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\n```\n" + } + } + }, + { + "marker": { + "Position": 840, + "LSPosition": { + "line": 25, + "character": 14 + }, + "Name": "8g", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 860, + "LSPosition": { + "line": 26, + "character": 4 + }, + "Name": "9g", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + }, + { + "marker": { + "Position": 862, + "LSPosition": { + "line": 26, + "character": 6 + }, + "Name": "10g", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.staticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 878, + "LSPosition": { + "line": 27, + "character": 0 + }, + "Name": "7s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\n```\n" + } + } + }, + { + "marker": { + "Position": 888, + "LSPosition": { + "line": 27, + "character": 10 + }, + "Name": "8s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 908, + "LSPosition": { + "line": 28, + "character": 0 + }, + "Name": "9s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + }, + { + "marker": { + "Position": 910, + "LSPosition": { + "line": 28, + "character": 2 + }, + "Name": "10s", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) c.staticProperty: string\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassConstructor.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassConstructor.baseline index 5ed122f9c3..2005a1730b 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassConstructor.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassConstructor.baseline @@ -219,3 +219,447 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 14, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor c(): c\n```\n" + } + } + }, + { + "marker": { + "Position": 42, + "LSPosition": { + "line": 4, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\n```\n" + } + } + }, + { + "marker": { + "Position": 58, + "LSPosition": { + "line": 4, + "character": 20 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor c(): c\n```\n" + } + } + }, + { + "marker": { + "Position": 67, + "LSPosition": { + "line": 5, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cVal: typeof c\n```\n" + } + } + }, + { + "marker": { + "Position": 74, + "LSPosition": { + "line": 5, + "character": 11 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + }, + { + "marker": { + "Position": 104, + "LSPosition": { + "line": 7, + "character": 4 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithOverloads(x: string): cWithOverloads\nconstructor cWithOverloads(x: number): cWithOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 132, + "LSPosition": { + "line": 8, + "character": 4 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithOverloads(x: string): cWithOverloads\nconstructor cWithOverloads(x: number): cWithOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 160, + "LSPosition": { + "line": 9, + "character": 4 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithOverloads(x: string): cWithOverloads\nconstructor cWithOverloads(x: number): cWithOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 194, + "LSPosition": { + "line": 12, + "character": 4 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cWithOverloadsInstance: cWithOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 223, + "LSPosition": { + "line": 12, + "character": 33 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithOverloads(x: string): cWithOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 252, + "LSPosition": { + "line": 13, + "character": 4 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cWithOverloadsInstance2: cWithOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 282, + "LSPosition": { + "line": 13, + "character": 34 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithOverloads(x: number): cWithOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 306, + "LSPosition": { + "line": 14, + "character": 4 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cWithOverloadsVal: typeof cWithOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 326, + "LSPosition": { + "line": 14, + "character": 24 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass cWithOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 377, + "LSPosition": { + "line": 16, + "character": 4 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithMultipleOverloads(x: string): cWithMultipleOverloads\nconstructor cWithMultipleOverloads(x: number): cWithMultipleOverloads\nconstructor cWithMultipleOverloads(x: boolean): cWithMultipleOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 405, + "LSPosition": { + "line": 17, + "character": 4 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithMultipleOverloads(x: string): cWithMultipleOverloads\nconstructor cWithMultipleOverloads(x: number): cWithMultipleOverloads\nconstructor cWithMultipleOverloads(x: boolean): cWithMultipleOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 433, + "LSPosition": { + "line": 18, + "character": 4 + }, + "Name": "17", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithMultipleOverloads(x: string): cWithMultipleOverloads\nconstructor cWithMultipleOverloads(x: number): cWithMultipleOverloads\nconstructor cWithMultipleOverloads(x: boolean): cWithMultipleOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 462, + "LSPosition": { + "line": 19, + "character": 4 + }, + "Name": "18", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithMultipleOverloads(x: string): cWithMultipleOverloads\nconstructor cWithMultipleOverloads(x: number): cWithMultipleOverloads\nconstructor cWithMultipleOverloads(x: boolean): cWithMultipleOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 496, + "LSPosition": { + "line": 22, + "character": 4 + }, + "Name": "19", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cWithMultipleOverloadsInstance: cWithMultipleOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 533, + "LSPosition": { + "line": 22, + "character": 41 + }, + "Name": "20", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithMultipleOverloads(x: string): cWithMultipleOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 570, + "LSPosition": { + "line": 23, + "character": 4 + }, + "Name": "21", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cWithMultipleOverloadsInstance2: cWithMultipleOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 608, + "LSPosition": { + "line": 23, + "character": 42 + }, + "Name": "22", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithMultipleOverloads(x: number): cWithMultipleOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 640, + "LSPosition": { + "line": 24, + "character": 4 + }, + "Name": "23", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cWithMultipleOverloadsInstance3: cWithMultipleOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 678, + "LSPosition": { + "line": 24, + "character": 42 + }, + "Name": "24", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor cWithMultipleOverloads(x: boolean): cWithMultipleOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 712, + "LSPosition": { + "line": 25, + "character": 4 + }, + "Name": "25", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cWithMultipleOverloadsVal: typeof cWithMultipleOverloads\n```\n" + } + } + }, + { + "marker": { + "Position": 740, + "LSPosition": { + "line": 25, + "character": 32 + }, + "Name": "26", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass cWithMultipleOverloads\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultAnonymous.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultAnonymous.baseline index cd8b2aafbe..ced3ac2dd5 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultAnonymous.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultAnonymous.baseline @@ -18,3 +18,53 @@ // | No quickinfo at /*4*/. // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 0, + "LSPosition": { + "line": 0, + "character": 0 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 7, + "LSPosition": { + "line": 0, + "character": 7 + }, + "Name": "2", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 15, + "LSPosition": { + "line": 0, + "character": 15 + }, + "Name": "3", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 21, + "LSPosition": { + "line": 0, + "character": 21 + }, + "Name": "4", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultNamed.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultNamed.baseline index 7b7a77a6bd..e0f785a2d3 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultNamed.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassDefaultNamed.baseline @@ -25,3 +25,70 @@ // | No quickinfo at /*5*/. // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 0, + "LSPosition": { + "line": 0, + "character": 0 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 7, + "LSPosition": { + "line": 0, + "character": 7 + }, + "Name": "2", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 15, + "LSPosition": { + "line": 0, + "character": 15 + }, + "Name": "3", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 21, + "LSPosition": { + "line": 0, + "character": 21 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass C\n```\n" + } + } + }, + { + "marker": { + "Position": 23, + "LSPosition": { + "line": 0, + "character": 23 + }, + "Name": "5", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassIncomplete.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassIncomplete.baseline index e1dbedb3a6..0a0dd4977f 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassIncomplete.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassIncomplete.baseline @@ -10,3 +10,29 @@ // | No quickinfo at /*2*/. // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 0, + "LSPosition": { + "line": 0, + "character": 0 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 6, + "LSPosition": { + "line": 0, + "character": 6 + }, + "Name": "2", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassMethod.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassMethod.baseline index 986e411dc8..191377cf69 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassMethod.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassMethod.baseline @@ -131,3 +131,277 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 21, + "LSPosition": { + "line": 1, + "character": 11 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.publicMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 52, + "LSPosition": { + "line": 2, + "character": 12 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.privateMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 86, + "LSPosition": { + "line": 3, + "character": 14 + }, + "Name": "21", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.protectedMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 119, + "LSPosition": { + "line": 4, + "character": 11 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.staticMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 157, + "LSPosition": { + "line": 5, + "character": 19 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.privateStaticMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 204, + "LSPosition": { + "line": 6, + "character": 21 + }, + "Name": "41", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.protectedStaticMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 260, + "LSPosition": { + "line": 8, + "character": 13 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.publicMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 289, + "LSPosition": { + "line": 9, + "character": 13 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.privateMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 319, + "LSPosition": { + "line": 10, + "character": 13 + }, + "Name": "61", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.protectedMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 348, + "LSPosition": { + "line": 11, + "character": 10 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.staticMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 374, + "LSPosition": { + "line": 12, + "character": 10 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.privateStaticMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 407, + "LSPosition": { + "line": 13, + "character": 10 + }, + "Name": "81", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.protectedStaticMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 465, + "LSPosition": { + "line": 17, + "character": 0 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\n```\n" + } + } + }, + { + "marker": { + "Position": 475, + "LSPosition": { + "line": 17, + "character": 10 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.publicMethod(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 491, + "LSPosition": { + "line": 18, + "character": 0 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + }, + { + "marker": { + "Position": 493, + "LSPosition": { + "line": 18, + "character": 2 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.staticMethod(): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassProperty.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassProperty.baseline index 5b94d551e9..613479fe3a 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassProperty.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsClassProperty.baseline @@ -131,3 +131,277 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 21, + "LSPosition": { + "line": 1, + "character": 11 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 57, + "LSPosition": { + "line": 2, + "character": 12 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.privateProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 96, + "LSPosition": { + "line": 3, + "character": 14 + }, + "Name": "21", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.protectedProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 134, + "LSPosition": { + "line": 4, + "character": 11 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.staticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 177, + "LSPosition": { + "line": 5, + "character": 19 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.privateStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 229, + "LSPosition": { + "line": 6, + "character": 21 + }, + "Name": "41", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.protectedStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 290, + "LSPosition": { + "line": 8, + "character": 13 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 319, + "LSPosition": { + "line": 9, + "character": 13 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.privateProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 349, + "LSPosition": { + "line": 10, + "character": 13 + }, + "Name": "61", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.protectedProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 378, + "LSPosition": { + "line": 11, + "character": 10 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.staticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 404, + "LSPosition": { + "line": 12, + "character": 10 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.privateStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 437, + "LSPosition": { + "line": 13, + "character": 10 + }, + "Name": "81", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.protectedStaticProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 495, + "LSPosition": { + "line": 17, + "character": 0 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\n```\n" + } + } + }, + { + "marker": { + "Position": 505, + "LSPosition": { + "line": 17, + "character": 10 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.publicProperty: string\n```\n" + } + } + }, + { + "marker": { + "Position": 521, + "LSPosition": { + "line": 18, + "character": 0 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + }, + { + "marker": { + "Position": 523, + "LSPosition": { + "line": 18, + "character": 2 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) c.staticProperty: string\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsConst.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsConst.baseline index 54adf77b7d..38d87f0c0c 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsConst.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsConst.baseline @@ -133,3 +133,277 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 6, + "LSPosition": { + "line": 0, + "character": 6 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst a: 10\n```\n" + } + } + }, + { + "marker": { + "Position": 41, + "LSPosition": { + "line": 2, + "character": 10 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst b: 10\n```\n" + } + } + }, + { + "marker": { + "Position": 45, + "LSPosition": { + "line": 2, + "character": 14 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst a: 10\n```\n" + } + } + }, + { + "marker": { + "Position": 75, + "LSPosition": { + "line": 4, + "character": 14 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst b1: 10\n```\n" + } + } + }, + { + "marker": { + "Position": 113, + "LSPosition": { + "line": 8, + "character": 10 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst c: 10\n```\n" + } + } + }, + { + "marker": { + "Position": 138, + "LSPosition": { + "line": 9, + "character": 17 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst d: 10\n```\n" + } + } + }, + { + "marker": { + "Position": 173, + "LSPosition": { + "line": 11, + "character": 14 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst e: 10\n```\n" + } + } + }, + { + "marker": { + "Position": 195, + "LSPosition": { + "line": 14, + "character": 6 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst f: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 229, + "LSPosition": { + "line": 15, + "character": 6 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst g: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 233, + "LSPosition": { + "line": 15, + "character": 10 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst f: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 236, + "LSPosition": { + "line": 16, + "character": 0 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst f: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 247, + "LSPosition": { + "line": 17, + "character": 6 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst h: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 312, + "LSPosition": { + "line": 18, + "character": 6 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst i: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 316, + "LSPosition": { + "line": 18, + "character": 10 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst h: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 319, + "LSPosition": { + "line": 19, + "character": 0 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst h: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 326, + "LSPosition": { + "line": 20, + "character": 0 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst h: { (a: string): number; (a: number): string; }\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum1.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum1.baseline index a6410c87fc..8b82e7771b 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum1.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum1.baseline @@ -228,3 +228,515 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 5, + "LSPosition": { + "line": 0, + "character": 5 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 13, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 21, + "LSPosition": { + "line": 2, + "character": 4 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 34, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e3 = 11\n```\n" + } + } + }, + { + "marker": { + "Position": 43, + "LSPosition": { + "line": 5, + "character": 4 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 54, + "LSPosition": { + "line": 5, + "character": 15 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 57, + "LSPosition": { + "line": 6, + "character": 0 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 69, + "LSPosition": { + "line": 6, + "character": 12 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 71, + "LSPosition": { + "line": 6, + "character": 14 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 75, + "LSPosition": { + "line": 7, + "character": 0 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 87, + "LSPosition": { + "line": 7, + "character": 12 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 89, + "LSPosition": { + "line": 7, + "character": 14 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 93, + "LSPosition": { + "line": 8, + "character": 0 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 105, + "LSPosition": { + "line": 8, + "character": 12 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 107, + "LSPosition": { + "line": 8, + "character": 14 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e3 = 11\n```\n" + } + } + }, + { + "marker": { + "Position": 122, + "LSPosition": { + "line": 9, + "character": 11 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 135, + "LSPosition": { + "line": 10, + "character": 4 + }, + "Name": "17", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 143, + "LSPosition": { + "line": 11, + "character": 4 + }, + "Name": "18", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 156, + "LSPosition": { + "line": 12, + "character": 4 + }, + "Name": "19", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e3 = 11\n```\n" + } + } + }, + { + "marker": { + "Position": 165, + "LSPosition": { + "line": 14, + "character": 4 + }, + "Name": "20", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 177, + "LSPosition": { + "line": 14, + "character": 16 + }, + "Name": "21", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 185, + "LSPosition": { + "line": 15, + "character": 0 + }, + "Name": "22", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 198, + "LSPosition": { + "line": 15, + "character": 13 + }, + "Name": "23", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 205, + "LSPosition": { + "line": 15, + "character": 20 + }, + "Name": "24", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 209, + "LSPosition": { + "line": 16, + "character": 0 + }, + "Name": "25", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 222, + "LSPosition": { + "line": 16, + "character": 13 + }, + "Name": "26", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 229, + "LSPosition": { + "line": 16, + "character": 20 + }, + "Name": "27", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 233, + "LSPosition": { + "line": 17, + "character": 0 + }, + "Name": "28", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 246, + "LSPosition": { + "line": 17, + "character": 13 + }, + "Name": "29", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 253, + "LSPosition": { + "line": 17, + "character": 20 + }, + "Name": "30", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e3 = 11\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum2.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum2.baseline index bd8cf3c6a7..414d523a2d 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum2.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum2.baseline @@ -228,3 +228,515 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 5, + "LSPosition": { + "line": 0, + "character": 5 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 13, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 23, + "LSPosition": { + "line": 2, + "character": 4 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 38, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e3 = 11\n```\n" + } + } + }, + { + "marker": { + "Position": 49, + "LSPosition": { + "line": 5, + "character": 4 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 60, + "LSPosition": { + "line": 5, + "character": 15 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 63, + "LSPosition": { + "line": 6, + "character": 0 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 75, + "LSPosition": { + "line": 6, + "character": 12 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 77, + "LSPosition": { + "line": 6, + "character": 14 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 81, + "LSPosition": { + "line": 7, + "character": 0 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 93, + "LSPosition": { + "line": 7, + "character": 12 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 95, + "LSPosition": { + "line": 7, + "character": 14 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 99, + "LSPosition": { + "line": 8, + "character": 0 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 111, + "LSPosition": { + "line": 8, + "character": 12 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 113, + "LSPosition": { + "line": 8, + "character": 14 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e3 = 11\n```\n" + } + } + }, + { + "marker": { + "Position": 128, + "LSPosition": { + "line": 9, + "character": 11 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 141, + "LSPosition": { + "line": 10, + "character": 4 + }, + "Name": "17", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 151, + "LSPosition": { + "line": 11, + "character": 4 + }, + "Name": "18", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 166, + "LSPosition": { + "line": 12, + "character": 4 + }, + "Name": "19", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e3 = 11\n```\n" + } + } + }, + { + "marker": { + "Position": 177, + "LSPosition": { + "line": 14, + "character": 4 + }, + "Name": "20", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 189, + "LSPosition": { + "line": 14, + "character": 16 + }, + "Name": "21", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 197, + "LSPosition": { + "line": 15, + "character": 0 + }, + "Name": "22", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 210, + "LSPosition": { + "line": 15, + "character": 13 + }, + "Name": "23", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 217, + "LSPosition": { + "line": 15, + "character": 20 + }, + "Name": "24", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 221, + "LSPosition": { + "line": 16, + "character": 0 + }, + "Name": "25", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 234, + "LSPosition": { + "line": 16, + "character": 13 + }, + "Name": "26", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 241, + "LSPosition": { + "line": 16, + "character": 20 + }, + "Name": "27", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 245, + "LSPosition": { + "line": 17, + "character": 0 + }, + "Name": "28", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 258, + "LSPosition": { + "line": 17, + "character": 13 + }, + "Name": "29", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 265, + "LSPosition": { + "line": 17, + "character": 20 + }, + "Name": "30", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e3 = 11\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum3.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum3.baseline index 3e443748f8..a05746c2c5 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum3.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum3.baseline @@ -228,3 +228,515 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 5, + "LSPosition": { + "line": 0, + "character": 5 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 13, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 23, + "LSPosition": { + "line": 2, + "character": 4 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 38, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e3 = 11\n```\n" + } + } + }, + { + "marker": { + "Position": 49, + "LSPosition": { + "line": 5, + "character": 4 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 60, + "LSPosition": { + "line": 5, + "character": 15 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 63, + "LSPosition": { + "line": 6, + "character": 0 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 75, + "LSPosition": { + "line": 6, + "character": 12 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 77, + "LSPosition": { + "line": 6, + "character": 14 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 84, + "LSPosition": { + "line": 7, + "character": 0 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 96, + "LSPosition": { + "line": 7, + "character": 12 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 98, + "LSPosition": { + "line": 7, + "character": 14 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 105, + "LSPosition": { + "line": 8, + "character": 0 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance: E\n```\n" + } + } + }, + { + "marker": { + "Position": 117, + "LSPosition": { + "line": 8, + "character": 12 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum E\n```\n" + } + } + }, + { + "marker": { + "Position": 119, + "LSPosition": { + "line": 8, + "character": 14 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) E.e3 = 11\n```\n" + } + } + }, + { + "marker": { + "Position": 137, + "LSPosition": { + "line": 9, + "character": 11 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 150, + "LSPosition": { + "line": 10, + "character": 4 + }, + "Name": "17", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 160, + "LSPosition": { + "line": 11, + "character": 4 + }, + "Name": "18", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 175, + "LSPosition": { + "line": 12, + "character": 4 + }, + "Name": "19", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e3 = 11\n```\n" + } + } + }, + { + "marker": { + "Position": 186, + "LSPosition": { + "line": 14, + "character": 4 + }, + "Name": "20", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 198, + "LSPosition": { + "line": 14, + "character": 16 + }, + "Name": "21", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 206, + "LSPosition": { + "line": 15, + "character": 0 + }, + "Name": "22", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 219, + "LSPosition": { + "line": 15, + "character": 13 + }, + "Name": "23", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 226, + "LSPosition": { + "line": 15, + "character": 20 + }, + "Name": "24", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e1 = 0\n```\n" + } + } + }, + { + "marker": { + "Position": 233, + "LSPosition": { + "line": 16, + "character": 0 + }, + "Name": "25", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 246, + "LSPosition": { + "line": 16, + "character": 13 + }, + "Name": "26", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 253, + "LSPosition": { + "line": 16, + "character": 20 + }, + "Name": "27", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e2 = 10\n```\n" + } + } + }, + { + "marker": { + "Position": 260, + "LSPosition": { + "line": 17, + "character": 0 + }, + "Name": "28", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar eInstance1: constE\n```\n" + } + } + }, + { + "marker": { + "Position": 273, + "LSPosition": { + "line": 17, + "character": 13 + }, + "Name": "29", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nenum constE\n```\n" + } + } + }, + { + "marker": { + "Position": 280, + "LSPosition": { + "line": 17, + "character": 20 + }, + "Name": "30", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) constE.e3 = 11\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum4.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum4.baseline index 6feb058187..55a9f05255 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum4.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsEnum4.baseline @@ -20,3 +20,39 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 51, + "LSPosition": { + "line": 4, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) typeof Foo[\"\\t\"] = 9\n```\n" + } + } + }, + { + "marker": { + "Position": 61, + "LSPosition": { + "line": 5, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(enum member) typeof Foo[\"\"] = 127\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModuleAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModuleAlias.baseline index 3ff21ba582..33bc8cf74a 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModuleAlias.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModuleAlias.baseline @@ -28,3 +28,77 @@ // | ---------------------------------------------------------------------- // | No quickinfo at /*4*/. // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 7, + "LSPosition": { + "line": 0, + "character": 7 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 20, + "LSPosition": { + "line": 0, + "character": 20 + }, + "Name": "mod1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 77, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 102, + "LSPosition": { + "line": 2, + "character": 14 + }, + "Name": "3", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 115, + "LSPosition": { + "line": 2, + "character": 27 + }, + "Name": "mod2", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 172, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModules.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModules.baseline index f4e8abfc79..ba1a1eac0f 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModules.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsExternalModules.baseline @@ -128,3 +128,289 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 17, + "LSPosition": { + "line": 0, + "character": 17 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m\n```\n" + } + } + }, + { + "marker": { + "Position": 29, + "LSPosition": { + "line": 1, + "character": 8 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar namespaceElemWithoutExport: number\n```\n" + } + } + }, + { + "marker": { + "Position": 77, + "LSPosition": { + "line": 2, + "character": 15 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar namespaceElemWithExport: number\n```\n" + } + } + }, + { + "marker": { + "Position": 120, + "LSPosition": { + "line": 4, + "character": 11 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar a: typeof m\n```\n" + } + } + }, + { + "marker": { + "Position": 124, + "LSPosition": { + "line": 4, + "character": 15 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m\n```\n" + } + } + }, + { + "marker": { + "Position": 138, + "LSPosition": { + "line": 5, + "character": 11 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar b: typeof m\n```\n" + } + } + }, + { + "marker": { + "Position": 148, + "LSPosition": { + "line": 5, + "character": 21 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m\n```\n" + } + } + }, + { + "marker": { + "Position": 168, + "LSPosition": { + "line": 6, + "character": 17 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m1\n```\n" + } + } + }, + { + "marker": { + "Position": 171, + "LSPosition": { + "line": 6, + "character": 20 + }, + "Name": "9", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 184, + "LSPosition": { + "line": 7, + "character": 8 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar namespaceElemWithoutExport: number\n```\n" + } + } + }, + { + "marker": { + "Position": 232, + "LSPosition": { + "line": 8, + "character": 15 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar namespaceElemWithExport: number\n```\n" + } + } + }, + { + "marker": { + "Position": 275, + "LSPosition": { + "line": 10, + "character": 11 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar x: typeof m1.m2\n```\n" + } + } + }, + { + "marker": { + "Position": 279, + "LSPosition": { + "line": 10, + "character": 15 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m1\n```\n" + } + } + }, + { + "marker": { + "Position": 282, + "LSPosition": { + "line": 10, + "character": 18 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m1.m2\n```\n" + } + } + }, + { + "marker": { + "Position": 297, + "LSPosition": { + "line": 11, + "character": 11 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar y: typeof m1.m2\n```\n" + } + } + }, + { + "marker": { + "Position": 307, + "LSPosition": { + "line": 11, + "character": 21 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m1\n```\n" + } + } + }, + { + "marker": { + "Position": 310, + "LSPosition": { + "line": 11, + "character": 24 + }, + "Name": "17", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m1.m2\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunction.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunction.baseline index ce5f43b046..eb1c7d842c 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunction.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunction.baseline @@ -128,3 +128,243 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 9, + "LSPosition": { + "line": 0, + "character": 9 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(param: string, optionalParam?: string, paramWithInitializer?: string, ...restParam: string[]): void\n```\n" + } + } + }, + { + "marker": { + "Position": 121, + "LSPosition": { + "line": 2, + "character": 9 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowithoverload(a: string): string\nfunction foowithoverload(a: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 166, + "LSPosition": { + "line": 3, + "character": 9 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowithoverload(a: string): string\nfunction foowithoverload(a: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 211, + "LSPosition": { + "line": 4, + "character": 9 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowithoverload(a: string): string\nfunction foowithoverload(a: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 267, + "LSPosition": { + "line": 7, + "character": 9 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: string): string\nfunction foowith3overload(a: number): number\nfunction foowith3overload(a: boolean): boolean\n```\n" + } + } + }, + { + "marker": { + "Position": 313, + "LSPosition": { + "line": 8, + "character": 9 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: string): string\nfunction foowith3overload(a: number): number\nfunction foowith3overload(a: boolean): boolean\n```\n" + } + } + }, + { + "marker": { + "Position": 359, + "LSPosition": { + "line": 9, + "character": 9 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: string): string\nfunction foowith3overload(a: number): number\nfunction foowith3overload(a: boolean): boolean\n```\n" + } + } + }, + { + "marker": { + "Position": 407, + "LSPosition": { + "line": 10, + "character": 9 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: string): string\nfunction foowith3overload(a: number): number\nfunction foowith3overload(a: boolean): boolean\n```\n" + } + } + }, + { + "marker": { + "Position": 455, + "LSPosition": { + "line": 13, + "character": 0 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(param: string, optionalParam?: string, paramWithInitializer?: string, ...restParam: string[]): void\n```\n" + } + } + }, + { + "marker": { + "Position": 469, + "LSPosition": { + "line": 14, + "character": 0 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowithoverload(a: string): string\n```\n" + } + } + }, + { + "marker": { + "Position": 495, + "LSPosition": { + "line": 15, + "character": 0 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowithoverload(a: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 516, + "LSPosition": { + "line": 16, + "character": 0 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: string): string\n```\n" + } + } + }, + { + "marker": { + "Position": 543, + "LSPosition": { + "line": 17, + "character": 0 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 565, + "LSPosition": { + "line": 18, + "character": 0 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: boolean): boolean\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionExpression.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionExpression.baseline index 1d902f1e26..84be21a57f 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionExpression.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionExpression.baseline @@ -50,3 +50,107 @@ // | // | ---------------------------------------------------------------------- // })(); +[ + { + "marker": { + "Position": 4, + "LSPosition": { + "line": 0, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar x: () =\u003e void\n```\n" + } + } + }, + { + "marker": { + "Position": 17, + "LSPosition": { + "line": 0, + "character": 17 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 29, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 43, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar y: () =\u003e void\n```\n" + } + } + }, + { + "marker": { + "Position": 74, + "LSPosition": { + "line": 5, + "character": 10 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo1(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 87, + "LSPosition": { + "line": 6, + "character": 4 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo1(): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionIncomplete.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionIncomplete.baseline index 569f8a736a..72ac003dce 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionIncomplete.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsFunctionIncomplete.baseline @@ -20,3 +20,53 @@ // | No quickinfo at /*4*/. // | ---------------------------------------------------------------------- // }\ +[ + { + "marker": { + "Position": 0, + "LSPosition": { + "line": 0, + "character": 0 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 9, + "LSPosition": { + "line": 0, + "character": 9 + }, + "Name": "2", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 30, + "LSPosition": { + "line": 2, + "character": 0 + }, + "Name": "3", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 39, + "LSPosition": { + "line": 2, + "character": 9 + }, + "Name": "4", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterface.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterface.baseline index 4872e066af..d22828efa0 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterface.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterface.baseline @@ -24,3 +24,56 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 10, + "LSPosition": { + "line": 0, + "character": 10 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ninterface i\n```\n" + } + } + }, + { + "marker": { + "Position": 20, + "LSPosition": { + "line": 2, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iInstance: i\n```\n" + } + } + }, + { + "marker": { + "Position": 31, + "LSPosition": { + "line": 2, + "character": 15 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ninterface i\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterfaceMembers.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterfaceMembers.baseline index 890b4f4abd..aee132b83d 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterfaceMembers.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInterfaceMembers.baseline @@ -73,3 +73,158 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 18, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) I.property: string\n```\n" + } + } + }, + { + "marker": { + "Position": 40, + "LSPosition": { + "line": 2, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) I.method(): string\n```\n" + } + } + }, + { + "marker": { + "Position": 109, + "LSPosition": { + "line": 7, + "character": 0 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iInstance: I\n```\n" + } + } + }, + { + "marker": { + "Position": 119, + "LSPosition": { + "line": 7, + "character": 10 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) I.property: string\n```\n" + } + } + }, + { + "marker": { + "Position": 130, + "LSPosition": { + "line": 7, + "character": 21 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iInstance: I\n```\n" + } + } + }, + { + "marker": { + "Position": 140, + "LSPosition": { + "line": 7, + "character": 31 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) I.method(): string\n```\n" + } + } + }, + { + "marker": { + "Position": 150, + "LSPosition": { + "line": 8, + "character": 0 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iInstance: I\n```\n" + } + } + }, + { + "marker": { + "Position": 167, + "LSPosition": { + "line": 9, + "character": 4 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar anotherInstance: I\n```\n" + } + } + }, + { + "marker": { + "Position": 189, + "LSPosition": { + "line": 9, + "character": 26 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iInstance: I\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInternalModuleAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInternalModuleAlias.baseline index c4150af0d6..9ed4522bd3 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInternalModuleAlias.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsInternalModuleAlias.baseline @@ -70,3 +70,141 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 66, + "LSPosition": { + "line": 5, + "character": 11 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(alias) namespace m\n```\n" + } + } + }, + { + "marker": { + "Position": 82, + "LSPosition": { + "line": 6, + "character": 8 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(alias) namespace m\n```\n" + } + } + }, + { + "marker": { + "Position": 104, + "LSPosition": { + "line": 7, + "character": 11 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(alias) namespace m.m1\n```\n" + } + } + }, + { + "marker": { + "Position": 123, + "LSPosition": { + "line": 8, + "character": 8 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(alias) namespace m.m1\n```\n" + } + } + }, + { + "marker": { + "Position": 149, + "LSPosition": { + "line": 9, + "character": 18 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(alias) namespace m\n```\n" + } + } + }, + { + "marker": { + "Position": 165, + "LSPosition": { + "line": 10, + "character": 8 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(alias) namespace m\n```\n" + } + } + }, + { + "marker": { + "Position": 194, + "LSPosition": { + "line": 11, + "character": 18 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(alias) namespace m.m1\n```\n" + } + } + }, + { + "marker": { + "Position": 213, + "LSPosition": { + "line": 12, + "character": 8 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(alias) namespace m.m1\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLet.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLet.baseline index bad0ba56e1..cbf6a0acb1 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLet.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLet.baseline @@ -133,3 +133,277 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 4, + "LSPosition": { + "line": 0, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet a: number\n```\n" + } + } + }, + { + "marker": { + "Position": 37, + "LSPosition": { + "line": 2, + "character": 8 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet b: number\n```\n" + } + } + }, + { + "marker": { + "Position": 41, + "LSPosition": { + "line": 2, + "character": 12 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet a: number\n```\n" + } + } + }, + { + "marker": { + "Position": 69, + "LSPosition": { + "line": 4, + "character": 12 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet b1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 105, + "LSPosition": { + "line": 8, + "character": 8 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet c: number\n```\n" + } + } + }, + { + "marker": { + "Position": 128, + "LSPosition": { + "line": 9, + "character": 15 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet d: number\n```\n" + } + } + }, + { + "marker": { + "Position": 161, + "LSPosition": { + "line": 11, + "character": 12 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet e: number\n```\n" + } + } + }, + { + "marker": { + "Position": 181, + "LSPosition": { + "line": 14, + "character": 4 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet f: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 202, + "LSPosition": { + "line": 15, + "character": 4 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet g: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 206, + "LSPosition": { + "line": 15, + "character": 8 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet f: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 209, + "LSPosition": { + "line": 16, + "character": 0 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet f: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 218, + "LSPosition": { + "line": 17, + "character": 4 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet h: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 272, + "LSPosition": { + "line": 18, + "character": 4 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet i: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 276, + "LSPosition": { + "line": 18, + "character": 8 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet h: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 279, + "LSPosition": { + "line": 19, + "character": 0 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet h: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 286, + "LSPosition": { + "line": 20, + "character": 0 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet h: { (a: string): number; (a: number): string; }\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLiteralLikeNames01.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLiteralLikeNames01.baseline index b7be0c6122..cc39b544ea 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLiteralLikeNames01.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLiteralLikeNames01.baseline @@ -83,3 +83,175 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 21, + "LSPosition": { + "line": 1, + "character": 11 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C[1](): void\n```\n" + } + } + }, + { + "marker": { + "Position": 41, + "LSPosition": { + "line": 2, + "character": 12 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C.Infinity(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 70, + "LSPosition": { + "line": 3, + "character": 14 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C.NaN(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 91, + "LSPosition": { + "line": 4, + "character": 11 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C[\"stringLiteralName\"](): void\n```\n" + } + } + }, + { + "marker": { + "Position": 145, + "LSPosition": { + "line": 6, + "character": 13 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C[1](): void\n```\n" + } + } + }, + { + "marker": { + "Position": 164, + "LSPosition": { + "line": 7, + "character": 13 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C[1](): void\n```\n" + } + } + }, + { + "marker": { + "Position": 185, + "LSPosition": { + "line": 8, + "character": 13 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C.Infinity(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 210, + "LSPosition": { + "line": 9, + "character": 13 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C.Infinity(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 238, + "LSPosition": { + "line": 10, + "character": 13 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C.NaN(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 255, + "LSPosition": { + "line": 11, + "character": 10 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C[\"stringLiteralName\"](): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLocalFunction.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLocalFunction.baseline index 4c6143c705..1523f3ecf4 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLocalFunction.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsLocalFunction.baseline @@ -145,3 +145,277 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 9, + "LSPosition": { + "line": 0, + "character": 9 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction outerFoo(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 35, + "LSPosition": { + "line": 1, + "character": 13 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(param: string, optionalParam?: string, paramWithInitializer?: string, ...restParam: string[]): void\n```\n" + } + } + }, + { + "marker": { + "Position": 155, + "LSPosition": { + "line": 3, + "character": 13 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowithoverload(a: string): string\nfunction foowithoverload(a: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 204, + "LSPosition": { + "line": 4, + "character": 13 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowithoverload(a: string): string\nfunction foowithoverload(a: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 253, + "LSPosition": { + "line": 5, + "character": 13 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowithoverload(a: string): string\nfunction foowithoverload(a: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 321, + "LSPosition": { + "line": 8, + "character": 13 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: string): string\nfunction foowith3overload(a: number): number\nfunction foowith3overload(a: boolean): boolean\n```\n" + } + } + }, + { + "marker": { + "Position": 371, + "LSPosition": { + "line": 9, + "character": 13 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: string): string\nfunction foowith3overload(a: number): number\nfunction foowith3overload(a: boolean): boolean\n```\n" + } + } + }, + { + "marker": { + "Position": 421, + "LSPosition": { + "line": 10, + "character": 13 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: string): string\nfunction foowith3overload(a: number): number\nfunction foowith3overload(a: boolean): boolean\n```\n" + } + } + }, + { + "marker": { + "Position": 473, + "LSPosition": { + "line": 11, + "character": 13 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: string): string\nfunction foowith3overload(a: number): number\nfunction foowith3overload(a: boolean): boolean\n```\n" + } + } + }, + { + "marker": { + "Position": 533, + "LSPosition": { + "line": 14, + "character": 4 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(param: string, optionalParam?: string, paramWithInitializer?: string, ...restParam: string[]): void\n```\n" + } + } + }, + { + "marker": { + "Position": 551, + "LSPosition": { + "line": 15, + "character": 4 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowithoverload(a: string): string\n```\n" + } + } + }, + { + "marker": { + "Position": 581, + "LSPosition": { + "line": 16, + "character": 4 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowithoverload(a: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 606, + "LSPosition": { + "line": 17, + "character": 4 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: string): string\n```\n" + } + } + }, + { + "marker": { + "Position": 637, + "LSPosition": { + "line": 18, + "character": 4 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: number): number\n```\n" + } + } + }, + { + "marker": { + "Position": 663, + "LSPosition": { + "line": 19, + "character": 4 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foowith3overload(a: boolean): boolean\n```\n" + } + } + }, + { + "marker": { + "Position": 689, + "LSPosition": { + "line": 21, + "character": 0 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction outerFoo(): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsModules.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsModules.baseline index 3858c8f6b4..9a89c7a56b 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsModules.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsModules.baseline @@ -128,3 +128,289 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 10, + "LSPosition": { + "line": 0, + "character": 10 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m\n```\n" + } + } + }, + { + "marker": { + "Position": 22, + "LSPosition": { + "line": 1, + "character": 8 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar namespaceElemWithoutExport: number\n```\n" + } + } + }, + { + "marker": { + "Position": 70, + "LSPosition": { + "line": 2, + "character": 15 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar namespaceElemWithExport: number\n```\n" + } + } + }, + { + "marker": { + "Position": 106, + "LSPosition": { + "line": 4, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar a: typeof m\n```\n" + } + } + }, + { + "marker": { + "Position": 110, + "LSPosition": { + "line": 4, + "character": 8 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m\n```\n" + } + } + }, + { + "marker": { + "Position": 117, + "LSPosition": { + "line": 5, + "character": 4 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar b: typeof m\n```\n" + } + } + }, + { + "marker": { + "Position": 127, + "LSPosition": { + "line": 5, + "character": 14 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m\n```\n" + } + } + }, + { + "marker": { + "Position": 140, + "LSPosition": { + "line": 6, + "character": 10 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m1\n```\n" + } + } + }, + { + "marker": { + "Position": 143, + "LSPosition": { + "line": 6, + "character": 13 + }, + "Name": "9", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 156, + "LSPosition": { + "line": 7, + "character": 8 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar namespaceElemWithoutExport: number\n```\n" + } + } + }, + { + "marker": { + "Position": 204, + "LSPosition": { + "line": 8, + "character": 15 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar namespaceElemWithExport: number\n```\n" + } + } + }, + { + "marker": { + "Position": 240, + "LSPosition": { + "line": 10, + "character": 4 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar x: typeof m1.m2\n```\n" + } + } + }, + { + "marker": { + "Position": 244, + "LSPosition": { + "line": 10, + "character": 8 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m1\n```\n" + } + } + }, + { + "marker": { + "Position": 247, + "LSPosition": { + "line": 10, + "character": 11 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m1.m2\n```\n" + } + } + }, + { + "marker": { + "Position": 255, + "LSPosition": { + "line": 11, + "character": 4 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar y: typeof m1.m2\n```\n" + } + } + }, + { + "marker": { + "Position": 265, + "LSPosition": { + "line": 11, + "character": 14 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m1\n```\n" + } + } + }, + { + "marker": { + "Position": 268, + "LSPosition": { + "line": 11, + "character": 17 + }, + "Name": "17", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nnamespace m1.m2\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsParameters.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsParameters.baseline index 695fdc649e..467cc20d76 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsParameters.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsParameters.baseline @@ -72,3 +72,158 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 33, + "LSPosition": { + "line": 1, + "character": 9 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(param: string, optionalParam?: string, paramWithInitializer?: string, ...restParam: string[]): void\n```\n\n\n*@return* — *crunch* " + } + } + }, + { + "marker": { + "Position": 37, + "LSPosition": { + "line": 1, + "character": 13 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) param: string\n```\n" + } + } + }, + { + "marker": { + "Position": 52, + "LSPosition": { + "line": 1, + "character": 28 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) optionalParam: string\n```\n" + } + } + }, + { + "marker": { + "Position": 76, + "LSPosition": { + "line": 1, + "character": 52 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) paramWithInitializer: string\n```\n" + } + } + }, + { + "marker": { + "Position": 111, + "LSPosition": { + "line": 1, + "character": 87 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) restParam: string[]\n```\n" + } + } + }, + { + "marker": { + "Position": 138, + "LSPosition": { + "line": 2, + "character": 4 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) param: string\n```\n" + } + } + }, + { + "marker": { + "Position": 159, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) optionalParam: string\n```\n" + } + } + }, + { + "marker": { + "Position": 188, + "LSPosition": { + "line": 4, + "character": 4 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) paramWithInitializer: string\n```\n" + } + } + }, + { + "marker": { + "Position": 224, + "LSPosition": { + "line": 5, + "character": 4 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) restParam: string[]\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeAlias.baseline index b11c6414d5..4f0f731804 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeAlias.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeAlias.baseline @@ -46,3 +46,107 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 6, + "LSPosition": { + "line": 0, + "character": 6 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + }, + { + "marker": { + "Position": 17, + "LSPosition": { + "line": 2, + "character": 5 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype t1 = c\n```\n" + } + } + }, + { + "marker": { + "Position": 22, + "LSPosition": { + "line": 2, + "character": 10 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + }, + { + "marker": { + "Position": 29, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\n```\n" + } + } + }, + { + "marker": { + "Position": 40, + "LSPosition": { + "line": 3, + "character": 15 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype t1 = c\n```\n" + } + } + }, + { + "marker": { + "Position": 49, + "LSPosition": { + "line": 3, + "character": 24 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInClass.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInClass.baseline index d1c1884398..ca685ed5fd 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInClass.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInClass.baseline @@ -307,3 +307,702 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 6, + "LSPosition": { + "line": 0, + "character": 6 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 8, + "LSPosition": { + "line": 0, + "character": 8 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T\n```\n" + } + } + }, + { + "marker": { + "Position": 17, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor c\u003cT\u003e(a: T): c\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 29, + "LSPosition": { + "line": 1, + "character": 16 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: T\n```\n" + } + } + }, + { + "marker": { + "Position": 32, + "LSPosition": { + "line": 1, + "character": 19 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T\n```\n" + } + } + }, + { + "marker": { + "Position": 47, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.method\u003cU\u003e(a: U, b: T): U\n```\n" + } + } + }, + { + "marker": { + "Position": 54, + "LSPosition": { + "line": 3, + "character": 11 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 57, + "LSPosition": { + "line": 3, + "character": 14 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 60, + "LSPosition": { + "line": 3, + "character": 17 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 63, + "LSPosition": { + "line": 3, + "character": 20 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: T\n```\n" + } + } + }, + { + "marker": { + "Position": 66, + "LSPosition": { + "line": 3, + "character": 23 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T\n```\n" + } + } + }, + { + "marker": { + "Position": 86, + "LSPosition": { + "line": 4, + "character": 15 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 101, + "LSPosition": { + "line": 7, + "character": 4 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 117, + "LSPosition": { + "line": 7, + "character": 20 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor c\u003cstring\u003e(a: string): c\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 133, + "LSPosition": { + "line": 8, + "character": 4 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cVal: typeof c\n```\n" + } + } + }, + { + "marker": { + "Position": 140, + "LSPosition": { + "line": 8, + "character": 11 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 143, + "LSPosition": { + "line": 9, + "character": 0 + }, + "Name": "17", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 153, + "LSPosition": { + "line": 9, + "character": 10 + }, + "Name": "18", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c.method\u003c\"hello\"\u003e(a: \"hello\", b: string): \"hello\"\n```\n" + } + } + }, + { + "marker": { + "Position": 185, + "LSPosition": { + "line": 10, + "character": 6 + }, + "Name": "19", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c2\u003cT extends c\u003cstring\u003e\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 188, + "LSPosition": { + "line": 10, + "character": 9 + }, + "Name": "20", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T extends c\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 198, + "LSPosition": { + "line": 10, + "character": 19 + }, + "Name": "21", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 215, + "LSPosition": { + "line": 11, + "character": 4 + }, + "Name": "22", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor c2\u003cT extends c\u003cstring\u003e\u003e(a: T): c2\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 227, + "LSPosition": { + "line": 11, + "character": 16 + }, + "Name": "23", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: T\n```\n" + } + } + }, + { + "marker": { + "Position": 230, + "LSPosition": { + "line": 11, + "character": 19 + }, + "Name": "24", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T extends c\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 245, + "LSPosition": { + "line": 13, + "character": 4 + }, + "Name": "25", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c2.method\u003cU extends c\u003cstring\u003e\u003e(a: U, b: T): U\n```\n" + } + } + }, + { + "marker": { + "Position": 252, + "LSPosition": { + "line": 13, + "character": 11 + }, + "Name": "26", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends c\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 262, + "LSPosition": { + "line": 13, + "character": 21 + }, + "Name": "27", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 273, + "LSPosition": { + "line": 13, + "character": 32 + }, + "Name": "28", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 276, + "LSPosition": { + "line": 13, + "character": 35 + }, + "Name": "29", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends c\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 279, + "LSPosition": { + "line": 13, + "character": 38 + }, + "Name": "30", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: T\n```\n" + } + } + }, + { + "marker": { + "Position": 282, + "LSPosition": { + "line": 13, + "character": 41 + }, + "Name": "31", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T extends c\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 302, + "LSPosition": { + "line": 14, + "character": 15 + }, + "Name": "32", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 317, + "LSPosition": { + "line": 17, + "character": 4 + }, + "Name": "33", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance1: c2\u003cc\u003cstring\u003e\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 334, + "LSPosition": { + "line": 17, + "character": 21 + }, + "Name": "34", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor c2\u003cc\u003cstring\u003e\u003e(a: c\u003cstring\u003e): c2\u003cc\u003cstring\u003e\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 337, + "LSPosition": { + "line": 17, + "character": 24 + }, + "Name": "35", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 353, + "LSPosition": { + "line": 18, + "character": 4 + }, + "Name": "36", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cVal2: typeof c2\n```\n" + } + } + }, + { + "marker": { + "Position": 361, + "LSPosition": { + "line": 18, + "character": 12 + }, + "Name": "37", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass c2\u003cT extends c\u003cstring\u003e\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 365, + "LSPosition": { + "line": 19, + "character": 0 + }, + "Name": "38", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance1: c2\u003cc\u003cstring\u003e\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 376, + "LSPosition": { + "line": 19, + "character": 11 + }, + "Name": "39", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) c2.method\u003cc\u003cstring\u003e\u003e(a: c\u003cstring\u003e, b: c\u003cstring\u003e): c\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 383, + "LSPosition": { + "line": 19, + "character": 18 + }, + "Name": "40", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 394, + "LSPosition": { + "line": 19, + "character": 29 + }, + "Name": "41", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar cInstance: c\u003cstring\u003e\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunction.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunction.baseline index 2347735616..fb7c6471b1 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunction.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunction.baseline @@ -92,3 +92,209 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 9, + "LSPosition": { + "line": 0, + "character": 9 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo\u003cU\u003e(a: U): U\n```\n" + } + } + }, + { + "marker": { + "Position": 13, + "LSPosition": { + "line": 0, + "character": 13 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 16, + "LSPosition": { + "line": 0, + "character": 16 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 19, + "LSPosition": { + "line": 0, + "character": 19 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 35, + "LSPosition": { + "line": 1, + "character": 11 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 40, + "LSPosition": { + "line": 3, + "character": 0 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo\u003c\"Hello\"\u003e(a: \"Hello\"): \"Hello\"\n```\n" + } + } + }, + { + "marker": { + "Position": 63, + "LSPosition": { + "line": 4, + "character": 9 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo2\u003cU extends string\u003e(a: U): U\n```\n" + } + } + }, + { + "marker": { + "Position": 68, + "LSPosition": { + "line": 4, + "character": 14 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends string\n```\n" + } + } + }, + { + "marker": { + "Position": 86, + "LSPosition": { + "line": 4, + "character": 32 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 89, + "LSPosition": { + "line": 4, + "character": 35 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends string\n```\n" + } + } + }, + { + "marker": { + "Position": 105, + "LSPosition": { + "line": 5, + "character": 11 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 110, + "LSPosition": { + "line": 7, + "character": 0 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo2\u003c\"hello\"\u003e(a: \"hello\"): \"hello\"\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.baseline index 8cc4870b01..ae0e02d768 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.baseline @@ -23,3 +23,56 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 30, + "LSPosition": { + "line": 0, + "character": 30 + }, + "Name": "0", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) A\n```\n" + } + } + }, + { + "marker": { + "Position": 59, + "LSPosition": { + "line": 0, + "character": 59 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) A\n```\n" + } + } + }, + { + "marker": { + "Position": 139, + "LSPosition": { + "line": 1, + "character": 74 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) A\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInInterface.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInInterface.baseline index 6955aadf53..ca99684cb1 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInInterface.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInInterface.baseline @@ -473,3 +473,1110 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 10, + "LSPosition": { + "line": 0, + "character": 10 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ninterface I\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 12, + "LSPosition": { + "line": 0, + "character": 12 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T\n```\n" + } + } + }, + { + "marker": { + "Position": 26, + "LSPosition": { + "line": 1, + "character": 9 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 29, + "LSPosition": { + "line": 1, + "character": 12 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 32, + "LSPosition": { + "line": 1, + "character": 15 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 35, + "LSPosition": { + "line": 1, + "character": 18 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: T\n```\n" + } + } + }, + { + "marker": { + "Position": 38, + "LSPosition": { + "line": 1, + "character": 21 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T\n```\n" + } + } + }, + { + "marker": { + "Position": 42, + "LSPosition": { + "line": 1, + "character": 25 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 50, + "LSPosition": { + "line": 2, + "character": 5 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 53, + "LSPosition": { + "line": 2, + "character": 8 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 56, + "LSPosition": { + "line": 2, + "character": 11 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 59, + "LSPosition": { + "line": 2, + "character": 14 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: T\n```\n" + } + } + }, + { + "marker": { + "Position": 62, + "LSPosition": { + "line": 2, + "character": 17 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T\n```\n" + } + } + }, + { + "marker": { + "Position": 66, + "LSPosition": { + "line": 2, + "character": 21 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 73, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) I.method\u003cU\u003e(a: U, b: T): U\n```\n" + } + } + }, + { + "marker": { + "Position": 80, + "LSPosition": { + "line": 3, + "character": 11 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 83, + "LSPosition": { + "line": 3, + "character": 14 + }, + "Name": "17", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 86, + "LSPosition": { + "line": 3, + "character": 17 + }, + "Name": "18", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 89, + "LSPosition": { + "line": 3, + "character": 20 + }, + "Name": "19", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: T\n```\n" + } + } + }, + { + "marker": { + "Position": 92, + "LSPosition": { + "line": 3, + "character": 23 + }, + "Name": "20", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T\n```\n" + } + } + }, + { + "marker": { + "Position": 96, + "LSPosition": { + "line": 3, + "character": 27 + }, + "Name": "21", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U\n```\n" + } + } + }, + { + "marker": { + "Position": 105, + "LSPosition": { + "line": 5, + "character": 4 + }, + "Name": "22", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal: I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 111, + "LSPosition": { + "line": 5, + "character": 10 + }, + "Name": "23", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ninterface I\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 126, + "LSPosition": { + "line": 6, + "character": 4 + }, + "Name": "24", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal: I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 150, + "LSPosition": { + "line": 7, + "character": 0 + }, + "Name": "25", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal: I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 174, + "LSPosition": { + "line": 8, + "character": 0 + }, + "Name": "26", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal: I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 179, + "LSPosition": { + "line": 8, + "character": 5 + }, + "Name": "27", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) I.method\u003c\"hello\"\u003e(a: \"hello\", b: string): \"hello\"\n```\n" + } + } + }, + { + "marker": { + "Position": 215, + "LSPosition": { + "line": 9, + "character": 10 + }, + "Name": "28", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ninterface I1\u003cT extends I\u003cstring\u003e\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 218, + "LSPosition": { + "line": 9, + "character": 13 + }, + "Name": "29", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 228, + "LSPosition": { + "line": 9, + "character": 23 + }, + "Name": "30", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ninterface I\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 250, + "LSPosition": { + "line": 10, + "character": 9 + }, + "Name": "31", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 260, + "LSPosition": { + "line": 10, + "character": 19 + }, + "Name": "32", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ninterface I\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 271, + "LSPosition": { + "line": 10, + "character": 30 + }, + "Name": "33", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 274, + "LSPosition": { + "line": 10, + "character": 33 + }, + "Name": "34", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 277, + "LSPosition": { + "line": 10, + "character": 36 + }, + "Name": "35", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: T\n```\n" + } + } + }, + { + "marker": { + "Position": 280, + "LSPosition": { + "line": 10, + "character": 39 + }, + "Name": "36", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 284, + "LSPosition": { + "line": 10, + "character": 43 + }, + "Name": "37", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 292, + "LSPosition": { + "line": 11, + "character": 5 + }, + "Name": "38", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 302, + "LSPosition": { + "line": 11, + "character": 15 + }, + "Name": "39", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ninterface I\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 313, + "LSPosition": { + "line": 11, + "character": 26 + }, + "Name": "40", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 316, + "LSPosition": { + "line": 11, + "character": 29 + }, + "Name": "41", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 319, + "LSPosition": { + "line": 11, + "character": 32 + }, + "Name": "42", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: T\n```\n" + } + } + }, + { + "marker": { + "Position": 322, + "LSPosition": { + "line": 11, + "character": 35 + }, + "Name": "43", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 326, + "LSPosition": { + "line": 11, + "character": 39 + }, + "Name": "44", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 333, + "LSPosition": { + "line": 12, + "character": 4 + }, + "Name": "45", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) I1.method\u003cU extends I\u003cstring\u003e\u003e(a: U, b: T): U\n```\n" + } + } + }, + { + "marker": { + "Position": 340, + "LSPosition": { + "line": 12, + "character": 11 + }, + "Name": "46", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 350, + "LSPosition": { + "line": 12, + "character": 21 + }, + "Name": "47", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ninterface I\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 361, + "LSPosition": { + "line": 12, + "character": 32 + }, + "Name": "48", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) a: U\n```\n" + } + } + }, + { + "marker": { + "Position": 364, + "LSPosition": { + "line": 12, + "character": 35 + }, + "Name": "49", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 367, + "LSPosition": { + "line": 12, + "character": 38 + }, + "Name": "50", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) b: T\n```\n" + } + } + }, + { + "marker": { + "Position": 370, + "LSPosition": { + "line": 12, + "character": 41 + }, + "Name": "51", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 374, + "LSPosition": { + "line": 12, + "character": 45 + }, + "Name": "52", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) U extends I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 383, + "LSPosition": { + "line": 14, + "character": 4 + }, + "Name": "53", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal1: I1\u003cI\u003cstring\u003e\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 390, + "LSPosition": { + "line": 14, + "character": 11 + }, + "Name": "54", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ninterface I1\u003cT extends I\u003cstring\u003e\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 393, + "LSPosition": { + "line": 14, + "character": 14 + }, + "Name": "55", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ninterface I\u003cT\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 409, + "LSPosition": { + "line": 15, + "character": 4 + }, + "Name": "56", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal1: I1\u003cI\u003cstring\u003e\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 415, + "LSPosition": { + "line": 15, + "character": 10 + }, + "Name": "57", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal: I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 421, + "LSPosition": { + "line": 15, + "character": 16 + }, + "Name": "58", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal: I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 428, + "LSPosition": { + "line": 16, + "character": 0 + }, + "Name": "59", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal1: I1\u003cI\u003cstring\u003e\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 434, + "LSPosition": { + "line": 16, + "character": 6 + }, + "Name": "60", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal: I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 440, + "LSPosition": { + "line": 16, + "character": 12 + }, + "Name": "61", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal: I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 447, + "LSPosition": { + "line": 17, + "character": 0 + }, + "Name": "62", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal1: I1\u003cI\u003cstring\u003e\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 453, + "LSPosition": { + "line": 17, + "character": 6 + }, + "Name": "63", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) I1.method\u003cI\u003cstring\u003e\u003e(a: I\u003cstring\u003e, b: I\u003cstring\u003e): I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 460, + "LSPosition": { + "line": 17, + "character": 13 + }, + "Name": "64", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal: I\u003cstring\u003e\n```\n" + } + } + }, + { + "marker": { + "Position": 466, + "LSPosition": { + "line": 17, + "character": 19 + }, + "Name": "65", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar iVal: I\u003cstring\u003e\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInTypeAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInTypeAlias.baseline index 44524e6e81..2a20a6cd83 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInTypeAlias.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsTypeParameterInTypeAlias.baseline @@ -44,3 +44,107 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 5, + "LSPosition": { + "line": 0, + "character": 5 + }, + "Name": "0", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype List\u003cT\u003e = T[]\n```\n" + } + } + }, + { + "marker": { + "Position": 10, + "LSPosition": { + "line": 0, + "character": 10 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T\n```\n" + } + } + }, + { + "marker": { + "Position": 15, + "LSPosition": { + "line": 0, + "character": 15 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T\n```\n" + } + } + }, + { + "marker": { + "Position": 24, + "LSPosition": { + "line": 1, + "character": 5 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype List2\u003cT extends string\u003e = T[]\n```\n" + } + } + }, + { + "marker": { + "Position": 30, + "LSPosition": { + "line": 1, + "character": 11 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T extends string\n```\n" + } + } + }, + { + "marker": { + "Position": 50, + "LSPosition": { + "line": 1, + "character": 31 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(type parameter) T extends string\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsUsing.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsUsing.baseline index 8d462dbe9d..710953c9b1 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsUsing.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsUsing.baseline @@ -18,3 +18,39 @@ // | // | ---------------------------------------------------------------------- // }; +[ + { + "marker": { + "Position": 7, + "LSPosition": { + "line": 0, + "character": 7 + }, + "Name": "a", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nusing a: \"a\"\n```\n" + } + } + }, + { + "marker": { + "Position": 55, + "LSPosition": { + "line": 2, + "character": 16 + }, + "Name": "b", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nawait using b: { [Symbol.asyncDispose](): Promise\u003cvoid\u003e; }\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVar.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVar.baseline index 21027f2d08..ae3a962c3c 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVar.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVar.baseline @@ -113,3 +113,243 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 4, + "LSPosition": { + "line": 0, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar a: number\n```\n" + } + } + }, + { + "marker": { + "Position": 37, + "LSPosition": { + "line": 2, + "character": 8 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar b: number\n```\n" + } + } + }, + { + "marker": { + "Position": 41, + "LSPosition": { + "line": 2, + "character": 12 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar a: number\n```\n" + } + } + }, + { + "marker": { + "Position": 65, + "LSPosition": { + "line": 5, + "character": 8 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar c: number\n```\n" + } + } + }, + { + "marker": { + "Position": 88, + "LSPosition": { + "line": 6, + "character": 15 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar d: number\n```\n" + } + } + }, + { + "marker": { + "Position": 102, + "LSPosition": { + "line": 8, + "character": 4 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar f: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 123, + "LSPosition": { + "line": 9, + "character": 4 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar g: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 127, + "LSPosition": { + "line": 9, + "character": 8 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar f: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 130, + "LSPosition": { + "line": 10, + "character": 0 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar f: () =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 139, + "LSPosition": { + "line": 11, + "character": 4 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar h: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 193, + "LSPosition": { + "line": 12, + "character": 4 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar i: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 197, + "LSPosition": { + "line": 12, + "character": 8 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar h: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 200, + "LSPosition": { + "line": 13, + "character": 0 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar h: { (a: string): number; (a: number): string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 207, + "LSPosition": { + "line": 14, + "character": 0 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar h: { (a: string): number; (a: number): string; }\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVarWithStringTypes01.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVarWithStringTypes01.baseline index 0c74fcf968..e04fa6d75c 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVarWithStringTypes01.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoDisplayPartsVarWithStringTypes01.baseline @@ -24,3 +24,56 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 4, + "LSPosition": { + "line": 0, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet hello: \"hello\"\n```\n" + } + } + }, + { + "marker": { + "Position": 44, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet world: \"world\"\n```\n" + } + } + }, + { + "marker": { + "Position": 74, + "LSPosition": { + "line": 2, + "character": 4 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nlet helloOrWorld: \"hello\" | \"world\"\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode1.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode1.baseline index f840ae6183..6c285fe7b3 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode1.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode1.baseline @@ -23,3 +23,39 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 50, + "LSPosition": { + "line": 4, + "character": 9 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f2(x: any): void\n```\n" + } + } + }, + { + "marker": { + "Position": 94, + "LSPosition": { + "line": 8, + "character": 0 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f2(x: any): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode2.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode2.baseline index eb2095beaf..3ea75a0fcf 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode2.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForArgumentsPropertyNameInJsMode2.baseline @@ -19,3 +19,39 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 9, + "LSPosition": { + "line": 0, + "character": 9 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f(x: any): void\n```\n" + } + } + }, + { + "marker": { + "Position": 33, + "LSPosition": { + "line": 4, + "character": 0 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f(x: any): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForConstAssertions.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForConstAssertions.baseline index 0d1852b1a1..6900e74d44 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForConstAssertions.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForConstAssertions.baseline @@ -32,3 +32,73 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 22, + "LSPosition": { + "line": 0, + "character": 22 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype const\n```\n" + } + } + }, + { + "marker": { + "Position": 44, + "LSPosition": { + "line": 1, + "character": 15 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype const\n```\n" + } + } + }, + { + "marker": { + "Position": 68, + "LSPosition": { + "line": 2, + "character": 17 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype const\n```\n" + } + } + }, + { + "marker": { + "Position": 95, + "LSPosition": { + "line": 3, + "character": 20 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype const\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocCodefence.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocCodefence.baseline index 670ef6a555..cd24e6c54c 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocCodefence.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocCodefence.baseline @@ -43,3 +43,39 @@ // | ---------------------------------------------------------------------- // return '2'; // } +[ + { + "marker": { + "Position": 54, + "LSPosition": { + "line": 6, + "character": 11 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): string\n```\n\n\n*@example*\n```\n1 + 2\n```\n" + } + } + }, + { + "marker": { + "Position": 129, + "LSPosition": { + "line": 15, + "character": 11 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction boo(): string\n```\n\n\n*@example* — ``\n1 + 2\n`\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocUnknownTag.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocUnknownTag.baseline index e9a162ae03..6e0f92eeab 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocUnknownTag.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocUnknownTag.baseline @@ -110,3 +110,90 @@ // | ---------------------------------------------------------------------- // return '2'; // } +[ + { + "marker": { + "Position": 64, + "LSPosition": { + "line": 6, + "character": 11 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): string\n```\n\n\n*@example* — if (true) {\n foo()\n}\n" + } + } + }, + { + "marker": { + "Position": 134, + "LSPosition": { + "line": 15, + "character": 11 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo2(): string\n```\n\n\n*@example* — {\n foo()\n}\n" + } + } + }, + { + "marker": { + "Position": 219, + "LSPosition": { + "line": 24, + "character": 10 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction moo(): string\n```\n\n\n*@example* — x y\n 12345\n b\n" + } + } + }, + { + "marker": { + "Position": 313, + "LSPosition": { + "line": 34, + "character": 10 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction boo(): string\n```\n\n\n*@func*\n\n*@example* — x y\n 12345\n b\n" + } + } + }, + { + "marker": { + "Position": 426, + "LSPosition": { + "line": 43, + "character": 11 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction goo(): string\n```\n\n\n*@func*\n\n*@example* — x y\n12345\n b\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline index fc4bc2a8ea..a330f6ea11 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline @@ -55,3 +55,92 @@ // | ``` // | https://hvaD // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 22, + "LSPosition": { + "line": 0, + "character": 22 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 88, + "LSPosition": { + "line": 4, + "character": 21 + }, + "Name": "2", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 120, + "LSPosition": { + "line": 8, + "character": 14 + }, + "Name": "3", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 164, + "LSPosition": { + "line": 11, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar see1: boolean\n```\n\n\n*@see* `https` — ://hvad " + } + } + }, + { + "marker": { + "Position": 213, + "LSPosition": { + "line": 14, + "character": 4 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar see2: boolean\n```\n\n\n*@see* — https://hva " + } + } + }, + { + "marker": { + "Position": 258, + "LSPosition": { + "line": 17, + "character": 4 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar see3: boolean\n```\nhttps://hvaD" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithUnresolvedHttpLinks.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithUnresolvedHttpLinks.baseline index 2581d4b65d..d9d21d5de8 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithUnresolvedHttpLinks.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithUnresolvedHttpLinks.baseline @@ -21,3 +21,39 @@ // | ``` // | https://hvaD // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 36, + "LSPosition": { + "line": 1, + "character": 4 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar see2: boolean\n```\n\n\n*@see* — https://hva " + } + } + }, + { + "marker": { + "Position": 81, + "LSPosition": { + "line": 4, + "character": 4 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar see3: boolean\n```\nhttps://hvaD" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName03.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName03.baseline index 3320d86157..0adf859748 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName03.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName03.baseline @@ -17,3 +17,22 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 122, + "LSPosition": { + "line": 8, + "character": 7 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar foo: string\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName04.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName04.baseline index 00db50daf7..7724aa4bca 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName04.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName04.baseline @@ -30,3 +30,39 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 193, + "LSPosition": { + "line": 13, + "character": 5 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar a: { b: string; }\n```\n" + } + } + }, + { + "marker": { + "Position": 200, + "LSPosition": { + "line": 14, + "character": 5 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar b: string\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName05.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName05.baseline index 6b2c5d65e6..0c5ce7a017 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName05.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName05.baseline @@ -20,3 +20,22 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 137, + "LSPosition": { + "line": 11, + "character": 5 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar a: string | number\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName06.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName06.baseline index b6bd456ee1..f37e98cc12 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName06.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForObjectBindingElementName06.baseline @@ -25,3 +25,22 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 217, + "LSPosition": { + "line": 17, + "character": 5 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst isBar: boolean\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoImportMeta.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoImportMeta.baseline index 11695542ea..7d2cc7bbbe 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoImportMeta.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoImportMeta.baseline @@ -14,3 +14,34 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 77, + "LSPosition": { + "line": 2, + "character": 2 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 84, + "LSPosition": { + "line": 2, + "character": 9 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) ImportMetaExpression.meta: ImportMeta\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc.baseline index a308752d5f..e60d1f05f6 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc.baseline @@ -94,3 +94,56 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 817, + "LSPosition": { + "line": 34, + "character": 18 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) SubClass.doSomethingUseful(mySpecificStuff?: { tiger: string; lion: string; }): string\n```\n\n\n*@inheritDoc*\n\n*@param* `mySpecificStuff` — Description of my specific parameter.\n" + } + } + }, + { + "marker": { + "Position": 1143, + "LSPosition": { + "line": 47, + "character": 18 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) SubClass.func1(stuff1: any): void\n```\n\n\n*@inheritDoc*\n\n*@param* `stuff1` — SubClass.func1.stuff1\n\n\n*@returns* — SubClass.func1.returns\n" + } + } + }, + { + "marker": { + "Position": 1282, + "LSPosition": { + "line": 55, + "character": 27 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) SubClass.someProperty: string\n```\ntext over tag\n\n*@inheritDoc* — text after tag\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc2.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc2.baseline index d2de06b982..5fbc6298d3 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc2.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc2.baseline @@ -24,3 +24,22 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 173, + "LSPosition": { + "line": 12, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) SubClass.prop: T\n```\n\n\n*@inheritdoc* — SubClass.prop\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc3.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc3.baseline index 452ee43d1f..3db97df276 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc3.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc3.baseline @@ -25,3 +25,22 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 237, + "LSPosition": { + "line": 13, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) SubClass.prop: string\n```\n\n\n*@inheritdoc* — SubClass.prop\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc4.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc4.baseline index 4e68998145..44bb189e61 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc4.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc4.baseline @@ -19,3 +19,22 @@ // return undefined; // } // } +[ + { + "marker": { + "Position": 79, + "LSPosition": { + "line": 6, + "character": 11 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) B.value(): any\n```\n\n\n*@inheritdoc*" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc5.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc5.baseline index 4faa25edb4..b835d3aa7a 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc5.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc5.baseline @@ -19,3 +19,22 @@ // return undefined; // } // } +[ + { + "marker": { + "Position": 83, + "LSPosition": { + "line": 6, + "character": 11 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) B.value(): any\n```\n\n\n*@inheritdoc*" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc6.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc6.baseline index 424235d43e..79b3517492 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc6.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoInheritDoc6.baseline @@ -17,3 +17,22 @@ // return undefined; // } // } +[ + { + "marker": { + "Position": 107, + "LSPosition": { + "line": 4, + "character": 11 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) B.value(): any\n```\n\n\n*@inheritdoc*" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocAtBeforeSpace.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocAtBeforeSpace.baseline index 17272b66e4..566ad012d0 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocAtBeforeSpace.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocAtBeforeSpace.baseline @@ -44,3 +44,56 @@ // | But another line // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 39, + "LSPosition": { + "line": 3, + "character": 9 + }, + "Name": "f", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f(): void\n```\n\n\n*@return* — Don't @ me\n" + } + } + }, + { + "marker": { + "Position": 87, + "LSPosition": { + "line": 7, + "character": 9 + }, + "Name": "g", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction g(): void\n```\n\n\n*@return* — One final @\n" + } + } + }, + { + "marker": { + "Position": 148, + "LSPosition": { + "line": 12, + "character": 9 + }, + "Name": "h", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction h(): void\n```\n\n\n*@return* — An @\nBut another line\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocTags.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocTags.baseline index 25e36c64cc..57821c699a 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocTags.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJSDocTags.baseline @@ -179,3 +179,218 @@ // | ---------------------------------------------------------------------- // | No quickinfo at /*14*/. // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 977, + "LSPosition": { + "line": 49, + "character": 14 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconstructor Foo(value: number): Foo\n```\nThis is the constructor.\n\n*@myjsdoctag* — this is a comment\n" + } + } + }, + { + "marker": { + "Position": 981, + "LSPosition": { + "line": 49, + "character": 18 + }, + "Name": "10", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 985, + "LSPosition": { + "line": 50, + "character": 0 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass Foo\n```\nThis is class Foo.\n\n*@mytag* — comment1 comment2\n" + } + } + }, + { + "marker": { + "Position": 989, + "LSPosition": { + "line": 50, + "character": 4 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Foo.method1(): void\n```\nmethod1 documentation\n\n*@mytag* — comment1 comment2\n" + } + } + }, + { + "marker": { + "Position": 997, + "LSPosition": { + "line": 50, + "character": 12 + }, + "Name": "11", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 1004, + "LSPosition": { + "line": 51, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Foo.method2(): void\n```\n\n\n*@mytag*" + } + } + }, + { + "marker": { + "Position": 1012, + "LSPosition": { + "line": 51, + "character": 12 + }, + "Name": "12", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 1019, + "LSPosition": { + "line": 52, + "character": 4 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Foo.method3(): number\n```\n\n\n*@returns* — a value\n" + } + } + }, + { + "marker": { + "Position": 1027, + "LSPosition": { + "line": 52, + "character": 12 + }, + "Name": "13", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 1034, + "LSPosition": { + "line": 53, + "character": 4 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Foo.method4(foo: string): number\n```\n\n\n*@param* `foo` — A value.\n\n\n*@returns* — Another value\n\n\n*@mytag*" + } + } + }, + { + "marker": { + "Position": 1049, + "LSPosition": { + "line": 54, + "character": 4 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Foo.property1: string\n```\n\n\n*@mytag* — comment1 comment2\n" + } + } + }, + { + "marker": { + "Position": 1064, + "LSPosition": { + "line": 55, + "character": 4 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Foo.property2: number\n```\n\n\n*@mytag1* — some comments\nsome more comments about mytag1\n\n\n*@mytag2* — here all the comments are on a new line\n\n\n*@mytag3*\n\n*@mytag*" + } + } + }, + { + "marker": { + "Position": 1079, + "LSPosition": { + "line": 56, + "character": 4 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Foo.method5(): void\n```\n\n\n*@mytag*" + } + } + }, + { + "marker": { + "Position": 1100, + "LSPosition": { + "line": 57, + "character": 10 + }, + "Name": "14", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDoc.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDoc.baseline index ad13e15fd5..e2c8d0ab2d 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDoc.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDoc.baseline @@ -160,3 +160,204 @@ // | ---------------------------------------------------------------------- // } // } +[ + { + "marker": { + "Position": 416, + "LSPosition": { + "line": 38, + "character": 18 + }, + "Name": "0", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) C.field: string\n```\nA field\n\n*@deprecated*" + } + } + }, + { + "marker": { + "Position": 437, + "LSPosition": { + "line": 39, + "character": 19 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) C.getter: void\n```\nA getter\n\n*@deprecated*" + } + } + }, + { + "marker": { + "Position": 453, + "LSPosition": { + "line": 40, + "character": 14 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C.m(): void\n```\nA method\n\n*@deprecated*" + } + } + }, + { + "marker": { + "Position": 466, + "LSPosition": { + "line": 41, + "character": 11 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar foo: string\n```\nA constant\n\n*@deprecated*" + } + } + }, + { + "marker": { + "Position": 477, + "LSPosition": { + "line": 42, + "character": 9 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass C\n```\nA class\n\n*@deprecated*" + } + } + }, + { + "marker": { + "Position": 492, + "LSPosition": { + "line": 43, + "character": 12 + }, + "Name": "5", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 565, + "LSPosition": { + "line": 49, + "character": 18 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) C.field: string\n```\nA field\n\n*@deprecated*" + } + } + }, + { + "marker": { + "Position": 586, + "LSPosition": { + "line": 50, + "character": 19 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) C.getter: void\n```\nA getter\n\n*@deprecated*" + } + } + }, + { + "marker": { + "Position": 602, + "LSPosition": { + "line": 51, + "character": 14 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C.m(): void\n```\nA method\n\n*@deprecated*" + } + } + }, + { + "marker": { + "Position": 615, + "LSPosition": { + "line": 52, + "character": 11 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar foo: string\n```\nA constant\n\n*@deprecated*" + } + } + }, + { + "marker": { + "Position": 626, + "LSPosition": { + "line": 53, + "character": 9 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nclass C\n```\nA class\n\n*@deprecated*" + } + } + }, + { + "marker": { + "Position": 638, + "LSPosition": { + "line": 54, + "character": 10 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction fn(): void\n```\nA function\n\n*@deprecated*" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocAlias.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocAlias.baseline index a551bffa69..0bd2cc7bff 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocAlias.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocAlias.baseline @@ -6,3 +6,17 @@ // | ---------------------------------------------------------------------- // | No quickinfo at /**/. // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 26, + "LSPosition": { + "line": 1, + "character": 1 + }, + "Name": "", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocGetterSetter.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocGetterSetter.baseline index 1d5482274c..065ed53e39 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocGetterSetter.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocGetterSetter.baseline @@ -134,3 +134,158 @@ // | *@param* `value` — foo D // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 75, + "LSPosition": { + "line": 5, + "character": 8 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) A.x: string\n```\ngetter A\n\n*@returns* — return A\n" + } + } + }, + { + "marker": { + "Position": 205, + "LSPosition": { + "line": 13, + "character": 8 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) A.x: string\n```\ngetter A\n\n*@returns* — return A\n" + } + } + }, + { + "marker": { + "Position": 340, + "LSPosition": { + "line": 21, + "character": 8 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) B.x: string\n```\ngetter B\n\n*@returns* — return B\n" + } + } + }, + { + "marker": { + "Position": 445, + "LSPosition": { + "line": 28, + "character": 8 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) B.x: string\n```\ngetter B\n\n*@returns* — return B\n" + } + } + }, + { + "marker": { + "Position": 607, + "LSPosition": { + "line": 38, + "character": 8 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) D.x: string\n```\nsetter D\n\n*@param* `value` — foo D\n" + } + } + }, + { + "marker": { + "Position": 636, + "LSPosition": { + "line": 40, + "character": 8 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) A.x: string\n```\ngetter A\n\n*@returns* — return A\n" + } + } + }, + { + "marker": { + "Position": 653, + "LSPosition": { + "line": 41, + "character": 8 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) B.x: string\n```\ngetter B\n\n*@returns* — return B\n" + } + } + }, + { + "marker": { + "Position": 670, + "LSPosition": { + "line": 42, + "character": 8 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) A.x: string\n```\ngetter A\n\n*@returns* — return A\n" + } + } + }, + { + "marker": { + "Position": 687, + "LSPosition": { + "line": 43, + "character": 8 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(accessor) D.x: string\n```\nsetter D\n\n*@param* `value` — foo D\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocInheritage.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocInheritage.baseline index c57720d00b..1898f4ac7d 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocInheritage.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocInheritage.baseline @@ -272,3 +272,413 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 429, + "LSPosition": { + "line": 25, + "character": 4 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) C.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 451, + "LSPosition": { + "line": 26, + "character": 4 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C.foo2(q: string): number\n```\n" + } + } + }, + { + "marker": { + "Position": 598, + "LSPosition": { + "line": 32, + "character": 4 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) D.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 620, + "LSPosition": { + "line": 33, + "character": 4 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) D.foo2: (q: string) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 666, + "LSPosition": { + "line": 36, + "character": 8 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) C.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 680, + "LSPosition": { + "line": 37, + "character": 8 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C.foo2(q: string): number\n```\n" + } + } + }, + { + "marker": { + "Position": 694, + "LSPosition": { + "line": 38, + "character": 8 + }, + "Name": "7", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) D.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 708, + "LSPosition": { + "line": 39, + "character": 8 + }, + "Name": "8", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) D.foo2: (q: string) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 1069, + "LSPosition": { + "line": 58, + "character": 4 + }, + "Name": "9", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived1.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1091, + "LSPosition": { + "line": 59, + "character": 4 + }, + "Name": "10", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Drived1.foo2(para1: string): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1263, + "LSPosition": { + "line": 65, + "character": 4 + }, + "Name": "11", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived2.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1285, + "LSPosition": { + "line": 66, + "character": 4 + }, + "Name": "12", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived2.foo2: (para1: string) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 1681, + "LSPosition": { + "line": 85, + "character": 4 + }, + "Name": "13", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived3.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1703, + "LSPosition": { + "line": 86, + "character": 4 + }, + "Name": "14", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Drived3.foo2(para1: string): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1875, + "LSPosition": { + "line": 92, + "character": 4 + }, + "Name": "15", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived4.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1897, + "LSPosition": { + "line": 93, + "character": 4 + }, + "Name": "16", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived4.foo2: (para1: string) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 1955, + "LSPosition": { + "line": 96, + "character": 14 + }, + "Name": "17", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived1.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 1975, + "LSPosition": { + "line": 97, + "character": 14 + }, + "Name": "18", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Drived1.foo2(para1: string): number\n```\n" + } + } + }, + { + "marker": { + "Position": 1995, + "LSPosition": { + "line": 98, + "character": 14 + }, + "Name": "19", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived2.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2015, + "LSPosition": { + "line": 99, + "character": 14 + }, + "Name": "20", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived2.foo2: (para1: string) =\u003e number\n```\n" + } + } + }, + { + "marker": { + "Position": 2035, + "LSPosition": { + "line": 100, + "character": 14 + }, + "Name": "21", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived3.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2055, + "LSPosition": { + "line": 101, + "character": 14 + }, + "Name": "22", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Drived3.foo2(para1: string): number\n```\n" + } + } + }, + { + "marker": { + "Position": 2075, + "LSPosition": { + "line": 102, + "character": 14 + }, + "Name": "23", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived4.foo1: number\n```\n" + } + } + }, + { + "marker": { + "Position": 2095, + "LSPosition": { + "line": 103, + "character": 14 + }, + "Name": "24", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Drived4.foo2: (para1: string) =\u003e number\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags1.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags1.baseline index 8ffe4d1325..90989f19d1 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags1.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags1.baseline @@ -20,3 +20,22 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 298, + "LSPosition": { + "line": 12, + "character": 9 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(x: any): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags10.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags10.baseline index 172ccc6e35..cfa5017643 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags10.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags10.baseline @@ -20,3 +20,22 @@ // | *@template* `T1`, `T2` — Comment Text // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 80, + "LSPosition": { + "line": 5, + "character": 6 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst foo: \u003cT1, T2\u003e(a: T1, b: any) =\u003e void\n```\n\n\n*@param* `a`\n\n*@param* `a`\n\n*@template* `T1`, `T2` — Comment Text\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags11.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags11.baseline index 29766b8060..5c8927e62c 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags11.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags11.baseline @@ -24,3 +24,22 @@ // | *@template* `T2` — Comment T2 // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 120, + "LSPosition": { + "line": 6, + "character": 6 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst foo: \u003cT1 extends number, T2 extends number\u003e(a: T1, b: T2) =\u003e void\n```\n\n\n*@param* `a`\n\n*@param* `b`\n\n*@template* `T1` — Comment T1\n\n\n*@template* `T2` — Comment T2\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags12.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags12.baseline index 42d89ca7fa..25421d62de 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags12.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags12.baseline @@ -24,3 +24,22 @@ // | *@returns* // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 218, + "LSPosition": { + "line": 7, + "character": 9 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f(options: any, callback?: any): void\n```\n\n\n*@param* `options` — the args object\n\n\n*@param* `callback` — the callback function\n\n\n*@returns*" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags14.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags14.baseline index 0544832e75..48c81120e5 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags14.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags14.baseline @@ -25,3 +25,22 @@ // | // | *@returns* // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 302, + "LSPosition": { + "line": 9, + "character": 9 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction fn(options: any, callback?: any): void\n```\n\n\n*@param* `options` — the args object\n\n\n*@param* `callback` — the callback function\n\n\n*@returns*" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline index fa8384ae26..8e3a9f190d 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline @@ -27,3 +27,41 @@ // | ---------------------------------------------------------------------- // */ // class C3 { } +[ + { + "marker": { + "Position": 56, + "LSPosition": { + "line": 2, + "character": 22 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 99, + "LSPosition": { + "line": 7, + "character": 19 + }, + "Name": "2", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 143, + "LSPosition": { + "line": 12, + "character": 20 + }, + "Name": "3", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags16.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags16.baseline index e68d355323..6cdb74648c 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags16.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags16.baseline @@ -30,3 +30,39 @@ // | // | ---------------------------------------------------------------------- // } +[ + { + "marker": { + "Position": 129, + "LSPosition": { + "line": 10, + "character": 13 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) B.foo(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 175, + "LSPosition": { + "line": 14, + "character": 13 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) C.foo(): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags3.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags3.baseline index d3fbbc4547..31953c9cd3 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags3.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags3.baseline @@ -24,3 +24,22 @@ // throw new Error("Method not implemented."); // } // } +[ + { + "marker": { + "Position": 290, + "LSPosition": { + "line": 13, + "character": 4 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Bar.method(): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags4.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags4.baseline index c5d26b158d..dc8bc33d80 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags4.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags4.baseline @@ -27,3 +27,22 @@ // return res; // } // } +[ + { + "marker": { + "Position": 309, + "LSPosition": { + "line": 15, + "character": 4 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Bar.method(x: number, y: number): number\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags5.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags5.baseline index 0ea752b75f..161220f379 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags5.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags5.baseline @@ -27,3 +27,22 @@ // return res; // } // } +[ + { + "marker": { + "Position": 285, + "LSPosition": { + "line": 15, + "character": 4 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Bar.method(x: any, y: any): number\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags6.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags6.baseline index 243837e6bf..7ec2721777 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags6.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags6.baseline @@ -30,3 +30,22 @@ // return res; // } // } +[ + { + "marker": { + "Position": 308, + "LSPosition": { + "line": 16, + "character": 4 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(method) Bar.method(x: any, y: any): number\n```\n\n\n*@inheritDoc*" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags7.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags7.baseline index b38d9fcc8c..f2408a9df9 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags7.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags7.baseline @@ -18,3 +18,22 @@ // | // | *@template* `T` // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 116, + "LSPosition": { + "line": 8, + "character": 6 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst foo: (t: T) =\u003e number\n```\n\n\n*@template* `T`" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags8.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags8.baseline index 1ea979c859..854922768b 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags8.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags8.baseline @@ -18,3 +18,22 @@ // | // | *@template* `T` // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 122, + "LSPosition": { + "line": 8, + "character": 6 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst foo: (t: T) =\u003e number\n```\n\n\n*@template* `T`" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags9.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags9.baseline index 5e8b33ab57..8b578506d1 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags9.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags9.baseline @@ -19,3 +19,22 @@ // | *@template* `T` — Comment Text // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 135, + "LSPosition": { + "line": 8, + "character": 6 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst foo: (t: T) =\u003e number\n```\n\n\n*@template* `T` — Comment Text\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsCallback.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsCallback.baseline index 31d873747d..fa0c75b12f 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsCallback.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsCallback.baseline @@ -22,3 +22,34 @@ // function foo(bar) { // bar(bar); // } +[ + { + "marker": { + "Position": 19, + "LSPosition": { + "line": 1, + "character": 15 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 73, + "LSPosition": { + "line": 6, + "character": 11 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype cb = (x: string) =\u003e any\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload01.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload01.baseline index 4112126630..24c6302a5b 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload01.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload01.baseline @@ -26,3 +26,39 @@ // | ``` // | Doc foo // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 36, + "LSPosition": { + "line": 3, + "character": 17 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): void\nfunction foo(x: number): void\n```\nDoc foo" + } + } + }, + { + "marker": { + "Position": 114, + "LSPosition": { + "line": 9, + "character": 17 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): void\nfunction foo(x: number): void\n```\nDoc foo" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload03.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload03.baseline index 440203757a..67f2c41a90 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload03.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload03.baseline @@ -23,3 +23,39 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 17, + "LSPosition": { + "line": 0, + "character": 17 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): void\nfunction foo(x: number): void\n```\n" + } + } + }, + { + "marker": { + "Position": 95, + "LSPosition": { + "line": 6, + "character": 17 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): void\nfunction foo(x: number): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload05.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload05.baseline index 8a04085aa5..d5b578eb69 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload05.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsFunctionOverload05.baseline @@ -22,3 +22,39 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 17, + "LSPosition": { + "line": 0, + "character": 17 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): void\nfunction foo(x: number): void\n```\n" + } + } + }, + { + "marker": { + "Position": 73, + "LSPosition": { + "line": 5, + "character": 17 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction foo(): void\nfunction foo(x: number): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline index 2afdaa9eab..32921bce22 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline @@ -26,3 +26,34 @@ // function foo(x) { // return x; // } +[ + { + "marker": { + "Position": 40, + "LSPosition": { + "line": 2, + "character": 21 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 159, + "LSPosition": { + "line": 9, + "character": 11 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype Bar = { baz: string; qux: string; }\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocThisTag.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocThisTag.baseline index 3c1acbcc3f..3e67157a11 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocThisTag.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocThisTag.baseline @@ -13,3 +13,22 @@ // | ---------------------------------------------------------------------- // this // } +[ + { + "marker": { + "Position": 32, + "LSPosition": { + "line": 1, + "character": 10 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f(): void\n```\n\n\n*@this*" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink10.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink10.baseline index b44ae3c76b..f1bed7d790 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoLink10.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink10.baseline @@ -11,3 +11,22 @@ // | ``` // | start https://vscode.dev/ | end // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 57, + "LSPosition": { + "line": 3, + "character": 6 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst a: () =\u003e number\n```\nstart https://vscode.dev/ | end" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink11.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink11.baseline index 99d3131f96..91c1de8c46 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoLink11.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink11.baseline @@ -19,3 +19,22 @@ // | https://vscode.dev|link text // | https://vscode.dev link text // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 170, + "LSPosition": { + "line": 8, + "character": 0 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f(): void\n```\nhttps://vscode.dev\n[link text]{https://vscode.dev}\nhttps://vscode.dev|link text\nhttps://vscode.dev link text" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink5.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink5.baseline index 806166835d..eda69860a2 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoLink5.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink5.baseline @@ -12,3 +12,22 @@ // | ``` // | See A| constant A instead // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 67, + "LSPosition": { + "line": 4, + "character": 6 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst B: 456\n```\nSee A| constant A instead" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink6.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink6.baseline index 888fd00b6d..31cd81dd77 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoLink6.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink6.baseline @@ -12,3 +12,22 @@ // | ``` // | See A|constant A instead // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 67, + "LSPosition": { + "line": 4, + "character": 6 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst B: 456\n```\nSee A|constant A instead" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink7.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink7.baseline index a7330c2d83..a901b0a6ac 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoLink7.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink7.baseline @@ -11,3 +11,22 @@ // | ``` // | See | instead // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 46, + "LSPosition": { + "line": 3, + "character": 6 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst B: 456\n```\nSee | instead" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink8.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink8.baseline index 967fa89a1b..593e4ed5fc 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoLink8.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink8.baseline @@ -12,3 +12,22 @@ // | ``` // | See A| constant A instead // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 67, + "LSPosition": { + "line": 4, + "character": 6 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst B: 456\n```\nSee A| constant A instead" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoLink9.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoLink9.baseline index 816d7f6fd5..b3fb50cc39 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoLink9.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoLink9.baseline @@ -10,3 +10,17 @@ // */ // c: (a: number) => void; // } +[ + { + "marker": { + "Position": 47, + "LSPosition": { + "line": 2, + "character": 26 + }, + "Name": "", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoNestedExportEqualExportDefault.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoNestedExportEqualExportDefault.baseline index 99f75e9df5..588627a770 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoNestedExportEqualExportDefault.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoNestedExportEqualExportDefault.baseline @@ -15,3 +15,34 @@ // | ---------------------------------------------------------------------- // } // } +[ + { + "marker": { + "Position": 41, + "LSPosition": { + "line": 1, + "character": 9 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) (Anonymous function).default: {}\n```\n" + } + } + }, + { + "marker": { + "Position": 49, + "LSPosition": { + "line": 1, + "character": 17 + }, + "Name": "2", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature.baseline index d54731d3be..8308c0edab 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature.baseline @@ -11,3 +11,22 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 86, + "LSPosition": { + "line": 3, + "character": 1 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nany\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures.baseline index 5c5f910849..0b896b424d 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures.baseline @@ -22,3 +22,39 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 126, + "LSPosition": { + "line": 6, + "character": 1 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nany\n```\n" + } + } + }, + { + "marker": { + "Position": 138, + "LSPosition": { + "line": 7, + "character": 1 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nany\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxNamespacedName.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxNamespacedName.baseline index 8b789a7b48..29e90418e5 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxNamespacedName.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnJsxNamespacedName.baseline @@ -5,3 +5,17 @@ // | ---------------------------------------------------------------------- // | No quickinfo at /**/. // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 1, + "LSPosition": { + "line": 0, + "character": 1 + }, + "Name": "", + "Data": null + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnParameterProperties.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnParameterProperties.baseline index adcb369c60..11e712a25b 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoOnParameterProperties.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnParameterProperties.baseline @@ -39,3 +39,39 @@ // ) { // } // } +[ + { + "marker": { + "Position": 226, + "LSPosition": { + "line": 12, + "character": 13 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Foo.name: string\n```\n" + } + } + }, + { + "marker": { + "Position": 347, + "LSPosition": { + "line": 19, + "character": 11 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) Foo2.name: string\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnThis5.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnThis5.baseline index 65f1ca7abb..2fc212ce4b 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoOnThis5.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnThis5.baseline @@ -59,3 +59,102 @@ // | ---------------------------------------------------------------------- // } // } +[ + { + "marker": { + "Position": 62, + "LSPosition": { + "line": 3, + "character": 26 + }, + "Name": "1", + "Data": null + }, + "item": null + }, + { + "marker": { + "Position": 92, + "LSPosition": { + "line": 4, + "character": 26 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nany\n```\n" + } + } + }, + { + "marker": { + "Position": 155, + "LSPosition": { + "line": 7, + "character": 26 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) this: number\n```\n" + } + } + }, + { + "marker": { + "Position": 228, + "LSPosition": { + "line": 13, + "character": 26 + }, + "Name": "4", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nthis\n```\n" + } + } + }, + { + "marker": { + "Position": 258, + "LSPosition": { + "line": 14, + "character": 26 + }, + "Name": "5", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nthis\n```\n" + } + } + }, + { + "marker": { + "Position": 320, + "LSPosition": { + "line": 17, + "character": 26 + }, + "Name": "6", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(parameter) this: number\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoOnUnionPropertiesWithIdenticalJSDocComments01.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoOnUnionPropertiesWithIdenticalJSDocComments01.baseline index a6c6b6428d..80a24468c1 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoOnUnionPropertiesWithIdenticalJSDocComments01.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoOnUnionPropertiesWithIdenticalJSDocComments01.baseline @@ -32,3 +32,22 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 746, + "LSPosition": { + "line": 24, + "character": 2 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) language: string\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoSalsaMethodsOnAssignedFunctionExpressions.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoSalsaMethodsOnAssignedFunctionExpressions.baseline index 0b7eb58e14..7e1ca3db26 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoSalsaMethodsOnAssignedFunctionExpressions.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoSalsaMethodsOnAssignedFunctionExpressions.baseline @@ -17,3 +17,22 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 155, + "LSPosition": { + "line": 9, + "character": 1 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nvar x: any\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoSatisfiesTag.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoSatisfiesTag.baseline index 997b1c0fed..5614144529 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoSatisfiesTag.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoSatisfiesTag.baseline @@ -11,3 +11,22 @@ // | // | *@satisfies* — comment // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 41, + "LSPosition": { + "line": 1, + "character": 6 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst a: 1\n```\n\n\n*@satisfies* — comment " + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoTypedefTag.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoTypedefTag.baseline index 664cc9dafd..8f2539ea20 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoTypedefTag.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoTypedefTag.baseline @@ -43,3 +43,56 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 114, + "LSPosition": { + "line": 5, + "character": 1 + }, + "Name": "1", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction f(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 316, + "LSPosition": { + "line": 13, + "character": 1 + }, + "Name": "2", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction g(): void\n```\n" + } + } + }, + { + "marker": { + "Position": 472, + "LSPosition": { + "line": 21, + "character": 1 + }, + "Name": "3", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nfunction h(keep: Local): void\n```\n" + } + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoUniqueSymbolJsDoc.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoUniqueSymbolJsDoc.baseline index 993934bd4b..ac04e61eb5 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoUniqueSymbolJsDoc.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoUniqueSymbolJsDoc.baseline @@ -10,3 +10,22 @@ // | ``` // | // | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 54, + "LSPosition": { + "line": 2, + "character": 3 + }, + "Name": "", + "Data": null + }, + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\nconst foo: typeof foo\n```\n" + } + } + } +] \ No newline at end of file From cc4117343f55ec47a07716dfe0fa06ff067890e4 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 16:10:49 -0700 Subject: [PATCH 10/12] Format. --- internal/fourslash/_scripts/convertFourslash.mts | 6 ++---- internal/fourslash/baselineutil.go | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/internal/fourslash/_scripts/convertFourslash.mts b/internal/fourslash/_scripts/convertFourslash.mts index a5ef58f727..16cde3ed07 100644 --- a/internal/fourslash/_scripts/convertFourslash.mts +++ b/internal/fourslash/_scripts/convertFourslash.mts @@ -711,10 +711,9 @@ function parseBaselineQuickInfo(args: ts.NodeArray): Cmd { } return { kind: "verifyBaselineQuickInfo", - } + }; } - function parseKind(expr: ts.Expression): string | undefined { if (!ts.isStringLiteral(expr)) { console.error(`Expected string literal for kind, got ${expr.getText()}`); @@ -884,8 +883,7 @@ type Cmd = | VerifyBaselineGoToDefinitionCmd | VerifyBaselineQuickInfoCmd | GoToCmd - | EditCmd - ; + | EditCmd; function generateVerifyCompletions({ marker, args, isNewIdentifierLocation }: VerifyCompletionsCmd): string { let expectedList: string; diff --git a/internal/fourslash/baselineutil.go b/internal/fourslash/baselineutil.go index 98b9224024..fb29ec8bb5 100644 --- a/internal/fourslash/baselineutil.go +++ b/internal/fourslash/baselineutil.go @@ -487,9 +487,8 @@ func annotateContentWithTooltips[T comparable]( if textRange.Start.Line != textRange.End.Line { t.Fatalf("Expected text range to be on a single line, got %v", textRange) } - underline := - strings.Repeat(" ", int(textRange.Start.Character)) + - strings.Repeat("^", int(textRange.End.Character-textRange.Start.Character)) + underline := strings.Repeat(" ", int(textRange.Start.Character)) + + strings.Repeat("^", int(textRange.End.Character-textRange.Start.Character)) fileName := marker.FileName() lines, ok := filesToLines.Get(fileName) From c9ef96c85a6cab9dcc2247f0c2f12f067327f72b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 16:37:52 -0700 Subject: [PATCH 11/12] Remove unused baseline. --- .../FindReferencesAfterEdit.baseline.jsonc | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 testdata/baselines/reference/fourslash/findAllRef/FindReferencesAfterEdit.baseline.jsonc diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesAfterEdit.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesAfterEdit.baseline.jsonc deleted file mode 100644 index 9123c0f239..0000000000 --- a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesAfterEdit.baseline.jsonc +++ /dev/null @@ -1,36 +0,0 @@ -// === findAllReferences === -// === /a.ts === - -// interface A { -// /*FIND ALL REFS*/[|foo|]: string; -// } - - -// === /b.ts === - -// /// -// -// -// function foo(x: A) { -// x.[|foo|] -// } - - - - -// === findAllReferences === -// === /a.ts === - -// interface A { -// [|foo|]: string; -// } - - -// === /b.ts === - -// /// -// -// -// function foo(x: A) { -// x./*FIND ALL REFS*/[|foo|] -// } From 57f93e515e426f3aacfb3699905b58ab7442ba24 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 29 Jul 2025 16:58:47 -0700 Subject: [PATCH 12/12] Lint. --- internal/fourslash/fourslash.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go index 2c6de8cc23..7728f75aa6 100644 --- a/internal/fourslash/fourslash.go +++ b/internal/fourslash/fourslash.go @@ -990,7 +990,7 @@ func (f *FourslashTest) VerifyBaselineHover(t *testing.T) { } func appendLinesForMarkedStringWithLanguage(result []string, ms *lsproto.MarkedStringWithLanguage) []string { - result = append(result, fmt.Sprintf("```%s", ms.Language)) + result = append(result, "```"+ms.Language) result = append(result, ms.Value) result = append(result, "```") return result