TypeScript/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.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

44 lines
1.1 KiB
TypeScript

/// <reference path="fourslash.ts" />
//@Filename: findAllRefsOnDefinition-import.ts
////export class Test{
////
//// constructor(){
////
//// }
////
//// public /**/[|{| "isWriteAccess": true, "isDefinition": true |}start|](){
//// return this;
//// }
////
//// public stop(){
//// return this;
//// }
////}
//@Filename: findAllRefsOnDefinition.ts
////import Second = require("./findAllRefsOnDefinition-import");
////
////var second = new Second.Test()
////second.[|start|]();
////second.stop();
checkRefs();
cancellation.setCancelled();
verifyOperationIsCancelled(checkRefs);
// verify that internal state is still correct
cancellation.resetCancelled();
checkRefs();
function checkRefs() {
const ranges = test.ranges();
const [r0, r1] = ranges;
verify.referenceGroups(r0, [{ definition: "(method) Test.start(): this", ranges }]);
verify.referenceGroups(r1, [
{ definition: "(method) Second.Test.start(): Second.Test", ranges: [r0] },
{ definition: "(method) Second.Test.start(): Second.Test", ranges: [r1] }
]);
}