mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Add test for occurrences in ClassExpressions
This commit is contained in:
parent
acb9f709e4
commit
46292a2263
@ -0,0 +1,23 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////let A = class Foo {
|
||||
//// [|constructor|]();
|
||||
//// [|constructor|](x: number);
|
||||
//// [|constructor|](y: string);
|
||||
//// [|constructor|](a?: any) {
|
||||
//// }
|
||||
////}
|
||||
////
|
||||
////let B = class D {
|
||||
//// constructor(x: number) {
|
||||
//// }
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////let A = class Foo {
|
||||
//// [|private|] foo;
|
||||
//// [|private|] private;
|
||||
//// constructor([|private|] y: string, public x: string) {
|
||||
//// }
|
||||
//// [|private|] method() { }
|
||||
//// public method2() { }
|
||||
//// [|private|] static static() { }
|
||||
////}
|
||||
////
|
||||
////let B = class D {
|
||||
//// constructor(private x: number) {
|
||||
//// }
|
||||
//// private test() {}
|
||||
//// public test2() {}
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
27
tests/cases/fourslash/getOccurrencesClassExpressionPublic.ts
Normal file
27
tests/cases/fourslash/getOccurrencesClassExpressionPublic.ts
Normal file
@ -0,0 +1,27 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////let A = class Foo {
|
||||
//// [|public|] foo;
|
||||
//// [|public|] public;
|
||||
//// constructor([|public|] y: string, private x: string) {
|
||||
//// }
|
||||
//// [|public|] method() { }
|
||||
//// private method2() {}
|
||||
//// [|public|] static static() { }
|
||||
////}
|
||||
////
|
||||
////let B = class D {
|
||||
//// constructor(private x: number) {
|
||||
//// }
|
||||
//// private test() {}
|
||||
//// public test2() {}
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
29
tests/cases/fourslash/getOccurrencesClassExpressionStatic.ts
Normal file
29
tests/cases/fourslash/getOccurrencesClassExpressionStatic.ts
Normal file
@ -0,0 +1,29 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////let A = class Foo {
|
||||
//// public static foo;
|
||||
//// [|static|] a;
|
||||
//// constructor(public y: string, private x: string) {
|
||||
//// }
|
||||
//// public method() { }
|
||||
//// private method2() {}
|
||||
//// public [|static|] static() { }
|
||||
//// private [|static|] static2() { }
|
||||
////}
|
||||
////
|
||||
////let B = class D {
|
||||
//// static a;
|
||||
//// constructor(private x: number) {
|
||||
//// }
|
||||
//// private static test() {}
|
||||
//// public static test2() {}
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user