diff --git a/internal/ls/definition.go b/internal/ls/definition.go index 5f0c654dba..5e765fcc0b 100644 --- a/internal/ls/definition.go +++ b/internal/ls/definition.go @@ -2,6 +2,7 @@ package ls import ( "context" + "slices" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/astnav" @@ -46,42 +47,14 @@ func (l *LanguageService) ProvideDefinition(ctx context.Context, documentURI lsp } } - if calledDeclaration := tryGetSignatureDeclaration(c, node); calledDeclaration != nil { - return l.createLocationsFromDeclarations([]*ast.Node{calledDeclaration}), nil + declarations := getDeclarationsFromLocation(c, node) + calledDeclaration := tryGetSignatureDeclaration(c, node) + if calledDeclaration != nil { + // If we can resolve a call signature, remove all function-like declarations and add that signature. + nonFunctionDeclarations := core.Filter(slices.Clip(declarations), func(node *ast.Node) bool { return !ast.IsFunctionLike(node) }) + declarations = append(nonFunctionDeclarations, calledDeclaration) } - - if ast.IsIdentifier(node) && ast.IsShorthandPropertyAssignment(node.Parent) { - return l.createLocationsFromDeclarations(c.GetResolvedSymbol(node).Declarations), nil - } - - node = getDeclarationNameForKeyword(node) - - if symbol := c.GetSymbolAtLocation(node); symbol != nil { - if symbol.Flags&ast.SymbolFlagsClass != 0 && symbol.Flags&(ast.SymbolFlagsFunction|ast.SymbolFlagsVariable) == 0 && node.Kind == ast.KindConstructorKeyword { - if constructor := symbol.Members[ast.InternalSymbolNameConstructor]; constructor != nil { - symbol = constructor - } - } - if symbol.Flags&ast.SymbolFlagsAlias != 0 { - if resolved, ok := c.ResolveAlias(symbol); ok { - symbol = resolved - } - } - if symbol.Flags&(ast.SymbolFlagsProperty|ast.SymbolFlagsMethod|ast.SymbolFlagsAccessor) != 0 && symbol.Parent != nil && symbol.Parent.Flags&ast.SymbolFlagsObjectLiteral != 0 { - if objectLiteral := core.FirstOrNil(symbol.Parent.Declarations); objectLiteral != nil { - if declarations := c.GetContextualDeclarationsForObjectLiteralElement(objectLiteral, symbol.Name); len(declarations) != 0 { - return l.createLocationsFromDeclarations(declarations), nil - } - } - } - return l.createLocationsFromDeclarations(symbol.Declarations), nil - } - - if indexInfos := c.GetIndexSignaturesAtLocation(node); len(indexInfos) != 0 { - return l.createLocationsFromDeclarations(indexInfos), nil - } - - return lsproto.LocationOrLocationsOrDefinitionLinksOrNull{}, nil + return l.createLocationsFromDeclarations(declarations), nil } func (l *LanguageService) ProvideTypeDefinition(ctx context.Context, documentURI lsproto.DocumentUri, position lsproto.Position) (lsproto.DefinitionResponse, error) { @@ -127,17 +100,14 @@ func getDeclarationNameForKeyword(node *ast.Node) *ast.Node { } func (l *LanguageService) createLocationsFromDeclarations(declarations []*ast.Node) lsproto.DefinitionResponse { - someHaveBody := core.Some(declarations, func(node *ast.Node) bool { return node.Body() != nil }) locations := make([]lsproto.Location, 0, len(declarations)) for _, decl := range declarations { - if !someHaveBody || decl.Body() != nil { - file := ast.GetSourceFileOfNode(decl) - name := core.OrElse(ast.GetNameOfDeclaration(decl), decl) - locations = append(locations, lsproto.Location{ - Uri: FileNameToDocumentURI(file.FileName()), - Range: *l.createLspRangeFromNode(name, file), - }) - } + file := ast.GetSourceFileOfNode(decl) + name := core.OrElse(ast.GetNameOfDeclaration(decl), decl) + locations = core.AppendIfUnique(locations, lsproto.Location{ + Uri: FileNameToDocumentURI(file.FileName()), + Range: *l.createLspRangeFromNode(name, file), + }) } return lsproto.LocationOrLocationsOrDefinitionLinksOrNull{Locations: &locations} } @@ -151,7 +121,38 @@ func (l *LanguageService) createLocationFromFileAndRange(file *ast.SourceFile, t } } -/** Returns a CallLikeExpression where `node` is the target being invoked. */ +func getDeclarationsFromLocation(c *checker.Checker, node *ast.Node) []*ast.Node { + if ast.IsIdentifier(node) && ast.IsShorthandPropertyAssignment(node.Parent) { + return c.GetResolvedSymbol(node).Declarations + } + node = getDeclarationNameForKeyword(node) + if symbol := c.GetSymbolAtLocation(node); symbol != nil { + if symbol.Flags&ast.SymbolFlagsClass != 0 && symbol.Flags&(ast.SymbolFlagsFunction|ast.SymbolFlagsVariable) == 0 && node.Kind == ast.KindConstructorKeyword { + if constructor := symbol.Members[ast.InternalSymbolNameConstructor]; constructor != nil { + symbol = constructor + } + } + if symbol.Flags&ast.SymbolFlagsAlias != 0 { + if resolved, ok := c.ResolveAlias(symbol); ok { + symbol = resolved + } + } + if symbol.Flags&(ast.SymbolFlagsProperty|ast.SymbolFlagsMethod|ast.SymbolFlagsAccessor) != 0 && symbol.Parent != nil && symbol.Parent.Flags&ast.SymbolFlagsObjectLiteral != 0 { + if objectLiteral := core.FirstOrNil(symbol.Parent.Declarations); objectLiteral != nil { + if declarations := c.GetContextualDeclarationsForObjectLiteralElement(objectLiteral, symbol.Name); len(declarations) != 0 { + return declarations + } + } + } + return symbol.Declarations + } + if indexInfos := c.GetIndexSignaturesAtLocation(node); len(indexInfos) != 0 { + return indexInfos + } + return nil +} + +// Returns a CallLikeExpression where `node` is the target being invoked. func getAncestorCallLikeExpression(node *ast.Node) *ast.Node { target := ast.FindAncestor(node, func(n *ast.Node) bool { return !isRightSideOfPropertyAccess(n) diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionAmbiants.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionAmbiants.baseline.jsonc index ea0354e65f..9573cc52a4 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionAmbiants.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionAmbiants.baseline.jsonc @@ -43,7 +43,7 @@ // declare var ambientVar; // declare function ambientFunction(); -// declare class ambientClass { +// declare class [|ambientClass|] { // [|constructor();|] // static method(); // public method(); diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionClassConstructors.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionClassConstructors.baseline.jsonc index c1372715fc..35175ec694 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionClassConstructors.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionClassConstructors.baseline.jsonc @@ -5,8 +5,10 @@ // [|constructor(protected readonly cArg: string) {}|] // } // -// export class Derived extends Base { -// // --- (line: 6) skipped --- +// export class [|Derived|] extends Base { +// readonly email = this.cArg.getByLabel('Email') +// readonly password = this.cArg.getByLabel('Password') +// } // === /main.ts === @@ -18,6 +20,16 @@ // === goToDefinition === +// === /defInSameFile.ts === + +// import { Base } from './definitions' +// class [|SameFile|] extends Base { +// readonly name: string = 'SameFile' +// } +// const SameFile = new /*GO TO DEFINITION*/SameFile(cArg) +// const wrapper = new Base(cArg) + + // === /definitions.ts === // export class Base { @@ -28,23 +40,13 @@ // // --- (line: 6) skipped --- -// === /defInSameFile.ts === - -// import { Base } from './definitions' -// class SameFile extends Base { -// readonly name: string = 'SameFile' -// } -// const SameFile = new /*GO TO DEFINITION*/SameFile(cArg) -// const wrapper = new Base(cArg) - - // === goToDefinition === // === /hasConstructor.ts === // import { Base } from './definitions' -// class HasConstructor extends Base { +// class [|HasConstructor|] extends Base { // [|constructor() {}|] // readonly name: string = ''; // } @@ -56,7 +58,7 @@ // === goToDefinition === // === /definitions.ts === -// export class Base { +// export class [|Base|] { // [|constructor(protected readonly cArg: string) {}|] // } // diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOfClassExpression01.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOfClassExpression01.baseline.jsonc index 645ae7f717..190d74c6c4 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOfClassExpression01.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOfClassExpression01.baseline.jsonc @@ -1,7 +1,7 @@ // === goToDefinition === // === /goToDefinitionConstructorOfClassExpression01.ts === -// var x = class C { +// var x = class [|C|] { // [|constructor() { // var other = new /*GO TO DEFINITION*/C; // }|] @@ -16,10 +16,11 @@ // === goToDefinition === // === /goToDefinitionConstructorOfClassExpression01.ts === -// --- (line: 4) skipped --- +// --- (line: 3) skipped --- +// } // } // -// var y = class C extends x { +// var y = class [|C|] extends x { // [|constructor() { // super(); // var other = new /*GO TO DEFINITION*/C; @@ -42,12 +43,12 @@ // } // // var y = class C extends x { -// // --- (line: 8) skipped --- - - -// --- (line: 11) skipped --- +// constructor() { +// super(); +// var other = new C; +// } // } -// var z = class C extends x { +// var z = class [|C|] extends x { // m() { // return new /*GO TO DEFINITION*/C; // } @@ -76,7 +77,7 @@ // === goToDefinition === // === /goToDefinitionConstructorOfClassExpression01.ts === -// var x = class C { +// var [|x|] = class C { // [|constructor() { // var other = new C; // }|] @@ -100,10 +101,11 @@ // === goToDefinition === // === /goToDefinitionConstructorOfClassExpression01.ts === -// --- (line: 4) skipped --- +// --- (line: 3) skipped --- +// } // } // -// var y = class C extends x { +// var [|y|] = class C extends x { // [|constructor() { // super(); // var other = new C; @@ -133,10 +135,17 @@ // } // // var y = class C extends x { -// // --- (line: 8) skipped --- - - -// --- (line: 18) skipped --- +// constructor() { +// super(); +// var other = new C; +// } +// } +// var [|z|] = class C extends x { +// m() { +// return new C; +// } +// } +// // var x1 = new C(); // var x2 = new x(); // var y1 = new y(); diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOfClassWhenClassIsPrecededByNamespace01.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOfClassWhenClassIsPrecededByNamespace01.baseline.jsonc index 30590ba95b..28bc8eeaff 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOfClassWhenClassIsPrecededByNamespace01.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOfClassWhenClassIsPrecededByNamespace01.baseline.jsonc @@ -1,11 +1,11 @@ // === goToDefinition === // === /goToDefinitionConstructorOfClassWhenClassIsPrecededByNamespace01.ts === -// namespace Foo { +// namespace [|Foo|] { // export var x; // } // -// class Foo { +// class [|Foo|] { // [|constructor() { // }|] // } diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOverloads.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOverloads.baseline.jsonc index 68b854b5c7..81d96484f9 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOverloads.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionConstructorOverloads.baseline.jsonc @@ -1,7 +1,7 @@ // === goToDefinition === // === /goToDefinitionConstructorOverloads.ts === -// class ConstructorOverload { +// class [|ConstructorOverload|] { // [|constructor();|] // constructor(foo: string); // constructor(foo: any) { } @@ -19,7 +19,7 @@ // === goToDefinition === // === /goToDefinitionConstructorOverloads.ts === -// class ConstructorOverload { +// class [|ConstructorOverload|] { // constructor(); // [|constructor(foo: string);|] // constructor(foo: any) { } @@ -39,8 +39,8 @@ // === /goToDefinitionConstructorOverloads.ts === // class ConstructorOverload { -// /*GO TO DEFINITION*/constructor(); -// constructor(foo: string); +// /*GO TO DEFINITION*/[|constructor();|] +// [|constructor(foo: string);|] // [|constructor(foo: any) { }|] // } // @@ -58,11 +58,11 @@ // constructor(foo: string); // constructor(foo: any) { } // } -// // --- (line: 6) skipped --- - - -// --- (line: 9) skipped --- -// class Extended extends ConstructorOverload { +// +// var constructorOverload = new ConstructorOverload(); +// var constructorOverload = new ConstructorOverload("foo"); +// +// class [|Extended|] extends ConstructorOverload { // readonly name = "extended"; // } // var extended1 = new /*GO TO DEFINITION*/Extended(); @@ -80,10 +80,10 @@ // constructor(foo: any) { } // } // -// // --- (line: 7) skipped --- - - -// --- (line: 10) skipped --- +// var constructorOverload = new ConstructorOverload(); +// var constructorOverload = new ConstructorOverload("foo"); +// +// class [|Extended|] extends ConstructorOverload { // readonly name = "extended"; // } // var extended1 = new Extended(); diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionExpandoClass2.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionExpandoClass2.baseline.jsonc index f46322f370..0f782f9eab 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionExpandoClass2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionExpandoClass2.baseline.jsonc @@ -3,7 +3,7 @@ // const Core = {} // -// Core.Test = class { +// Core.[|Test|] = class { // [|constructor() { }|] // } // diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionFunctionOverloads.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionFunctionOverloads.baseline.jsonc index af3d155e88..4c8b8dd881 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionFunctionOverloads.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionFunctionOverloads.baseline.jsonc @@ -43,8 +43,8 @@ // === goToDefinition === // === /goToDefinitionFunctionOverloads.ts === -// function /*GO TO DEFINITION*/functionOverload(value: number); -// function functionOverload(value: string); +// function /*GO TO DEFINITION*/[|functionOverload|](value: number); +// function [|functionOverload|](value: string); // function [|functionOverload|]() {} // // functionOverload(123); diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionFunctionOverloadsInClass.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionFunctionOverloadsInClass.baseline.jsonc index 3b211eaef2..4230a17f0c 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionFunctionOverloadsInClass.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionFunctionOverloadsInClass.baseline.jsonc @@ -2,8 +2,8 @@ // === /goToDefinitionFunctionOverloadsInClass.ts === // class clsInOverload { -// static fnOverload(); -// static /*GO TO DEFINITION*/fnOverload(foo: string); +// static [|fnOverload|](); +// static /*GO TO DEFINITION*/[|fnOverload|](foo: string); // static [|fnOverload|](foo: any) { } // public fnOverload(): any; // public fnOverload(foo: string); @@ -20,8 +20,8 @@ // static fnOverload(); // static fnOverload(foo: string); // static fnOverload(foo: any) { } -// public /*GO TO DEFINITION*/fnOverload(): any; -// public fnOverload(foo: string); +// public /*GO TO DEFINITION*/[|fnOverload|](): any; +// public [|fnOverload|](foo: string); // public [|fnOverload|](foo: any) { return "foo" } // // constructor() { } diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionJsxCall.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionJsxCall.baseline.jsonc index f38b328e69..494b9afbf4 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionJsxCall.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionJsxCall.baseline.jsonc @@ -5,5 +5,5 @@ // [|(props: P, context?: any): string;|] // } // -// const Thing: FC = (props) =>
; +// const [|Thing|]: FC = (props) => ; // const HelloWorld = () => *GO TO DEFINITION*/Thing />; diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionMethodOverloads.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionMethodOverloads.baseline.jsonc index 8af620f26d..6f294a944d 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionMethodOverloads.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionMethodOverloads.baseline.jsonc @@ -90,8 +90,8 @@ // === /goToDefinitionMethodOverloads.ts === // class MethodOverload { -// static /*GO TO DEFINITION*/method(); -// static method(foo: string); +// static /*GO TO DEFINITION*/[|method|](); +// static [|method|](foo: string); // static [|method|](foo?: any) { } // public method(): any; // public method(foo: string); @@ -108,8 +108,8 @@ // static method(); // static method(foo: string); // static method(foo?: any) { } -// public /*GO TO DEFINITION*/method(): any; -// public method(foo: string); +// public /*GO TO DEFINITION*/[|method|](): any; +// public [|method|](foo: string); // public [|method|](foo?: any) { return "foo" } // } // // static method diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionNewExpressionTargetNotClass.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionNewExpressionTargetNotClass.baseline.jsonc index 3dd3ee83d6..022497479b 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionNewExpressionTargetNotClass.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionNewExpressionTargetNotClass.baseline.jsonc @@ -3,7 +3,7 @@ // class C2 { // } -// let I: { +// let [|I|]: { // [|new(): C2;|] // }; // new /*GO TO DEFINITION*/I(); diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionSignatureAlias_require.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionSignatureAlias_require.baseline.jsonc index 2fc81e00e5..b25869586f 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionSignatureAlias_require.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionSignatureAlias_require.baseline.jsonc @@ -1,7 +1,7 @@ // === goToDefinition === // === /a.js === -// module.exports = function [|f|]() {} +// [|module.exports = function f() {}|][|f|]() {} // === /b.js === @@ -15,7 +15,7 @@ // === goToDefinition === // === /a.js === -// module.exports = function [|f|]() {} +// [|module.exports = function f() {}|][|f|]() {} // === /bar.ts === diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment.baseline.jsonc index d365ed3317..873fed0335 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment.baseline.jsonc @@ -2,6 +2,6 @@ // === /foo.js === // const Bar; -// const Foo = [|Bar|] = function () {} +// const [|Foo|] = [|Bar|] = function () {} // Foo.prototype.bar = function() {} // new Foo/*GO TO DEFINITION*/(); diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment1.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment1.baseline.jsonc index eaeb7c9d1e..76b6e818f8 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment1.baseline.jsonc @@ -1,6 +1,6 @@ // === goToDefinition === // === /foo.js === -// const Foo = module.[|exports|] = function () {} +// const [|Foo|] = module.[|exports|] = function () {} // Foo.prototype.bar = function() {} // new Foo/*GO TO DEFINITION*/(); diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment2.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment2.baseline.jsonc index f6ea80b922..170e6358ac 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment2.baseline.jsonc @@ -2,6 +2,6 @@ // === /foo.ts === // const Bar; -// const Foo = [|Bar|] = function () {} +// const [|Foo|] = [|Bar|] = function () {} // Foo.prototype.bar = function() {} // new Foo/*GO TO DEFINITION*/(); diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment3.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment3.baseline.jsonc index 9ac881f3e5..de3dc88da8 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment3.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinitionVariableAssignment3.baseline.jsonc @@ -1,6 +1,6 @@ // === goToDefinition === // === /foo.ts === -// const Foo = module.[|exports|] = function () {} +// const [|Foo|] = module.[|exports|] = function () {} // Foo.prototype.bar = function() {} // new Foo/*GO TO DEFINITION*/(); diff --git a/testdata/baselines/reference/fourslash/goToDef/GoToDefinition_super.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/GoToDefinition_super.baseline.jsonc index 1a170cecf7..285f2e5a82 100644 --- a/testdata/baselines/reference/fourslash/goToDef/GoToDefinition_super.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/GoToDefinition_super.baseline.jsonc @@ -5,7 +5,7 @@ // [|constructor() {}|] // x() {} // } -// class B extends A {} +// class [|B|] extends A {} // class C extends B { // constructor() { // /*GO TO DEFINITION*/super(); diff --git a/testdata/baselines/reference/fourslash/goToDef/TsxGoToDefinitionUnionElementType1.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDef/TsxGoToDefinitionUnionElementType1.baseline.jsonc index 468cf232d7..365fd3d34e 100644 --- a/testdata/baselines/reference/fourslash/goToDef/TsxGoToDefinitionUnionElementType1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/goToDef/TsxGoToDefinitionUnionElementType1.baseline.jsonc @@ -11,5 +11,5 @@ // function SFC2(prop: { x: boolean }) { // return