TypeScript/tests/cases/fourslash/renameThis.ts
2019-06-13 12:41:21 -07:00

18 lines
465 B
TypeScript

/// <reference path='fourslash.ts'/>
////function f([|this|]) {
//// return [|this|];
////}
////this/**/;
////const _ = { [|[|{| "contextRangeIndex": 2 |}this|]: 0|] }.[|this|];
const [r0, r1, r2Def, r2, r3] = test.ranges()
verify.rangesAreRenameLocations([r0, r1]);
// Trying to rename a non-parameter 'this' should fail
goTo.marker();
verify.renameInfoFailed("You cannot rename this element.");
verify.rangesAreRenameLocations([r2, r3]);