Skip to content

Commit 66f30c9

Browse files
committed
PR feedback
1 parent 3ccc58c commit 66f30c9

13 files changed

+146
-248
lines changed

src/harness/fourslash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3017,7 +3017,7 @@ namespace FourSlashInterface {
30173017
public typeDefinitionCountIs(expectedCount: number) {
30183018
this.state.verifyTypeDefinitionsCount(this.negative, expectedCount);
30193019
}
3020-
3020+
30213021
public implementationCountIs(expectedCount: number) {
30223022
this.state.verifyImplementationsCount(this.negative, expectedCount);
30233023
}

src/services/services.ts

Lines changed: 64 additions & 124 deletions
Large diffs are not rendered by default.

tests/cases/fourslash/goToImplementationInterfaceMethod_00.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//// }
88
////
99
//// var bar: Foo = { [|hello: helloImpl|] };
10+
//// var baz: Foo = { [|"hello": helloImpl|] };
1011
////
1112
//// function helloImpl () {}
1213
////

tests/cases/fourslash/goToImplementationInterfaceMethod_08.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//// }
1616
////
1717
//// class SubBar extends Bar {
18-
//// hello() {}
18+
//// [|hello() {}|]
1919
//// }
2020

2121

tests/cases/fourslash/goToImplementationInterfaceMethod_09.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
////
1616
//// whatever() {
1717
//// super.he/*function_call*/llo();
18+
//// super["hel/*element_access*/lo"]();
1819
//// }
1920
//// }
2021
////
@@ -28,3 +29,6 @@
2829

2930
goTo.marker("function_call");
3031
verify.allRangesAppearInImplementationList();
32+
33+
goTo.marker("element_access");
34+
verify.allRangesAppearInImplementationList();
Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
/// <reference path='fourslash.ts'/>
22

3-
// Should handle calls on namespaces
3+
// Should not return results on namespaces and modules
44

5-
//// [|namespace Foo {
6-
//// export function hello() {}
7-
//// }|]
8-
////
9-
//// let x = Fo/*reference*/o;
5+
//// namespace Foo {
6+
//// export function hello() {}
7+
//// }
8+
////
9+
//// namespace Foo.Bar {
10+
//// export function okay() {}
11+
//// }
12+
////
13+
//// namespace Baz {
14+
//// export function sure() {}
15+
//// }
16+
////
17+
//// namespace Baz.Bar {
18+
//// export function alright() {}
19+
//// }
20+
////
21+
//// let w = Fo/*reference0*/o;
22+
//// let x = Foo.B/*reference1*/ar;
23+
//// let w = Ba/*reference2*/z;
24+
//// let x = Baz.B/*reference3*/ar;
1025

11-
goTo.marker("reference");
12-
verify.allRangesAppearInImplementationList();
26+
for (let i = 0; i < 4; i++) {
27+
goTo.marker("reference" + i);
28+
verify.implementationCountIs(0);
29+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/// <reference path='fourslash.ts'/>
22

3-
// Should handle calls on modules
3+
// Should handle property access expressions on namespaces
44

5-
//// [|module Foo {
6-
//// export function hello() {}
7-
//// }|]
5+
//// namespace Foo {
6+
//// [|export function hello() {}|]
7+
//// }
88
////
9-
//// let x = Fo/*reference*/o;
9+
//// Foo.hell/*reference*/o();
1010

1111
goTo.marker("reference");
1212
verify.allRangesAppearInImplementationList();

tests/cases/fourslash/goToImplementationNamespace_02.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Should handle property access expressions on namespaces
44

5-
//// namespace Foo {
5+
//// module Foo {
66
//// [|export function hello() {}|]
77
//// }
88
////
Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
/// <reference path='fourslash.ts'/>
22

3-
// Should handle property access expressions on namespaces
3+
// Should handle types that are members of a namespace in type references and heritage clauses
44

5-
//// module Foo {
6-
//// [|export function hello() {}|]
7-
//// }
8-
////
9-
//// Foo.hell/*reference*/o();
5+
//// namespace Foo {
6+
//// export interface Bar {
7+
//// hello(): void;
8+
//// }
9+
////
10+
//// [|class BarImpl implements Bar {
11+
//// hello() {}
12+
//// }|]
13+
//// }
14+
////
15+
//// [|class Baz implements Foo.Bar {
16+
//// hello() {}
17+
//// }|]
18+
////
19+
//// var someVar1 : Foo.Bar = [|{ hello: () => {/**1*/} }|];
20+
////
21+
//// var someVar2 = <Foo.Bar> [|{ hello: () => {/**2*/} }|];
22+
////
23+
//// function whatever(x: Foo.Ba/*reference*/r) {
24+
////
25+
//// }
1026

1127
goTo.marker("reference");
12-
verify.allRangesAppearInImplementationList();
28+
verify.allRangesAppearInImplementationList();
Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
/// <reference path='fourslash.ts'/>
22

3-
// Should handle sub-namespaces
3+
// Should handle types that are members of a module in type references and heritage clauses
44

5-
//// /*parentNamespace*/namespace Foo {
6-
//// export function hello() {}
7-
//// }
5+
//// module Foo {
6+
//// export interface Bar {
7+
//// hello(): void;
8+
//// }
89
////
9-
//// /*parentNamespace2*/namespace Foo./*childNamespace*/Bar {
10-
//// export function okay() {}
10+
//// [|class BarImpl implements Bar {
11+
//// hello() {}
12+
//// }|]
1113
//// }
1214
////
13-
//// Fo/*parentReference*/o.hello();
14-
//// Foo.Ba/*childReference*/r.okay();
15-
16-
goTo.marker("parentReference");
17-
goTo.implementation(0);
18-
verify.caretAtMarker("parentNamespace");
19-
20-
goTo.marker("parentReference");
21-
goTo.implementation(1);
22-
verify.caretAtMarker("parentNamespace2");
15+
//// [|class Baz implements Foo.Bar {
16+
//// hello() {}
17+
//// }|]
18+
////
19+
//// var someVar1 : Foo.Bar = [|{ hello: () => {/**1*/} }|];
20+
////
21+
//// var someVar2 = <Foo.Bar> [|{ hello: () => {/**2*/} }|];
22+
////
23+
//// function whatever(x: Foo.Ba/*reference*/r) {
24+
////
25+
//// }
2326

24-
goTo.marker("childReference");
25-
goTo.implementation();
26-
verify.caretAtMarker("childNamespace")
27+
goTo.marker("reference");
28+
verify.allRangesAppearInImplementationList();

0 commit comments

Comments
 (0)