diff --git a/internal/fourslash/tests/goToImplementationInterfaceObjectLiteral_test.go b/internal/fourslash/tests/goToImplementationInterfaceObjectLiteral_test.go new file mode 100644 index 00000000000..1ec86ceb43b --- /dev/null +++ b/internal/fourslash/tests/goToImplementationInterfaceObjectLiteral_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 TestGoToImplementationInterfaceObjectLiteral(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = ` +// @Filename: /file1.ts +export interface MyInterface { P: number; } + +// @Filename: /file2.ts +import { MyInterface } from "./file1"; + +const x: /*impl*/MyInterface = { P: 2 }; +` + f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content) + defer done() + f.VerifyBaselineGoToImplementation(t, "impl") +} diff --git a/internal/ls/findallreferences.go b/internal/ls/findallreferences.go index cc1e4e4273d..ef72008e220 100644 --- a/internal/ls/findallreferences.go +++ b/internal/ls/findallreferences.go @@ -1932,7 +1932,7 @@ func (state *refState) addImplementationReferences(refNode *ast.Node, addRef fun } typeHavingNode := typeNode.Parent - if typeHavingNode.Type() == typeNode && !state.seenContainingTypeReferences.AddIfAbsent(typeHavingNode) { + if typeHavingNode.Type() == typeNode && state.seenContainingTypeReferences.AddIfAbsent(typeHavingNode) { addIfImplementation := func(e *ast.Expression) { if isImplementationExpression(e) { addRef(e) diff --git a/testdata/baselines/reference/fourslash/codeLenses/codeLensInterface01.baseline.jsonc b/testdata/baselines/reference/fourslash/codeLenses/codeLensInterface01.baseline.jsonc index dc284d737a4..57a2d9f8d64 100644 --- a/testdata/baselines/reference/fourslash/codeLenses/codeLensInterface01.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/codeLenses/codeLensInterface01.baseline.jsonc @@ -127,8 +127,23 @@ // } // --- (line: 7) skipped --- +// === /objectPointable.ts === +// import { Pointable } from "./pointable"; +// +// let x = 0; +// let y = 0; +// const p: Pointable = [|{ +// getX(): number { +// return x; +// }, +// getY(): number { +// return y; +// }, +// }|]; +// + // === /pointable.ts === -// export interface /*CODELENS: 1 implementation*/Pointable { +// export interface /*CODELENS: 2 implementations*/Pointable { // getX(): number; // getY(): number; // } diff --git a/testdata/baselines/reference/fourslash/goToImplementation/goToImplementationInterfaceObjectLiteral.baseline.jsonc b/testdata/baselines/reference/fourslash/goToImplementation/goToImplementationInterfaceObjectLiteral.baseline.jsonc new file mode 100644 index 00000000000..f23c552f309 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToImplementation/goToImplementationInterfaceObjectLiteral.baseline.jsonc @@ -0,0 +1,6 @@ +// === goToImplementation === +// === /file2.ts === +// import { MyInterface } from "./file1"; +// +// const x: /*GOTO IMPL*/MyInterface = [|{ P: 2 }|]; +// \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_00.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_00.baseline.jsonc index 680afdd169a..4fd15f5c29e 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_00.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_00.baseline.jsonc @@ -6,6 +6,16 @@ // // <|interface [|Baz|] extends Foo {}|> // -// var bar: Foo = { hello: helloImpl /**0*/ }; -// var baz: Foo[] = [{ hello: helloImpl /**4*/ }]; -// --- (line: 9) skipped --- \ No newline at end of file +// var bar: Foo = [|{ hello: helloImpl /**0*/ }|]; +// var baz: Foo[] = [|[{ hello: helloImpl /**4*/ }]|]; +// +// function helloImpl () {} +// +// function whatever(x: Foo = [|{ hello() {/**1*/} }|] ) { +// } +// +// class Bar { +// x: Foo = [|{ hello() {} }|] +// +// constructor(public f: Foo = [|{ hello() {/**3*/} }|] ) {} +// } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_00.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_00.baseline.jsonc.diff deleted file mode 100644 index b0a2afd976e..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_00.baseline.jsonc.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.goToImplementationInterface_00.baseline.jsonc -+++ new.goToImplementationInterface_00.baseline.jsonc -@@= skipped -5, +5 lines =@@ - // - // <|interface [|Baz|] extends Foo {}|> - // --// var bar: Foo = [|{ hello: helloImpl /**0*/ }|]; --// var baz: Foo[] = [|[{ hello: helloImpl /**4*/ }]|]; --// --// function helloImpl () {} --// --// function whatever(x: Foo = [|{ hello() {/**1*/} }|] ) { --// } --// --// class Bar { --// x: Foo = [|{ hello() {} }|] --// --// constructor(public f: Foo = [|{ hello() {/**3*/} }|] ) {} --// } -+// var bar: Foo = { hello: helloImpl /**0*/ }; -+// var baz: Foo[] = [{ hello: helloImpl /**4*/ }]; -+// --- (line: 9) skipped --- \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_02.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_02.baseline.jsonc index 4b1b5a082d4..64a863a2df9 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_02.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_02.baseline.jsonc @@ -4,4 +4,19 @@ // // let x: number = 9; // -// --- (line: 5) skipped --- \ No newline at end of file +// function createFoo(): Foo { +// if (x === 2) { +// return [|{ +// hello() {} +// }|]; +// } +// return [|{ +// hello() {} +// }|]; +// } +// +// let createFoo2 = (): Foo => [|({hello() {}})|]; +// +// function createFooLike() { +// return { +// --- (line: 20) skipped --- \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_02.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_02.baseline.jsonc.diff deleted file mode 100644 index b3ca591c4c4..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_02.baseline.jsonc.diff +++ /dev/null @@ -1,23 +0,0 @@ ---- old.goToImplementationInterface_02.baseline.jsonc -+++ new.goToImplementationInterface_02.baseline.jsonc -@@= skipped -3, +3 lines =@@ - // - // let x: number = 9; - // --// function createFoo(): Foo { --// if (x === 2) { --// return [|{ --// hello() {} --// }|]; --// } --// return [|{ --// hello() {} --// }|]; --// } --// --// let createFoo2 = (): Foo => [|({hello() {}})|]; --// --// function createFooLike() { --// return { --// --- (line: 20) skipped --- -+// --- (line: 5) skipped --- \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_03.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_03.baseline.jsonc index c9e59690668..b54eb5b2c10 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_03.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_03.baseline.jsonc @@ -2,4 +2,4 @@ // === /goToImplementationInterface_03.ts === // interface Fo/*GOTO IMPL*/o { hello: () => void } // -// var x = { hello: () => {} }; \ No newline at end of file +// var x = [|{ hello: () => {} }|]; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_03.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_03.baseline.jsonc.diff deleted file mode 100644 index 6bb2ff72872..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_03.baseline.jsonc.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.goToImplementationInterface_03.baseline.jsonc -+++ new.goToImplementationInterface_03.baseline.jsonc -@@= skipped -1, +1 lines =@@ - // === /goToImplementationInterface_03.ts === - // interface Fo/*GOTO IMPL*/o { hello: () => void } - // --// var x = [|{ hello: () => {} }|]; -+// var x = { hello: () => {} }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_04.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_04.baseline.jsonc index d6d71254132..621214dc672 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_04.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_04.baseline.jsonc @@ -4,4 +4,13 @@ // (a: number): void // } // -// --- (line: 5) skipped --- \ No newline at end of file +// var bar: Foo = [|(a) => {/**0*/}|]; +// +// function whatever(x: Foo = [|(a) => {/**1*/}|] ) { +// } +// +// class Bar { +// x: Foo = [|(a) => {/**2*/}|] +// +// constructor(public f: Foo = [|function(a) {}|] ) {} +// } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_04.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_04.baseline.jsonc.diff deleted file mode 100644 index b905478ab2c..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_04.baseline.jsonc.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.goToImplementationInterface_04.baseline.jsonc -+++ new.goToImplementationInterface_04.baseline.jsonc -@@= skipped -3, +3 lines =@@ - // (a: number): void - // } - // --// var bar: Foo = [|(a) => {/**0*/}|]; --// --// function whatever(x: Foo = [|(a) => {/**1*/}|] ) { --// } --// --// class Bar { --// x: Foo = [|(a) => {/**2*/}|] --// --// constructor(public f: Foo = [|function(a) {}|] ) {} --// } -+// --- (line: 5) skipped --- \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_05.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_05.baseline.jsonc index 7fe292c1d84..264cf3d3b53 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_05.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_05.baseline.jsonc @@ -4,5 +4,5 @@ // (a: number): void // } // -// let bar2 = function(a) {}; +// let bar2 = [|function(a) {}|]; // \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_05.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_05.baseline.jsonc.diff deleted file mode 100644 index ce68361b833..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_05.baseline.jsonc.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.goToImplementationInterface_05.baseline.jsonc -+++ new.goToImplementationInterface_05.baseline.jsonc -@@= skipped -3, +3 lines =@@ - // (a: number): void - // } - // --// let bar2 = [|function(a) {}|]; -+// let bar2 = function(a) {}; - // \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_06.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_06.baseline.jsonc index 0ea329ee7bc..f16c0c1f9f1 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_06.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_06.baseline.jsonc @@ -4,4 +4,7 @@ // new (a: number): SomeOtherType; // } // -// --- (line: 5) skipped --- \ No newline at end of file +// interface SomeOtherType {} +// +// let x: Foo = [|class { constructor (a: number) {} }|]; +// let y = [|class { constructor (a: number) {} }|]; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_06.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_06.baseline.jsonc.diff deleted file mode 100644 index edb87072987..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_06.baseline.jsonc.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.goToImplementationInterface_06.baseline.jsonc -+++ new.goToImplementationInterface_06.baseline.jsonc -@@= skipped -3, +3 lines =@@ - // new (a: number): SomeOtherType; - // } - // --// interface SomeOtherType {} --// --// let x: Foo = [|class { constructor (a: number) {} }|]; --// let y = [|class { constructor (a: number) {} }|]; -+// --- (line: 5) skipped --- \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_07.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_07.baseline.jsonc index f61830d24fb..4247c51f8d5 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_07.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_07.baseline.jsonc @@ -4,18 +4,19 @@ // hello (): void; // } // -// --- (line: 5) skipped --- - -// --- (line: 8) skipped --- -// let x1: Foo = { hello () { /**typeReference*/ } }; -// let x2: () => Foo = (() => { hello () { /**functionType*/} }); -// let x3: Foo | Bar = { hello () { /**unionType*/} }; +// interface Bar { +// hello (): void; +// } +// +// let x1: Foo = [|{ hello () { /**typeReference*/ } }|]; +// let x2: () => Foo = [|(() => { hello () { /**functionType*/} })|]; +// let x3: Foo | Bar = [|{ hello () { /**unionType*/} }|]; // let x4: Foo & (Foo & Bar) = [|{ hello () { /**intersectionType*/} }|]; -// let x5: [Foo] = [{ hello () { /**tupleType*/} }]; -// let x6: (Foo) = { hello () { /**parenthesizedType*/} }; -// let x7: (new() => Foo) = class { hello () { /**constructorType*/} }; -// let x8: Foo[] = [{ hello () { /**arrayType*/} }]; -// let x9: { y: Foo } = { y: { hello () { /**typeLiteral*/} } }; +// let x5: [Foo] = [|[{ hello () { /**tupleType*/} }]|]; +// let x6: (Foo) = [|{ hello () { /**parenthesizedType*/} }|]; +// let x7: (new() => Foo) = [|class { hello () { /**constructorType*/} }|]; +// let x8: Foo[] = [|[{ hello () { /**arrayType*/} }]|]; +// let x9: { y: Foo } = [|{ y: { hello () { /**typeLiteral*/} } }|]; // let x10 = [|class implements Foo { hello() {} }|] // let x11 = <|class [|C|] implements Foo { hello() {} }|> // diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_07.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_07.baseline.jsonc.diff deleted file mode 100644 index b6d1464da07..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_07.baseline.jsonc.diff +++ /dev/null @@ -1,33 +0,0 @@ ---- old.goToImplementationInterface_07.baseline.jsonc -+++ new.goToImplementationInterface_07.baseline.jsonc -@@= skipped -3, +3 lines =@@ - // hello (): void; - // } - // --// interface Bar { --// hello (): void; --// } --// --// let x1: Foo = [|{ hello () { /**typeReference*/ } }|]; --// let x2: () => Foo = [|(() => { hello () { /**functionType*/} })|]; --// let x3: Foo | Bar = [|{ hello () { /**unionType*/} }|]; -+// --- (line: 5) skipped --- -+ -+// --- (line: 8) skipped --- -+// let x1: Foo = { hello () { /**typeReference*/ } }; -+// let x2: () => Foo = (() => { hello () { /**functionType*/} }); -+// let x3: Foo | Bar = { hello () { /**unionType*/} }; - // let x4: Foo & (Foo & Bar) = [|{ hello () { /**intersectionType*/} }|]; --// let x5: [Foo] = [|[{ hello () { /**tupleType*/} }]|]; --// let x6: (Foo) = [|{ hello () { /**parenthesizedType*/} }|]; --// let x7: (new() => Foo) = [|class { hello () { /**constructorType*/} }|]; --// let x8: Foo[] = [|[{ hello () { /**arrayType*/} }]|]; --// let x9: { y: Foo } = [|{ y: { hello () { /**typeLiteral*/} } }|]; -+// let x5: [Foo] = [{ hello () { /**tupleType*/} }]; -+// let x6: (Foo) = { hello () { /**parenthesizedType*/} }; -+// let x7: (new() => Foo) = class { hello () { /**constructorType*/} }; -+// let x8: Foo[] = [{ hello () { /**arrayType*/} }]; -+// let x9: { y: Foo } = { y: { hello () { /**typeLiteral*/} } }; - // let x10 = [|class implements Foo { hello() {} }|] - // let x11 = <|class [|C|] implements Foo { hello() {} }|> - // \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_09.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_09.baseline.jsonc index 86b3ad92bee..74fc7423364 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_09.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_09.baseline.jsonc @@ -1,4 +1,4 @@ // === goToImplementation === // === /ref.ts === // import { Interface } from "./def"; -// const c: I/*GOTO IMPL*/nterface = { P: 2 }; \ No newline at end of file +// const c: I/*GOTO IMPL*/nterface = [|{ P: 2 }|]; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_09.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_09.baseline.jsonc.diff deleted file mode 100644 index e7dd7931be8..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationInterface_09.baseline.jsonc.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.goToImplementationInterface_09.baseline.jsonc -+++ new.goToImplementationInterface_09.baseline.jsonc -@@= skipped -0, +0 lines =@@ - // === goToImplementation === - // === /ref.ts === - // import { Interface } from "./def"; --// const c: I/*GOTO IMPL*/nterface = [|{ P: 2 }|]; -+// const c: I/*GOTO IMPL*/nterface = { P: 2 }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_03.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_03.baseline.jsonc index 27af73fa791..016a6777bc8 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_03.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_03.baseline.jsonc @@ -14,9 +14,9 @@ // hello() {} // }|> // -// var someVar1 : Foo.Bar = { hello: () => {/**1*/} }; +// var someVar1 : Foo.Bar = [|{ hello: () => {/**1*/} }|]; // -// var someVar2 = { hello: () => {/**2*/} }; +// var someVar2 = [|{ hello: () => {/**2*/} }|]; // // function whatever(x: Foo.Ba/*GOTO IMPL*/r) { // diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_03.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_03.baseline.jsonc.diff deleted file mode 100644 index 9702bc65faa..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_03.baseline.jsonc.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.goToImplementationNamespace_03.baseline.jsonc -+++ new.goToImplementationNamespace_03.baseline.jsonc -@@= skipped -13, +13 lines =@@ - // hello() {} - // }|> - // --// var someVar1 : Foo.Bar = [|{ hello: () => {/**1*/} }|]; -+// var someVar1 : Foo.Bar = { hello: () => {/**1*/} }; - // --// var someVar2 = [|{ hello: () => {/**2*/} }|]; -+// var someVar2 = { hello: () => {/**2*/} }; - // - // function whatever(x: Foo.Ba/*GOTO IMPL*/r) { - // \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_04.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_04.baseline.jsonc index bfc22a81ac4..d51334a89e3 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_04.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_04.baseline.jsonc @@ -14,9 +14,9 @@ // hello() {} // }|> // -// var someVar1 : Foo.Bar = { hello: () => {/**1*/} }; +// var someVar1 : Foo.Bar = [|{ hello: () => {/**1*/} }|]; // -// var someVar2 = { hello: () => {/**2*/} }; +// var someVar2 = [|{ hello: () => {/**2*/} }|]; // // function whatever(x: Foo.Ba/*GOTO IMPL*/r) { // diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_04.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_04.baseline.jsonc.diff deleted file mode 100644 index 586b42874bf..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_04.baseline.jsonc.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.goToImplementationNamespace_04.baseline.jsonc -+++ new.goToImplementationNamespace_04.baseline.jsonc -@@= skipped -13, +13 lines =@@ - // hello() {} - // }|> - // --// var someVar1 : Foo.Bar = [|{ hello: () => {/**1*/} }|]; -+// var someVar1 : Foo.Bar = { hello: () => {/**1*/} }; - // --// var someVar2 = [|{ hello: () => {/**2*/} }|]; -+// var someVar2 = { hello: () => {/**2*/} }; - // - // function whatever(x: Foo.Ba/*GOTO IMPL*/r) { - // \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_06.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_06.baseline.jsonc index a9dc683f1b1..f8c0bc448ba 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_06.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_06.baseline.jsonc @@ -5,4 +5,4 @@ // }|> // // -// let x: typeof Foo = { hello() {} }; \ No newline at end of file +// let x: typeof Foo = [|{ hello() {} }|]; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_06.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_06.baseline.jsonc.diff deleted file mode 100644 index 1345b3ed6ca..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationNamespace_06.baseline.jsonc.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.goToImplementationNamespace_06.baseline.jsonc -+++ new.goToImplementationNamespace_06.baseline.jsonc -@@= skipped -4, +4 lines =@@ - // }|> - // - // --// let x: typeof Foo = [|{ hello() {} }|]; -+// let x: typeof Foo = { hello() {} }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationTypeAlias_00.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationTypeAlias_00.baseline.jsonc index 2cf8e919444..4cdd465a372 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationTypeAlias_00.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationTypeAlias_00.baseline.jsonc @@ -1,4 +1,4 @@ // === goToImplementation === // === /ref.ts === // import { TypeAlias } from "./def"; -// const c: T/*GOTO IMPL*/ypeAlias = { P: 2 }; \ No newline at end of file +// const c: T/*GOTO IMPL*/ypeAlias = [|{ P: 2 }|]; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationTypeAlias_00.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationTypeAlias_00.baseline.jsonc.diff deleted file mode 100644 index 4f15fa96cc4..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementationTypeAlias_00.baseline.jsonc.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.goToImplementationTypeAlias_00.baseline.jsonc -+++ new.goToImplementationTypeAlias_00.baseline.jsonc -@@= skipped -0, +0 lines =@@ - // === goToImplementation === - // === /ref.ts === - // import { TypeAlias } from "./def"; --// const c: T/*GOTO IMPL*/ypeAlias = [|{ P: 2 }|]; -+// const c: T/*GOTO IMPL*/ypeAlias = { P: 2 }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementation_satisfies.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementation_satisfies.baseline.jsonc index 4bda3eac648..08fce5bd41b 100644 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementation_satisfies.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementation_satisfies.baseline.jsonc @@ -4,4 +4,6 @@ // foo: string; // } // -// --- (line: 5) skipped --- \ No newline at end of file +// function f() { +// const foo = [|{ foo: '' }|] satisfies I; +// } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementation_satisfies.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementation_satisfies.baseline.jsonc.diff deleted file mode 100644 index 71e145f7547..00000000000 --- a/testdata/baselines/reference/submodule/fourslash/goToImplementation/goToImplementation_satisfies.baseline.jsonc.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.goToImplementation_satisfies.baseline.jsonc -+++ new.goToImplementation_satisfies.baseline.jsonc -@@= skipped -3, +3 lines =@@ - // foo: string; - // } - // --// function f() { --// const foo = [|{ foo: '' }|] satisfies I; --// } -+// --- (line: 5) skipped --- \ No newline at end of file