Skip to content

Commit 46292a2

Browse files
committed
Add test for occurrences in ClassExpressions
1 parent acb9f70 commit 46292a2

File tree

4 files changed

+106
-0
lines changed

4 files changed

+106
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////let A = class Foo {
4+
//// [|constructor|]();
5+
//// [|constructor|](x: number);
6+
//// [|constructor|](y: string);
7+
//// [|constructor|](a?: any) {
8+
//// }
9+
////}
10+
////
11+
////let B = class D {
12+
//// constructor(x: number) {
13+
//// }
14+
////}
15+
16+
const ranges = test.ranges();
17+
for (let r of ranges) {
18+
goTo.position(r.start);
19+
20+
for (let range of ranges) {
21+
verify.occurrencesAtPositionContains(range, false);
22+
}
23+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////let A = class Foo {
4+
//// [|private|] foo;
5+
//// [|private|] private;
6+
//// constructor([|private|] y: string, public x: string) {
7+
//// }
8+
//// [|private|] method() { }
9+
//// public method2() { }
10+
//// [|private|] static static() { }
11+
////}
12+
////
13+
////let B = class D {
14+
//// constructor(private x: number) {
15+
//// }
16+
//// private test() {}
17+
//// public test2() {}
18+
////}
19+
20+
const ranges = test.ranges();
21+
for (let r of ranges) {
22+
goTo.position(r.start);
23+
24+
for (let range of ranges) {
25+
verify.occurrencesAtPositionContains(range, false);
26+
}
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////let A = class Foo {
4+
//// [|public|] foo;
5+
//// [|public|] public;
6+
//// constructor([|public|] y: string, private x: string) {
7+
//// }
8+
//// [|public|] method() { }
9+
//// private method2() {}
10+
//// [|public|] static static() { }
11+
////}
12+
////
13+
////let B = class D {
14+
//// constructor(private x: number) {
15+
//// }
16+
//// private test() {}
17+
//// public test2() {}
18+
////}
19+
20+
const ranges = test.ranges();
21+
for (let r of ranges) {
22+
goTo.position(r.start);
23+
24+
for (let range of ranges) {
25+
verify.occurrencesAtPositionContains(range, false);
26+
}
27+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////let A = class Foo {
4+
//// public static foo;
5+
//// [|static|] a;
6+
//// constructor(public y: string, private x: string) {
7+
//// }
8+
//// public method() { }
9+
//// private method2() {}
10+
//// public [|static|] static() { }
11+
//// private [|static|] static2() { }
12+
////}
13+
////
14+
////let B = class D {
15+
//// static a;
16+
//// constructor(private x: number) {
17+
//// }
18+
//// private static test() {}
19+
//// public static test2() {}
20+
////}
21+
22+
const ranges = test.ranges();
23+
for (let r of ranges) {
24+
goTo.position(r.start);
25+
26+
for (let range of ranges) {
27+
verify.occurrencesAtPositionContains(range, false);
28+
}
29+
}

0 commit comments

Comments
 (0)