TypeScript/tests/cases/fourslash/referenceInParameterPropertyDeclaration.ts
Andy Hanson 8515f7e2b5 Change find-all-references tests to test for groups
* Also always test for isWriteAccess and isDefinition
2017-01-31 06:59:16 -08:00

28 lines
1.1 KiB
TypeScript

/// <reference path='fourslash.ts'/>
// @Filename: file1.ts
//// class Foo {
//// constructor(private [|{| "isWriteAccess": true, "isDefinition": true, "type": "number" |}privateParam|]: number,
//// public [|{| "isWriteAccess": true, "isDefinition": true, "type": "string" |}publicParam|]: string,
//// protected [|{| "isWriteAccess": true, "isDefinition": true, "type": "boolean" |}protectedParam|]: boolean) {
////
//// let localPrivate = [|privateParam|];
//// this.[|privateParam|] += 10;
////
//// let localPublic = [|publicParam|];
//// this.[|publicParam|] += " Hello!";
////
//// let localProtected = [|protectedParam|];
//// this.[|protectedParam|] = false;
//// }
//// }
test.rangesByText().forEach((ranges, text) => {
const [r0, r1, r2] = ranges;
const type = r0.marker.data.type;
verify.referenceGroups(ranges, [
{ definition: `(property) Foo.${text}: ${type}`, ranges: [r0, r2] },
{ definition: `(parameter) ${text}: ${type}`, ranges: [r1] }
]);
});