diff --git a/internal/ast/ast.go b/internal/ast/ast.go index 154cf13c8a..1a6a9d8283 100644 --- a/internal/ast/ast.go +++ b/internal/ast/ast.go @@ -9657,6 +9657,10 @@ func IsJSDocParameterTag(node *Node) bool { return node.Kind == KindJSDocParameterTag } +func IsJSDocPropertyTag(node *Node) bool { + return node.Kind == KindJSDocPropertyTag +} + // JSDocReturnTag type JSDocReturnTag struct { JSDocTagBase @@ -10133,6 +10137,8 @@ func (node *JSDocCallbackTag) Clone(f NodeFactoryCoercible) *Node { return cloneNode(f.AsNodeFactory().NewJSDocCallbackTag(node.TagName, node.TypeExpression, node.FullName, node.Comment), node.AsNode(), f.AsNodeFactory().hooks) } +func (node *JSDocCallbackTag) Name() *DeclarationName { return node.FullName } + func IsJSDocCallbackTag(node *Node) bool { return node.Kind == KindJSDocCallbackTag } @@ -10282,6 +10288,10 @@ func (node *JSDocSignature) Clone(f NodeFactoryCoercible) *Node { return cloneNode(f.AsNodeFactory().NewJSDocSignature(node.TypeParameters, node.Parameters, node.Type), node.AsNode(), f.AsNodeFactory().hooks) } +func IsJSDocSignature(node *Node) bool { + return node.Kind == KindJSDocSignature +} + // JSDocNameReference type JSDocNameReference struct { TypeNodeBase @@ -10315,6 +10325,10 @@ func (node *JSDocNameReference) Clone(f NodeFactoryCoercible) *Node { func (node *JSDocNameReference) Name() *EntityName { return node.name } +func IsJSDocNameReference(node *Node) bool { + return node.Kind == KindJSDocNameReference +} + // PatternAmbientModule type PatternAmbientModule struct { diff --git a/internal/ast/utilities.go b/internal/ast/utilities.go index be31ac3541..b5ae76d503 100644 --- a/internal/ast/utilities.go +++ b/internal/ast/utilities.go @@ -552,6 +552,10 @@ func IsClassLike(node *Node) bool { return node.Kind == KindClassDeclaration || node.Kind == KindClassExpression } +func IsClassOrInterfaceLike(node *Node) bool { + return node.Kind == KindClassDeclaration || node.Kind == KindClassExpression || node.Kind == KindInterfaceDeclaration +} + func IsClassElement(node *Node) bool { switch node.Kind { case KindConstructor, @@ -1899,13 +1903,11 @@ func IsExpressionNode(node *Node) bool { for node.Parent.Kind == KindQualifiedName { node = node.Parent } - return IsTypeQueryNode(node.Parent) || IsJSDocLinkLike(node.Parent) || isJSXTagName(node) - case KindJSDocMemberName: - return IsTypeQueryNode(node.Parent) || IsJSDocLinkLike(node.Parent) || isJSXTagName(node) + return IsTypeQueryNode(node.Parent) || IsJSDocLinkLike(node.Parent) || IsJSDocNameReference(node.Parent) || isJSXTagName(node) case KindPrivateIdentifier: return IsBinaryExpression(node.Parent) && node.Parent.AsBinaryExpression().Left == node && node.Parent.AsBinaryExpression().OperatorToken.Kind == KindInKeyword case KindIdentifier: - if IsTypeQueryNode(node.Parent) || IsJSDocLinkLike(node.Parent) || isJSXTagName(node) { + if IsTypeQueryNode(node.Parent) || IsJSDocLinkLike(node.Parent) || IsJSDocNameReference(node.Parent) || isJSXTagName(node) { return true } fallthrough @@ -2045,7 +2047,9 @@ func isPartOfTypeNodeInParent(node *Node) bool { func isPartOfTypeExpressionWithTypeArguments(node *Node) bool { parent := node.Parent - return IsHeritageClause(parent) && (!IsClassLike(parent.Parent) || parent.AsHeritageClause().Token == KindImplementsKeyword) + return IsHeritageClause(parent) && (!IsClassLike(parent.Parent) || parent.AsHeritageClause().Token == KindImplementsKeyword) || + IsJSDocImplementsTag(parent) || + IsJSDocAugmentsTag(parent) } func IsJSDocLinkLike(node *Node) bool { @@ -2620,12 +2624,12 @@ func IsParseTreeNode(node *Node) bool { return node.Flags&NodeFlagsSynthesized == 0 } -// Returns a token if position is in [start-of-leading-trivia, end), includes JSDoc only in JS files -func GetNodeAtPosition(file *SourceFile, position int, isJavaScriptFile bool) *Node { +// Returns a token if position is in [start-of-leading-trivia, end), includes JSDoc only if requested +func GetNodeAtPosition(file *SourceFile, position int, includeJSDoc bool) *Node { current := file.AsNode() for { var child *Node - if isJavaScriptFile { + if includeJSDoc { for _, jsdoc := range current.JSDoc(file) { if nodeContainsPosition(jsdoc, position) { child = jsdoc @@ -3867,3 +3871,9 @@ func GetRestIndicatorOfBindingOrAssignmentElement(bindingElement *Node) *Node { } return nil } + +func IsJSDocNameReferenceContext(node *Node) bool { + return node.Flags&NodeFlagsJSDoc != 0 && FindAncestor(node, func(node *Node) bool { + return IsJSDocNameReference(node) || IsJSDocLinkLike(node) + }) != nil +} diff --git a/internal/astnav/tokens.go b/internal/astnav/tokens.go index dffde94e89..a7b4750034 100644 --- a/internal/astnav/tokens.go +++ b/internal/astnav/tokens.go @@ -9,9 +9,27 @@ import ( ) func GetTouchingPropertyName(sourceFile *ast.SourceFile, position int) *ast.Node { - return getTokenAtPosition(sourceFile, position, false /*allowPositionInLeadingTrivia*/, func(node *ast.Node) bool { + return getReparsedNodeForNode(getTokenAtPosition(sourceFile, position, false /*allowPositionInLeadingTrivia*/, func(node *ast.Node) bool { return ast.IsPropertyNameLiteral(node) || ast.IsKeywordKind(node.Kind) || ast.IsPrivateIdentifier(node) - }) + })) +} + +// If the given node is a declaration name node in a JSDoc comment that is subject to reparsing, return the declaration name node +// for the corresponding reparsed construct. Otherwise, just return the node. +func getReparsedNodeForNode(node *ast.Node) *ast.Node { + if node.Flags&ast.NodeFlagsJSDoc != 0 && (ast.IsIdentifier(node) || ast.IsPrivateIdentifier(node)) { + parent := node.Parent + if (ast.IsJSDocTypedefTag(parent) || ast.IsJSDocCallbackTag(parent) || ast.IsJSDocPropertyTag(parent) || ast.IsJSDocParameterTag(parent) || ast.IsImportClause(parent) || ast.IsImportSpecifier(parent)) && parent.Name() == node { + // Reparsing preserves the location of the name. Thus, a search at the position of the name with JSDoc excluded + // finds the containing reparsed declaration node. + if reparsed := ast.GetNodeAtPosition(ast.GetSourceFileOfNode(node), node.Pos(), false); reparsed != nil { + if name := reparsed.Name(); name != nil && name.Pos() == node.Pos() { + return name + } + } + } + } + return node } func GetTouchingToken(sourceFile *ast.SourceFile, position int) *ast.Node { diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 89fe743c47..ba18a4afb0 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -2368,10 +2368,11 @@ func (c *Checker) checkJSDocComment(node *ast.Node, location *ast.Node) { func (c *Checker) resolveJSDocMemberName(name *ast.Node, location *ast.Node) *ast.Symbol { if name != nil && ast.IsEntityName(name) { meaning := ast.SymbolFlagsType | ast.SymbolFlagsNamespace | ast.SymbolFlagsValue - symbol := c.resolveEntityName(name, meaning, true /*ignoreErrors*/, true /*dontResolveAlias*/, location) - if symbol == nil && ast.IsQualifiedName(name) { - symbol := c.resolveJSDocMemberName(name.AsQualifiedName().Left, location) - if symbol != nil { + if symbol := c.resolveEntityName(name, meaning, true /*ignoreErrors*/, true /*dontResolveAlias*/, location); symbol != nil { + return symbol + } + if ast.IsQualifiedName(name) { + if symbol := c.resolveJSDocMemberName(name.AsQualifiedName().Left, location); symbol != nil { var t *Type if symbol.Flags&ast.SymbolFlagsValue != 0 { proto := c.getPropertyOfType(c.getTypeOfSymbol(symbol), "prototype") @@ -30203,19 +30204,15 @@ func (c *Checker) getSymbolAtLocation(node *ast.Node, ignoreErrors bool) *ast.Sy return c.getSymbolOfDeclaration(grandParent) } - if node.Kind == ast.KindIdentifier { + if ast.IsIdentifier(node) { if isInRightSideOfImportOrExportAssignment(node) { return c.getSymbolOfNameOrPropertyAccessExpression(node) - } else if parent.Kind == ast.KindBindingElement && - grandParent.Kind == ast.KindObjectBindingPattern && - node == parent.AsBindingElement().PropertyName { + } else if ast.IsBindingElement(parent) && ast.IsObjectBindingPattern(grandParent) && node == parent.PropertyName() { typeOfPattern := c.getTypeOfNode(grandParent) - propertyDeclaration := c.getPropertyOfType(typeOfPattern, node.Text()) - - if propertyDeclaration != nil { + if propertyDeclaration := c.getPropertyOfType(typeOfPattern, node.Text()); propertyDeclaration != nil { return propertyDeclaration } - } else if ast.IsMetaProperty(parent) && parent.AsMetaProperty().Name() == node { + } else if ast.IsMetaProperty(parent) && parent.Name() == node { metaProp := parent.AsMetaProperty() if metaProp.KeywordToken == ast.KindNewKeyword && node.Text() == "target" { // `target` in `new.target` @@ -30230,6 +30227,14 @@ func (c *Checker) getSymbolAtLocation(node *ast.Node, ignoreErrors bool) *ast.Sy } // no other meta properties are valid syntax, thus no others should have symbols return nil + } else if ast.IsJSDocParameterTag(parent) && parent.Name() == node { + if fn := ast.GetNodeAtPosition(ast.GetSourceFileOfNode(node), node.Pos(), false); fn != nil && ast.IsFunctionLike(fn) { + for _, param := range fn.Parameters() { + if param.Name().Text() == node.Text() { + return c.getSymbolOfNode(param) + } + } + } } } @@ -30418,28 +30423,32 @@ func (c *Checker) getSymbolOfNameOrPropertyAccessExpression(name *ast.Node) *ast // Missing entity name. return nil } - - if name.Kind == ast.KindIdentifier { + isJSDoc := ast.IsJSDocNameReferenceContext(name) + if ast.IsIdentifier(name) { if ast.IsJsxTagName(name) && isJsxIntrinsicTagName(name) { symbol := c.getIntrinsicTagSymbol(name.Parent) return core.IfElse(symbol == c.unknownSymbol, nil, symbol) } - result := c.resolveEntityName( - name, - ast.SymbolFlagsValue, /*meaning*/ - true, /*ignoreErrors*/ - true, /*dontResolveAlias*/ - nil /*location*/) + meaning := core.IfElse(isJSDoc, ast.SymbolFlagsValue|ast.SymbolFlagsType|ast.SymbolFlagsNamespace, ast.SymbolFlagsValue) + result := c.resolveEntityName(name, meaning, true /*ignoreErrors*/, true /*dontResolveAlias*/, nil /*location*/) + if result == nil && isJSDoc { + if container := ast.FindAncestor(name, ast.IsClassOrInterfaceLike); container != nil { + symbol := c.getSymbolOfDeclaration(container) + // Handle unqualified references to class static members and class or interface instance members + if result = c.getMergedSymbol(c.getSymbol(c.getExportsOfSymbol(symbol), name.Text(), meaning)); result == nil { + result = c.getPropertyOfType(c.getDeclaredTypeOfSymbol(symbol), name.Text()) + } + } + } return result } else if ast.IsPrivateIdentifier(name) { return c.getSymbolForPrivateIdentifierExpression(name) - } else if name.Kind == ast.KindPropertyAccessExpression || name.Kind == ast.KindQualifiedName { + } else if ast.IsPropertyAccessExpression(name) || ast.IsQualifiedName(name) { links := c.symbolNodeLinks.Get(name) if links.resolvedSymbol != nil { return links.resolvedSymbol } - - if name.Kind == ast.KindPropertyAccessExpression { + if ast.IsPropertyAccessExpression(name) { c.checkPropertyAccessExpression(name, CheckModeNormal, false /*writeOnly*/) if links.resolvedSymbol == nil { links.resolvedSymbol = c.getApplicableIndexSymbol( @@ -30450,7 +30459,9 @@ func (c *Checker) getSymbolOfNameOrPropertyAccessExpression(name *ast.Node) *ast } else { c.checkQualifiedName(name, CheckModeNormal) } - + if links.resolvedSymbol == nil && isJSDoc && ast.IsQualifiedName(name) { + return c.resolveJSDocMemberName(name, nil) + } return links.resolvedSymbol } } else if ast.IsEntityName(name) && isTypeReferenceIdentifier(name) { diff --git a/internal/ls/symbols.go b/internal/ls/symbols.go index 0188f07c38..eb4726d246 100644 --- a/internal/ls/symbols.go +++ b/internal/ls/symbols.go @@ -26,9 +26,11 @@ func (l *LanguageService) ProvideDocumentSymbols(ctx context.Context, documentUR func (l *LanguageService) getDocumentSymbolsForChildren(ctx context.Context, node *ast.Node) []*lsproto.DocumentSymbol { var symbols []*lsproto.DocumentSymbol addSymbolForNode := func(node *ast.Node, children []*lsproto.DocumentSymbol) { - symbol := l.newDocumentSymbol(node, children) - if symbol != nil { - symbols = append(symbols, symbol) + if node.Flags&ast.NodeFlagsReparsed == 0 { + symbol := l.newDocumentSymbol(node, children) + if symbol != nil { + symbols = append(symbols, symbol) + } } } var visit func(*ast.Node) bool diff --git a/internal/ls/utilities.go b/internal/ls/utilities.go index 566352b0bb..a91b370bb0 100644 --- a/internal/ls/utilities.go +++ b/internal/ls/utilities.go @@ -1259,14 +1259,14 @@ func getAdjustedLocationForExportDeclaration(node *ast.ExportDeclaration, forRen func getMeaningFromLocation(node *ast.Node) ast.SemanticMeaning { // todo: check if this function needs to be changed for jsdoc updates - node = getAdjustedLocation(node, false /*forRename*/, nil) parent := node.Parent - if node.Kind == ast.KindSourceFile { + switch { + case ast.IsSourceFile(node): return ast.SemanticMeaningValue - } else if ast.NodeKindIs(node, ast.KindExportAssignment, ast.KindExportSpecifier, ast.KindExternalModuleReference, ast.KindImportSpecifier, ast.KindImportClause) || parent.Kind == ast.KindImportEqualsDeclaration && node == parent.Name() { + case ast.NodeKindIs(node, ast.KindExportAssignment, ast.KindExportSpecifier, ast.KindExternalModuleReference, ast.KindImportSpecifier, ast.KindImportClause) || parent.Kind == ast.KindImportEqualsDeclaration && node == parent.Name(): return ast.SemanticMeaningAll - } else if isInRightSideOfInternalImportEqualsDeclaration(node) { + case isInRightSideOfInternalImportEqualsDeclaration(node): // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace @@ -1278,22 +1278,20 @@ func getMeaningFromLocation(node *ast.Node) ast.SemanticMeaning { return ast.SemanticMeaningNamespace } return ast.SemanticMeaningAll - } else if ast.IsDeclarationName(node) { + case ast.IsDeclarationName(node): return getMeaningFromDeclaration(parent) - } else if ast.IsEntityName(node) && ast.FindAncestor(node, func(*ast.Node) bool { - return node.Kind == ast.KindJSDocNameReference || ast.IsJSDocLinkLike(node) || node.Kind == ast.KindJSDocMemberName - }) != nil { + case ast.IsEntityName(node) && ast.IsJSDocNameReferenceContext(node): return ast.SemanticMeaningAll - } else if isTypeReference(node) { + case isTypeReference(node): return ast.SemanticMeaningType - } else if isNamespaceReference(node) { + case isNamespaceReference(node): return ast.SemanticMeaningNamespace - } else if parent.Kind == ast.KindTypeParameter { + case ast.IsTypeParameterDeclaration(parent): return ast.SemanticMeaningType - } else if parent.Kind == ast.KindLiteralType { + case ast.IsLiteralTypeNode(parent): // This might be T["name"], which is actually referencing a property and not a type. So allow both meanings. return ast.SemanticMeaningType | ast.SemanticMeaningValue - } else { + default: return ast.SemanticMeaningValue } } diff --git a/internal/parser/jsdoc.go b/internal/parser/jsdoc.go index 875ab54f61..f3f7fd6912 100644 --- a/internal/parser/jsdoc.go +++ b/internal/parser/jsdoc.go @@ -918,7 +918,7 @@ func (p *Parser) parseTypedefTag(start int, tagName *ast.IdentifierNode, indent if childTypeTag != nil && childTypeTag.TypeExpression != nil && !isObjectOrObjectArrayTypeReference(childTypeTag.TypeExpression.Type()) { typeExpression = childTypeTag.TypeExpression } else { - typeExpression = p.finishNode(jsdocTypeLiteral, start) + typeExpression = p.finishNode(jsdocTypeLiteral, jsdocPropertyTags[0].Pos()) } } } @@ -989,7 +989,7 @@ func (p *Parser) parseCallbackTag(start int, tagName *ast.IdentifierNode, indent fullName := p.parseJSDocIdentifierName(nil) p.skipWhitespace() comment := p.parseTagComments(indent, nil) - typeExpression := p.parseJSDocSignature(start, indent) + typeExpression := p.parseJSDocSignature(p.nodePos(), indent) if comment == nil { comment = p.parseTrailingTagComments(start, p.nodePos(), indent, indentText) } diff --git a/internal/parser/reparser.go b/internal/parser/reparser.go index d33cb91024..326bbc12e3 100644 --- a/internal/parser/reparser.go +++ b/internal/parser/reparser.go @@ -191,7 +191,7 @@ func (p *Parser) reparseJSDocSignature(jsSignature *ast.Node, fun *ast.Node, jsD if jsSignature.Type() != nil && jsSignature.Type().AsJSDocReturnTag().TypeExpression != nil { signature.FunctionLikeData().Type = p.factory.DeepCloneReparse(jsSignature.Type().AsJSDocReturnTag().TypeExpression.Type()) } - loc := tag + loc := jsSignature if tag.Kind == ast.KindJSDocOverloadTag { loc = tag.AsJSDocOverloadTag().TagName } @@ -213,7 +213,7 @@ func (p *Parser) reparseJSDocTypeLiteral(t *ast.TypeNode) *ast.Node { if name.Kind == ast.KindQualifiedName { name = name.AsQualifiedName().Right } - property := p.factory.NewPropertySignatureDeclaration(nil, name, p.makeQuestionIfOptional(jsprop), nil, nil) + property := p.factory.NewPropertySignatureDeclaration(nil, p.factory.DeepCloneReparse(name), p.makeQuestionIfOptional(jsprop), nil, nil) if jsprop.TypeExpression != nil { property.AsPropertySignatureDeclaration().Type = p.reparseJSDocTypeLiteral(jsprop.TypeExpression.Type()) } diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsOverloadedFunctionParameter.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsOverloadedFunctionParameter.baseline.jsonc index 868da34a9c..358108d08d 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsOverloadedFunctionParameter.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsOverloadedFunctionParameter.baseline.jsonc @@ -1,8 +1,16 @@ // === findAllReferences === // === /foo.js === -// --- (line: 9) skipped --- -// * @param {unknown} x +// /** +// * @overload +// * @param {number} [|x|] +// * @returns {number} +// * +// * @overload +// * @param {string} [|x|] +// * @returns {string} +// * +// * @param {unknown} [|x|] // * @returns {unknown} // */ // function foo(x/*FIND ALL REFS*/[|x|]) { diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag1.baseline.jsonc index 8ea93a9256..70d070bbcd 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag1.baseline.jsonc @@ -6,17 +6,18 @@ // n = 1 // static s() { } // /** -// * {@link m} -// * @see {m} -// * {@link C.m} -// * @see {C.m} -// * {@link C#m} -// * @see {C#m} +// * {@link [|m|]} +// * @see {[|m|]} +// * {@link C.[|m|]} +// * @see {C.[|m|]} +// * {@link C#[|m|]} +// * @see {C#[|m|]} // * {@link C.prototype.[|m|]} -// * @see {C.prototype.m} +// * @see {C.prototype.[|m|]} // */ // p() { } -// // --- (line: 16) skipped --- +// /** +// // --- (line: 17) skipped --- @@ -33,15 +34,22 @@ // // --- (line: 7) skipped --- -// --- (line: 19) skipped --- -// * @see {C.n} -// * {@link C#n} -// * @see {C#n} +// --- (line: 13) skipped --- +// */ +// p() { } +// /** +// * {@link [|n|]} +// * @see {[|n|]} +// * {@link C.[|n|]} +// * @see {C.[|n|]} +// * {@link C#[|n|]} +// * @see {C#[|n|]} // * {@link C.prototype.[|n|]} -// * @see {C.prototype.n} +// * @see {C.prototype.[|n|]} // */ // q() { } -// // --- (line: 27) skipped --- +// /** +// // --- (line: 28) skipped --- @@ -59,15 +67,18 @@ // // --- (line: 8) skipped --- -// --- (line: 26) skipped --- +// --- (line: 24) skipped --- +// */ +// q() { } // /** -// * {@link s} -// * @see {s} +// * {@link [|s|]} +// * @see {[|s|]} // * {@link C.[|s|]} -// * @see {C.s} +// * @see {C.[|s|]} // */ // r() { } -// // --- (line: 34) skipped --- +// } +// // --- (line: 35) skipped --- @@ -82,8 +93,16 @@ // a/*FIND ALL REFS*/[|a|]() // b: 1 // /** -// * {@link a} -// // --- (line: 41) skipped --- +// * {@link [|a|]} +// * @see {[|a|]} +// * {@link I.[|a|]} +// * @see {I.[|a|]} +// * {@link I#[|a|]} +// * @see {I#[|a|]} +// */ +// c() +// /** +// // --- (line: 49) skipped --- @@ -102,6 +121,20 @@ // // --- (line: 42) skipped --- +// --- (line: 45) skipped --- +// */ +// c() +// /** +// * {@link [|b|]} +// * @see {[|b|]} +// * {@link I.[|b|]} +// * @see {I.[|b|]} +// */ +// d() +// } +// // --- (line: 56) skipped --- + + // === findAllReferences === @@ -113,7 +146,7 @@ // function nestor() { // /** {@link [|r2|]} */ // function ref() { } -// /** @see {r2} */ +// /** @see {[|r2|]} */ // function d3() { } // function r2/*FIND ALL REFS*/[|r2|]() { } // } @@ -132,32 +165,33 @@ // * {@link m} // * @see {m} // * {@link [|C|].m} -// * @see {C.m} +// * @see {[|C|].m} // * {@link [|C|]#m} -// * @see {C#m} +// * @see {[|C|]#m} // * {@link [|C|].prototype.m} -// * @see {C.prototype.m} +// * @see {[|C|].prototype.m} // */ // p() { } // /** // * {@link n} // * @see {n} // * {@link [|C|].n} -// * @see {C.n} +// * @see {[|C|].n} // * {@link [|C|]#n} -// * @see {C#n} +// * @see {[|C|]#n} // * {@link [|C|].prototype.n} -// * @see {C.prototype.n} +// * @see {[|C|].prototype.n} // */ // q() { } // /** // * {@link s} // * @see {s} // * {@link [|C|].s} -// * @see {C.s} +// * @see {[|C|].s} // */ // r() { } -// // --- (line: 34) skipped --- +// } +// // --- (line: 35) skipped --- @@ -173,4 +207,20 @@ // a() // b: 1 // /** -// // --- (line: 40) skipped --- +// * {@link a} +// * @see {a} +// * {@link [|I|].a} +// * @see {[|I|].a} +// * {@link [|I|]#a} +// * @see {[|I|]#a} +// */ +// c() +// /** +// * {@link b} +// * @see {b} +// * {@link [|I|].b} +// * @see {[|I|].b} +// */ +// d() +// } +// // --- (line: 56) skipped --- diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag2.baseline.jsonc index ea6869acf9..56271db213 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag2.baseline.jsonc @@ -9,8 +9,12 @@ // m/*FIND ALL REFS*/[|m|]() { } // } // /** -// * @see {Consider.prototype.m} -// // --- (line: 10) skipped --- +// * @see {Consider.prototype.[|m|]} +// * {@link Consider#[|m|]} +// * @see {Consider#This#show} +// * {@link Consider.This.show} +// * @see {NPR.Consider#This#show} +// // --- (line: 14) skipped --- @@ -25,7 +29,25 @@ // } // m() { } // } -// // --- (line: 8) skipped --- +// /** +// * @see {Consider.prototype.m} +// * {@link Consider#m} +// * @see {Consider#This#[|show|]} +// * {@link Consider.This.[|show|]} +// * @see {NPR.Consider#This#[|show|]} +// * {@link NPR.Consider.This#[|show|]} +// * @see {NPR.Consider#This.show} # doesn't parse trailing . +// * @see {NPR.Consider.This.[|show|]} +// */ +// export function ref() { } +// } +// /** +// * {@link NPR.Consider#This#[|show|] hello hello} +// * {@link NPR.Consider.This#[|show|]} +// * @see {NPR.Consider#This.show} # doesn't parse trailing . +// * @see {NPR.Consider.This.[|show|]} +// */ +// export function outerref() { } @@ -39,7 +61,26 @@ // show() { } // } // m() { } -// // --- (line: 7) skipped --- +// } +// /** +// * @see {Consider.prototype.m} +// * {@link Consider#m} +// * @see {Consider#[|This|]#show} +// * {@link Consider.[|This|].show} +// * @see {NPR.Consider#[|This|]#show} +// * {@link NPR.Consider.[|This|]#show} +// * @see {NPR.Consider#[|This|].show} # doesn't parse trailing . +// * @see {NPR.Consider.[|This|].show} +// */ +// export function ref() { } +// } +// /** +// * {@link NPR.Consider#[|This|]#show hello hello} +// * {@link NPR.Consider.[|This|]#show} +// * @see {NPR.Consider#[|This|].show} # doesn't parse trailing . +// * @see {NPR.Consider.[|This|].show} +// */ +// export function outerref() { } @@ -55,22 +96,22 @@ // m() { } // } // /** -// * @see {Consider.prototype.m} +// * @see {[|Consider|].prototype.m} // * {@link [|Consider|]#m} -// * @see {Consider#This#show} +// * @see {[|Consider|]#This#show} // * {@link [|Consider|].This.show} -// * @see {NPR.Consider#This#show} +// * @see {NPR.[|Consider|]#This#show} // * {@link NPR.[|Consider|].This#show} -// * @see {NPR.Consider#This.show} # doesn't parse trailing . -// * @see {NPR.Consider.This.show} +// * @see {NPR.[|Consider|]#This.show} # doesn't parse trailing . +// * @see {NPR.[|Consider|].This.show} // */ // export function ref() { } // } // /** // * {@link NPR.[|Consider|]#This#show hello hello} // * {@link NPR.[|Consider|].This#show} -// * @see {NPR.Consider#This.show} # doesn't parse trailing . -// * @see {NPR.Consider.This.show} +// * @see {NPR.[|Consider|]#This.show} # doesn't parse trailing . +// * @see {NPR.[|Consider|].This.show} // */ // export function outerref() { } @@ -87,20 +128,21 @@ // // --- (line: 5) skipped --- -// --- (line: 10) skipped --- +// --- (line: 9) skipped --- +// * {@link Consider#m} // * @see {Consider#This#show} // * {@link Consider.This.show} -// * @see {NPR.Consider#This#show} +// * @see {[|NPR|].Consider#This#show} // * {@link [|NPR|].Consider.This#show} -// * @see {NPR.Consider#This.show} # doesn't parse trailing . -// * @see {NPR.Consider.This.show} +// * @see {[|NPR|].Consider#This.show} # doesn't parse trailing . +// * @see {[|NPR|].Consider.This.show} // */ // export function ref() { } // } // /** // * {@link [|NPR|].Consider#This#show hello hello} // * {@link [|NPR|].Consider.This#show} -// * @see {NPR.Consider#This.show} # doesn't parse trailing . -// * @see {NPR.Consider.This.show} +// * @see {[|NPR|].Consider#This.show} # doesn't parse trailing . +// * @see {[|NPR|].Consider.This.show} // */ // export function outerref() { } diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag3.baseline.jsonc index 16b0623ff3..e233a212bc 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag3.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag3.baseline.jsonc @@ -10,10 +10,11 @@ // } // /** // * {@linkcode Consider.prototype.[|m|]} -// * {@linkplain Consider#m} +// * {@linkplain Consider#[|m|]} // * {@linkcode Consider#This#show} // * {@linkplain Consider.This.show} -// // --- (line: 13) skipped --- +// * {@linkcode NPR.Consider#This#show} +// // --- (line: 14) skipped --- @@ -28,7 +29,25 @@ // } // m() { } // } -// // --- (line: 8) skipped --- +// /** +// * {@linkcode Consider.prototype.m} +// * {@linkplain Consider#m} +// * {@linkcode Consider#This#[|show|]} +// * {@linkplain Consider.This.[|show|]} +// * {@linkcode NPR.Consider#This#[|show|]} +// * {@linkplain NPR.Consider.This#[|show|]} +// * {@linkcode NPR.Consider#This.show} # doesn't parse trailing . +// * {@linkcode NPR.Consider.This.[|show|]} +// */ +// export function ref() { } +// } +// /** +// * {@linkplain NPR.Consider#This#[|show|] hello hello} +// * {@linkplain NPR.Consider.This#[|show|]} +// * {@linkcode NPR.Consider#This.show} # doesn't parse trailing . +// * {@linkcode NPR.Consider.This.[|show|]} +// */ +// export function outerref() { } @@ -42,7 +61,26 @@ // show() { } // } // m() { } -// // --- (line: 7) skipped --- +// } +// /** +// * {@linkcode Consider.prototype.m} +// * {@linkplain Consider#m} +// * {@linkcode Consider#[|This|]#show} +// * {@linkplain Consider.[|This|].show} +// * {@linkcode NPR.Consider#[|This|]#show} +// * {@linkplain NPR.Consider.[|This|]#show} +// * {@linkcode NPR.Consider#[|This|].show} # doesn't parse trailing . +// * {@linkcode NPR.Consider.[|This|].show} +// */ +// export function ref() { } +// } +// /** +// * {@linkplain NPR.Consider#[|This|]#show hello hello} +// * {@linkplain NPR.Consider.[|This|]#show} +// * {@linkcode NPR.Consider#[|This|].show} # doesn't parse trailing . +// * {@linkcode NPR.Consider.[|This|].show} +// */ +// export function outerref() { } diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag.baseline.jsonc index 194115ed98..29b524b027 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag.baseline.jsonc @@ -2,10 +2,15 @@ // === /a.js === // /** -// * @import { A } from "./b"; +// * @import { [|A|] } from "./b"; // */ // // /** // * @param { A/*FIND ALL REFS*/[|A|] } a // */ // function f(a) {} + + +// === /b.ts === + +// export interface [|A|] { } diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag2.baseline.jsonc index a2ec533fb8..35d7ab29c6 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag2.baseline.jsonc @@ -20,7 +20,7 @@ // === /spatial-navigation.js === -// /** @import Component from './component.js' */ +// /** @import [|Component|] from './component.js' */ // // export class SpatialNavigation { // /** diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag3.baseline.jsonc index 7ad3975207..13ef64d35d 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag3.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag3.baseline.jsonc @@ -20,7 +20,7 @@ // === /spatial-navigation.js === -// /** @import { Component } from './component.js' */ +// /** @import { [|Component|] } from './component.js' */ // // export class SpatialNavigation { // /** diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag5.baseline.jsonc index a0f27113d0..430a09cf38 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag5.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag5.baseline.jsonc @@ -4,9 +4,19 @@ // export default function /*FIND ALL REFS*/[|a|]() {} +// === /b.js === + +// /** @import [|a|], * as ns from "./a" */ + + // === findAllReferences === +// === /a.js === + +// export default function [|a|]() {} + + // === /b.js === -// /** @import /*FIND ALL REFS*/a, * as ns from "./a" */ +// /** @import /*FIND ALL REFS*/[|a|], * as ns from "./a" */ diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef.baseline.jsonc index 003ada99ce..e52f205635 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef.baseline.jsonc @@ -18,12 +18,12 @@ // /** // * @typedef I {Object} -// * @prop /*FIND ALL REFS*/p {number} +// * @prop /*FIND ALL REFS*/[|p|] {number} // */ // // /** @type {I} */ // let x; -// x.p; +// x.[|p|]; @@ -31,7 +31,10 @@ // === findAllReferences === // === /a.js === -// --- (line: 4) skipped --- +// /** +// * @typedef I {Object} +// * @prop [|p|] {number} +// */ // // /** @type {I} */ // let x; diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef_importType.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef_importType.baseline.jsonc index 66ce333a8f..169acfdcee 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef_importType.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef_importType.baseline.jsonc @@ -12,10 +12,16 @@ // === /a.js === // module.exports = 0; -// /** @typedef {number} /*FIND ALL REFS*/Foo */ +// /** @typedef {number} /*FIND ALL REFS*/[|Foo|] */ // const dummy = 0; +// === /b.js === + +// /** @type {import('./a').[|Foo|]} */ +// const x = 0; + + // === findAllReferences === diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_js4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_js4.baseline.jsonc index e86a958a74..682b1894ec 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_js4.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_js4.baseline.jsonc @@ -2,8 +2,13 @@ // === /a.js === // /** -// * @callback /*FIND ALL REFS*/A +// * @callback /*FIND ALL REFS*/[|A|] // * @param {unknown} response // */ // // module.exports = {}; + + +// === /b.js === + +// /** @typedef {import("./a").[|A|]} A */ diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesSeeTagInTs.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesSeeTagInTs.baseline.jsonc index 6659580478..6fd4729385 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesSeeTagInTs.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesSeeTagInTs.baseline.jsonc @@ -4,5 +4,5 @@ // function doStuffWithStuff/*FIND ALL REFS*/[|doStuffWithStuff|](stuff: { quantity: number }) {} // // declare const stuff: { quantity: number }; -// /** @see {doStuffWithStuff} */ +// /** @see {[|doStuffWithStuff|]} */ // if (stuff.quantity) {} diff --git a/testdata/baselines/reference/fourslash/findAllRef/JsdocSatisfiesTagFindAllReferences.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/JsdocSatisfiesTagFindAllReferences.baseline.jsonc index 45bce806d2..61bb95342c 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/JsdocSatisfiesTagFindAllReferences.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/JsdocSatisfiesTagFindAllReferences.baseline.jsonc @@ -2,7 +2,7 @@ // === /a.js === // /** -// * @typedef {Object} T +// * @typedef {Object} [|T|] // * @property {number} a // */ // diff --git a/testdata/baselines/reference/fourslash/findAllRef/JsdocTypedefTagSemanticMeaning0.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/JsdocTypedefTagSemanticMeaning0.baseline.jsonc index 70be03a5cd..d632e331be 100644 --- a/testdata/baselines/reference/fourslash/findAllRef/JsdocTypedefTagSemanticMeaning0.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllRef/JsdocTypedefTagSemanticMeaning0.baseline.jsonc @@ -12,9 +12,9 @@ // === findAllReferences === // === /a.js === -// /** @typedef {number} /*FIND ALL REFS*/T */ +// /** @typedef {number} /*FIND ALL REFS*/[|T|] */ // const T = 1; -// /** @type {T} */ +// /** @type {[|T|]} */ // const n = T; @@ -45,7 +45,7 @@ // === findAllReferences === // === /a.js === -// /** @typedef {number} T */ +// /** @typedef {number} [|T|] */ // const T = 1; // /** @type {/*FIND ALL REFS*/[|T|]} */ // const n = T; diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionJsDocImportTag4.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionJsDocImportTag4.baseline.jsonc index 7aedc0dc48..c3e112a458 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionJsDocImportTag4.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionJsDocImportTag4.baseline.jsonc @@ -1,4 +1,9 @@ // === goToDefinition === +// === /b.ts === + +// export interface [|A|] { } + + // === /a.js === // /** diff --git a/testdata/baselines/reference/fourslash/goToDef/GotoDefinitionLinkTag1.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GotoDefinitionLinkTag1.baseline.jsonc index 3b16d7e996..df64d9d0da 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GotoDefinitionLinkTag1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GotoDefinitionLinkTag1.baseline.jsonc @@ -1,7 +1,11 @@ // === goToDefinition === // === /foo.ts === -// --- (line: 5) skipped --- +// interface [|Foo|] { +// foo: string +// } +// namespace NS { +// export interface Bar { // baz: Foo // } // } @@ -17,7 +21,13 @@ // === goToDefinition === // === /foo.ts === -// --- (line: 7) skipped --- +// interface Foo { +// foo: string +// } +// namespace NS { +// export interface [|Bar|] { +// baz: Foo +// } // } // /** {@link Foo} foooo*/ // const a = "" @@ -33,6 +43,13 @@ // === goToDefinition === // === /foo.ts === +// interface [|Foo|] { +// foo: string +// } +// namespace NS { +// // --- (line: 5) skipped --- + + // --- (line: 9) skipped --- // const a = "" // /** {@link NS.Bar} ns.bar*/ @@ -49,7 +66,17 @@ // === goToDefinition === // === /foo.ts === -// --- (line: 11) skipped --- +// interface Foo { +// foo: string +// } +// namespace NS { +// export interface [|Bar|] { +// baz: Foo +// } +// } +// /** {@link Foo} foooo*/ +// const a = "" +// /** {@link NS.Bar} ns.bar*/ // const b = "" // /** {@link Foo f1}*/ // const c = "" @@ -82,6 +109,13 @@ // === goToDefinition === // === /foo.ts === +// interface [|Foo|] { +// foo: string +// } +// namespace NS { +// // --- (line: 5) skipped --- + + // --- (line: 15) skipped --- // const d = "" // /** {@link d }dd*/ @@ -93,6 +127,15 @@ // === goToDefinition === +// === /foo.ts === + +// interface [|Foo|] { +// foo: string +// } +// namespace NS { +// // --- (line: 5) skipped --- + + // === /bar.ts === // /** {@link /*GO TO DEFINITION*/Foo }dd*/ diff --git a/testdata/baselines/reference/fourslash/goToDef/JsDocSee1.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/JsDocSee1.baseline.jsonc index 8f9ba90722..1fb40f844d 100644 --- a/testdata/baselines/reference/fourslash/goToDef/JsDocSee1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/JsDocSee1.baseline.jsonc @@ -1,7 +1,11 @@ // === goToDefinition === // === /jsDocSee1.ts === -// --- (line: 5) skipped --- +// interface [|Foo|] { +// foo: string +// } +// namespace NS { +// export interface Bar { // baz: Foo // } // } @@ -17,7 +21,13 @@ // === goToDefinition === // === /jsDocSee1.ts === -// --- (line: 7) skipped --- +// interface Foo { +// foo: string +// } +// namespace NS { +// export interface [|Bar|] { +// baz: Foo +// } // } // /** @see {Foo} foooo*/ // const a = "" @@ -33,6 +43,13 @@ // === goToDefinition === // === /jsDocSee1.ts === +// interface [|Foo|] { +// foo: string +// } +// namespace NS { +// // --- (line: 5) skipped --- + + // --- (line: 9) skipped --- // const a = "" // /** @see {NS.Bar} ns.bar*/ @@ -50,7 +67,17 @@ // === goToDefinition === // === /jsDocSee1.ts === -// --- (line: 11) skipped --- +// interface Foo { +// foo: string +// } +// namespace NS { +// export interface [|Bar|] { +// baz: Foo +// } +// } +// /** @see {Foo} foooo*/ +// const a = "" +// /** @see {NS.Bar} ns.bar*/ // const b = "" // /** @see Foo f1*/ // const c = "" @@ -65,9 +92,10 @@ // === goToDefinition === // === /jsDocSee1.ts === -// --- (line: 13) skipped --- +// --- (line: 12) skipped --- +// /** @see Foo f1*/ // const c = "" // /** @see NS.Bar ns.bar*/ -// const d = "" +// const [|d|] = "" // /** @see /*GO TO DEFINITION*/d dd*/ // const e = "" diff --git a/testdata/baselines/reference/fourslash/goToDef/JsDocSee2.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/JsDocSee2.baseline.jsonc index 43e83241e0..da9d0b8a69 100644 --- a/testdata/baselines/reference/fourslash/goToDef/JsDocSee2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/JsDocSee2.baseline.jsonc @@ -59,10 +59,11 @@ // === goToDefinition === // === /jsDocSee2.ts === -// --- (line: 5) skipped --- +// --- (line: 4) skipped --- +// /** @see foooo unknown reference without brace*/ // const c = "" // /** @see @bar invalid tag without brace*/ -// const d = "" +// const [|d|] = "" // /** @see {/*GO TO DEFINITION*/d@fff} partial reference */ // const e = "" // /** @see @@@@@@ total invalid tag*/ diff --git a/testdata/baselines/reference/fourslash/goToDef/JsDocSee3.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/JsDocSee3.baseline.jsonc index dc628f79be..5f19999ed3 100644 --- a/testdata/baselines/reference/fourslash/goToDef/JsDocSee3.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/JsDocSee3.baseline.jsonc @@ -1,7 +1,7 @@ // === goToDefinition === // === /jsDocSee3.ts === -// function foo (a: string) { +// function foo ([|a|]: string) { // /** // * @see {/*GO TO DEFINITION*/a} // */ diff --git a/testdata/baselines/reference/fourslash/goToDef/JsDocSee4.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/JsDocSee4.baseline.jsonc index 72a547ee1b..2f1e4985d6 100644 --- a/testdata/baselines/reference/fourslash/goToDef/JsDocSee4.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/JsDocSee4.baseline.jsonc @@ -1,7 +1,7 @@ // === goToDefinition === // === /jsDocSee4.ts === -// class A { +// class [|A|] { // foo () { } // } // declare const a: A; @@ -18,7 +18,12 @@ // === goToDefinition === // === /jsDocSee4.ts === -// --- (line: 6) skipped --- +// class A { +// foo () { } +// } +// declare const [|a|]: A; +// /** +// * @see {A#foo} // */ // const t1 = 1 // /** diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline index 9944a3a07f..f119b73655 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoForJSDocWithHttpLinks.baseline @@ -3,7 +3,10 @@ // /** @typedef {number} https://wat */ // ^ // | ---------------------------------------------------------------------- -// | No quickinfo at /*1*/. +// | ```tsx +// | type https = number +// | ``` +// | // | ---------------------------------------------------------------------- // // /** @@ -11,7 +14,10 @@ // * @property {number} https://wass // ^ // | ---------------------------------------------------------------------- -// | No quickinfo at /*2*/. +// | ```tsx +// | (property) https: number +// | ``` +// | // | ---------------------------------------------------------------------- // */ // @@ -19,7 +25,10 @@ // /** @callback http://vad */ // ^ // | ---------------------------------------------------------------------- -// | No quickinfo at /*3*/. +// | ```tsx +// | type http = () => any +// | ``` +// | // | ---------------------------------------------------------------------- // // /** @see https://hvad */ @@ -66,7 +75,12 @@ "Name": "1", "Data": {} }, - "item": null + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype https = number\n```\n" + } + } }, { "marker": { @@ -78,7 +92,12 @@ "Name": "2", "Data": {} }, - "item": null + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\n(property) https: number\n```\n" + } + } }, { "marker": { @@ -90,7 +109,12 @@ "Name": "3", "Data": {} }, - "item": null + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype http = () => any\n```\n" + } + } }, { "marker": { diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline index 12b27ff0f2..e961f604eb 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTags15.baseline @@ -5,7 +5,10 @@ // * @implements {_a.Foo} // ^ // | ---------------------------------------------------------------------- -// | No quickinfo at /*1*/. +// | ```tsx +// | type Foo = { getName: _a.Bar; } +// | ``` +// | // | ---------------------------------------------------------------------- // */ // class C1 { } @@ -14,7 +17,10 @@ // * @extends {_a.Foo} // ^ // | ---------------------------------------------------------------------- -// | No quickinfo at /*2*/. +// | ```tsx +// | type Foo = { getName: _a.Bar; } +// | ``` +// | // | ---------------------------------------------------------------------- // */ // class C2 { } @@ -23,7 +29,10 @@ // * @augments {_a.Foo} // ^ // | ---------------------------------------------------------------------- -// | No quickinfo at /*3*/. +// | ```tsx +// | type Foo = { getName: _a.Bar; } +// | ``` +// | // | ---------------------------------------------------------------------- // */ // class C3 { } @@ -38,7 +47,12 @@ "Name": "1", "Data": {} }, - "item": null + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype Foo = { getName: _a.Bar; }\n```\n" + } + } }, { "marker": { @@ -50,7 +64,12 @@ "Name": "2", "Data": {} }, - "item": null + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype Foo = { getName: _a.Bar; }\n```\n" + } + } }, { "marker": { @@ -62,6 +81,11 @@ "Name": "3", "Data": {} }, - "item": null + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype Foo = { getName: _a.Bar; }\n```\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 50bd2824be..5678302b53 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsCallback.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsCallback.baseline @@ -4,7 +4,10 @@ // * @callback cb // ^ // | ---------------------------------------------------------------------- -// | No quickinfo at /*1*/. +// | ```tsx +// | type cb = (x: string) => any +// | ``` +// | // | ---------------------------------------------------------------------- // * @param {string} x - x comment // */ @@ -33,7 +36,12 @@ "Name": "1", "Data": {} }, - "item": null + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype cb = (x: string) => any\n```\n" + } + } }, { "marker": { diff --git a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline index 6f98b6a161..b42648cf6d 100644 --- a/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline +++ b/testdata/baselines/reference/fourslash/hover/QuickInfoJsDocTagsTypedef.baseline @@ -5,7 +5,10 @@ // * @typedef {Object} Bar // ^ // | ---------------------------------------------------------------------- -// | No quickinfo at /*1*/. +// | ```tsx +// | type Bar = { baz: string; qux: string; } +// | ``` +// | // | ---------------------------------------------------------------------- // * @property {string} baz - baz comment // * @property {string} qux - qux comment @@ -37,7 +40,12 @@ "Name": "1", "Data": {} }, - "item": null + "item": { + "contents": { + "kind": "markdown", + "value": "```tsx\ntype Bar = { baz: string; qux: string; }\n```\n" + } + } }, { "marker": {