mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
More tests
This commit is contained in:
parent
15ce996cf5
commit
bbd2d00b35
@ -1,13 +1,13 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface A1 { [|a|]: number };
|
||||
////interface A2 { [|a|]?: number };
|
||||
////interface A1 { [|[|{| "declarationRangeIndex": 0 |}a|]: number|] };
|
||||
////interface A2 { [|[|{| "declarationRangeIndex": 2 |}a|]?: number|] };
|
||||
////let a1: A1;
|
||||
////let a2: A2;
|
||||
////let a12 = { ...a1, ...a2 };
|
||||
////a12.[|a|];
|
||||
|
||||
const [r0, r1, r2] = test.ranges();
|
||||
const [r0Def, r0, r1Def, r1, r2] = test.ranges();
|
||||
// A1 unions with A2, so rename A1.a and a12.a
|
||||
verify.renameLocations(r0, [r0, r2]);
|
||||
// A1 unions with A2, so rename A2.a and a12.a
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
|
||||
////interface A1 { a: number };
|
||||
////interface A2 { a?: number };
|
||||
////let [|a1|]: A1;
|
||||
////let [|a2|]: A2;
|
||||
////[|let [|{| "declarationRangeIndex": 0 |}a1|]: A1;|]
|
||||
////[|let [|{| "declarationRangeIndex": 2 |}a2|]: A2;|]
|
||||
////let a12 = { ...[|a1|], ...[|a2|] };
|
||||
|
||||
const [r0, r1, r2, r3] = test.ranges();
|
||||
const [r0Def, r0, r1Def, r1, r2, r3] = test.ranges();
|
||||
verify.rangesAreRenameLocations([r0, r2]);
|
||||
verify.rangesAreRenameLocations([r1, r3]);
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class Foo {
|
||||
//// constructor(private [|privateParam|]: number) {
|
||||
//// constructor([|private [|{| "declarationRangeIndex": 0 |}privateParam|]: number|]) {
|
||||
//// let localPrivate = [|privateParam|];
|
||||
//// this.[|privateParam|] += 10;
|
||||
//// }
|
||||
//// }
|
||||
|
||||
verify.rangesAreRenameLocations();
|
||||
const [rDef, ...rest] = test.ranges();
|
||||
verify.rangesAreRenameLocations(rest);
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class Foo {
|
||||
//// constructor(public [|publicParam|]: number) {
|
||||
//// constructor([|public [|{| "declarationRangeIndex": 0 |}publicParam|]: number|]) {
|
||||
//// let publicParam = [|publicParam|];
|
||||
//// this.[|publicParam|] += 10;
|
||||
//// }
|
||||
//// }
|
||||
|
||||
verify.rangesAreRenameLocations();
|
||||
const [rDef, ...rest] = test.ranges();
|
||||
verify.rangesAreRenameLocations(rest);
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class Foo {
|
||||
//// constructor(protected [|protectedParam|]: number) {
|
||||
//// constructor([|protected [|{| "declarationRangeIndex": 0 |}protectedParam|]: number|]) {
|
||||
//// let protectedParam = [|protectedParam|];
|
||||
//// this.[|protectedParam|] += 10;
|
||||
//// }
|
||||
//// }
|
||||
|
||||
verify.rangesAreRenameLocations();
|
||||
const [rDef, ...rest] = test.ranges();
|
||||
verify.rangesAreRenameLocations(rest);
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class Foo {
|
||||
//// constructor(protected { [|protectedParam|] }) {
|
||||
//// constructor([|protected { [|{| "declarationRangeIndex": 0 |}protectedParam|] }|]) {
|
||||
//// let myProtectedParam = [|protectedParam|];
|
||||
//// }
|
||||
//// }
|
||||
|
||||
const [r0, r1] = test.ranges();
|
||||
const [r0Def, r0, r1] = test.ranges();
|
||||
verify.renameLocations([r0, r1], [{ range: r0, prefixText: "protectedParam: " }, r1]);
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class Foo {
|
||||
//// constructor(protected [ [|protectedParam|] ]) {
|
||||
//// constructor([|protected [ [|{| "declarationRangeIndex": 0 |}protectedParam|] ]|]) {
|
||||
//// let myProtectedParam = [|protectedParam|];
|
||||
//// }
|
||||
//// }
|
||||
|
||||
verify.rangesAreRenameLocations();
|
||||
const [rDef, ...rest] = test.ranges();
|
||||
verify.rangesAreRenameLocations(rest);
|
||||
|
||||
@ -2,9 +2,10 @@
|
||||
|
||||
//// class B {}
|
||||
//// function foo() {
|
||||
//// return {[|B|]: B};
|
||||
//// return {[|[|{| "declarationRangeIndex": 0 |}B|]: B|]};
|
||||
//// }
|
||||
//// class C extends (foo()).[|B|] {}
|
||||
//// class C1 extends foo().[|B|] {}
|
||||
|
||||
verify.rangesAreRenameLocations();
|
||||
const ranges = test.rangesByText();
|
||||
verify.rangesAreRenameLocations(ranges.get("B"));
|
||||
Loading…
x
Reference in New Issue
Block a user