diff --git a/tests/cases/fourslash/findAllRefsOnDecorators.ts b/tests/cases/fourslash/findAllRefsOnDecorators.ts
index 95bf1072014..aa8c0e0c9d2 100644
--- a/tests/cases/fourslash/findAllRefsOnDecorators.ts
+++ b/tests/cases/fourslash/findAllRefsOnDecorators.ts
@@ -1,9 +1,9 @@
///
// @Filename: a.ts
-////function [|{| "isWriteAccess": true, "isDefinition": true |}decorator|](target) {
+////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}decorator|](target) {
//// return target;
-////}
+////}|]
////[|decorator|]();
// @Filename: b.ts
@@ -13,4 +13,4 @@
//// method() {}
////}
-verify.singleReferenceGroup("function decorator(target: any): any");
+verify.singleReferenceGroup("function decorator(target: any): any", test.rangesByText().get("decorator"));
diff --git a/tests/cases/fourslash/findAllRefsOnDefinition.ts b/tests/cases/fourslash/findAllRefsOnDefinition.ts
index 91582b92884..da7640224e2 100644
--- a/tests/cases/fourslash/findAllRefsOnDefinition.ts
+++ b/tests/cases/fourslash/findAllRefsOnDefinition.ts
@@ -7,9 +7,9 @@
////
//// }
////
-//// public [|{| "isWriteAccess": true, "isDefinition": true |}start|](){
+//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}start|](){
//// return this;
-//// }
+//// }|]
////
//// public stop(){
//// return this;
@@ -23,4 +23,4 @@
////second.[|start|]();
////second.stop();
-verify.singleReferenceGroup("(method) Test.start(): this");
+verify.singleReferenceGroup("(method) Test.start(): this", test.rangesByText().get("start"));
diff --git a/tests/cases/fourslash/findAllRefsOnDefinition2.ts b/tests/cases/fourslash/findAllRefsOnDefinition2.ts
index 9a0fd390c1e..b300213150a 100644
--- a/tests/cases/fourslash/findAllRefsOnDefinition2.ts
+++ b/tests/cases/fourslash/findAllRefsOnDefinition2.ts
@@ -3,7 +3,7 @@
//@Filename: findAllRefsOnDefinition2-import.ts
////export module Test{
////
-//// export interface [|{| "isWriteAccess": true, "isDefinition": true |}start|] { }
+//// [|export interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}start|] { }|]
////
//// export interface stop { }
////}
@@ -14,4 +14,4 @@
////var start: Second.Test.[|start|];
////var stop: Second.Test.stop;
-verify.singleReferenceGroup("interface Test.start");
+verify.singleReferenceGroup("interface Test.start", test.rangesByText().get("start"));
diff --git a/tests/cases/fourslash/findAllRefsOnImportAliases.ts b/tests/cases/fourslash/findAllRefsOnImportAliases.ts
index 17f947ffdc3..88d9bfa3f3a 100644
--- a/tests/cases/fourslash/findAllRefsOnImportAliases.ts
+++ b/tests/cases/fourslash/findAllRefsOnImportAliases.ts
@@ -1,19 +1,19 @@
///
//@Filename: a.ts
-////export class [|{| "isWriteAccess": true, "isDefinition": true |}Class|] {
-////}
+////[|export class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Class|] {
+////}|]
//@Filename: b.ts
-////import { [|{| "isWriteAccess": true, "isDefinition": true |}Class|] } from "./a";
+////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}Class|] } from "./a";|]
////
////var c = new [|Class|]();
//@Filename: c.ts
-////export { [|{| "isWriteAccess": true, "isDefinition": true |}Class|] } from "./a";
+////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}Class|] } from "./a";|]
const ranges = test.ranges();
-const [r0, r1, r2, r3] = ranges;
+const [r0Def, r0, r1Def, r1, r2, r3Def, r3] = ranges;
const classes = { definition: "class Class", ranges: [r0] };
const imports = { definition: "(alias) class Class\nimport Class", ranges: [r1, r2] };
const reExports = { definition: "(alias) class Class\nexport Class", ranges: [r3] };
diff --git a/tests/cases/fourslash/findAllRefsOnPrivateParameterProperty1.ts b/tests/cases/fourslash/findAllRefsOnPrivateParameterProperty1.ts
index df33f2888e6..d438a87717d 100644
--- a/tests/cases/fourslash/findAllRefsOnPrivateParameterProperty1.ts
+++ b/tests/cases/fourslash/findAllRefsOnPrivateParameterProperty1.ts
@@ -1,7 +1,7 @@
///
////class ABCD {
-//// constructor(private x: number, public y: number, private [|{| "isWriteAccess": true, "isDefinition": true |}z|]: number) {
+//// constructor(private x: number, public y: number, [|private [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}z|]: number|]) {
//// }
////
//// func() {
@@ -9,4 +9,4 @@
//// }
////}
-verify.singleReferenceGroup("(property) ABCD.z: number");
+verify.singleReferenceGroup("(property) ABCD.z: number", test.rangesByText().get("z"));
diff --git a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts
index 89bb40b6830..49812d2810f 100644
--- a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts
+++ b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts
@@ -1,13 +1,13 @@
///
//// class Foo {
-//// constructor(private [|{| "isWriteAccess": true, "isDefinition": true |}privateParam|]: number) {
+//// constructor([|private [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}privateParam|]: number|]) {
//// let localPrivate = [|privateParam|];
//// this.[|{| "isWriteAccess": true |}privateParam|] += 10;
//// }
//// }
-const ranges = test.ranges();
+const [rDef, ...ranges] = test.ranges();
const [r0, r1, r2] = ranges;
verify.referenceGroups(ranges, [
{ definition: "(property) Foo.privateParam: number", ranges: [r0, r2] },
diff --git a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts
index 519ca74c5c4..7ee352cfcde 100644
--- a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts
+++ b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts
@@ -1,13 +1,13 @@
///
//// class Foo {
-//// constructor(public [|{| "isWriteAccess": true, "isDefinition": true |}publicParam|]: number) {
+//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}publicParam|]: number|]) {
//// let localPublic = [|publicParam|];
//// this.[|{| "isWriteAccess": true |}publicParam|] += 10;
//// }
//// }
-const ranges = test.ranges();
+const [rDef, ...ranges] = test.ranges();
const [r0, r1, r2] = ranges;
verify.referenceGroups(ranges, [
{ definition: "(property) Foo.publicParam: number", ranges: [r0, r2] },
diff --git a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts
index 7addc2ba7a0..3d58989a0f3 100644
--- a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts
+++ b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts
@@ -1,13 +1,13 @@
///
//// class Foo {
-//// constructor(protected [|{| "isWriteAccess": true, "isDefinition": true |}protectedParam|]: number) {
+//// constructor([|protected [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}protectedParam|]: number|]) {
//// let localProtected = [|protectedParam|];
//// this.[|{| "isWriteAccess": true |}protectedParam|] += 10;
//// }
//// }
-const ranges = test.ranges();
+const [rDef, ...ranges] = test.ranges();
const [r0, r1, r2] = ranges;
verify.referenceGroups(ranges, [
{ definition: "(property) Foo.protectedParam: number", ranges: [r0, r2] },
diff --git a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration_inheritance.ts b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration_inheritance.ts
index 9d7cfd51185..e8998dbbf70 100644
--- a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration_inheritance.ts
+++ b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration_inheritance.ts
@@ -1,17 +1,17 @@
///
////class C {
-//// constructor(public [|{| "isWriteAccess": true, "isDefinition": true |}x|]: string) {
+//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|]: string|]) {
//// [|x|];
//// }
////}
////class D extends C {
-//// constructor(public [|{| "isWriteAccess": true, "isDefinition": true |}x|]: string) {
+//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}x|]: string|]) {
//// super([|x|]);
//// }
////}
-const [r0, r1, r2, r3] = test.ranges();
+const [r0Def, r0, r1, r2Def, r2, r3] = test.ranges();
verify.referenceGroups(r0, [
{ definition: "(property) C.x: string", ranges: [r0] },
{ definition: "(parameter) x: string", ranges: [r1] },
diff --git a/tests/cases/fourslash/findAllRefsPrefixSuffixPreference.ts b/tests/cases/fourslash/findAllRefsPrefixSuffixPreference.ts
index 3745eff4e5d..1d920552375 100644
--- a/tests/cases/fourslash/findAllRefsPrefixSuffixPreference.ts
+++ b/tests/cases/fourslash/findAllRefsPrefixSuffixPreference.ts
@@ -2,22 +2,22 @@
// @Filename: /file1.ts
////declare function log(s: string | number): void;
-////const [|{| "isWriteAccess": true, "isDefinition": true |}q|] = 1;
-////export { [|{| "isWriteAccess": true, "isDefinition": true |}q|] };
+////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}q|] = 1;|]
+////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}q|] };|]
////const x = {
-//// [|{| "isWriteAccess": true, "isDefinition": true |}z|]: 'value'
+//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}z|]: 'value'|]
////}
-////const { [|{| "isWriteAccess": true, "isDefinition": true |}z|] } = x;
+////[|const { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}z|] } = x;|]
////log([|z|]);
// @Filename: /file2.ts
////declare function log(s: string | number): void;
-////import { [|{| "isWriteAccess": true, "isDefinition": true |}q|] } from "./file1";
+////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 9 |}q|] } from "./file1";|]
////log([|q|] + 1);
verify.noErrors();
-const [q0, q1, z0, z1, z2, q2, q3] = test.ranges();
+const [q0Def, q0, q1Def, q1, z0Def, z0, z1Def, z1, z2, q2Def, q2, q3] = test.ranges();
const qFile1Ranges = [q0, q1];
const qFile2Ranges = [q2, q3];
const qFile1ReferenceGroup: FourSlashInterface.ReferenceGroup = {
diff --git a/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts b/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts
index d4aefb58ac3..8b8a82c169f 100644
--- a/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts
+++ b/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts
@@ -1,12 +1,12 @@
///
////interface IFoo {
-//// [|{| "isDefinition": true |}a|]: string;
+//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|]: string;|]
////}
////class C {
//// method() {
//// var x: T = {
-//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]: ""
+//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}a|]: ""|]
//// };
//// x.[|a|];
//// }
@@ -14,7 +14,7 @@
////
////
////var x: IFoo = {
-//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]: "ss"
+//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}a|]: "ss"|]
////};
-verify.singleReferenceGroup("(property) IFoo.a: string");
+verify.singleReferenceGroup("(property) IFoo.a: string", test.rangesByText().get("a"));
diff --git a/tests/cases/fourslash/findAllRefsReExportLocal.ts b/tests/cases/fourslash/findAllRefsReExportLocal.ts
index 502c7fdde46..e7601fd072b 100644
--- a/tests/cases/fourslash/findAllRefsReExportLocal.ts
+++ b/tests/cases/fourslash/findAllRefsReExportLocal.ts
@@ -3,17 +3,17 @@
// @noLib: true
// @Filename: /a.ts
-////var [|{| "isDefinition": true |}x|];
-////export { [|{| "isWriteAccess": true, "isDefinition": true |}x|] };
-////export { [|x|] as [|{| "isWriteAccess": true, "isDefinition": true |}y|] };
+////[|var [|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|];|]
+////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] };|]
+////[|export { [|{| "declarationRangeIndex": 4 |}x|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}y|] };|]
// @Filename: /b.ts
-////import { [|{| "isWriteAccess": true, "isDefinition": true |}x|], [|{| "isWriteAccess": true, "isDefinition": true |}y|] } from "./a";
+////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 7 |}x|], [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 7 |}y|] } from "./a";|]
////[|x|]; [|y|];
verify.noErrors();
-const [ax0, ax1, ax2, ay, bx0, by0, bx1, by1] = test.ranges();
+const [ax0Def, ax0, ax1Def, ax1, ax2Def, ax2, ay, bx0Def, bx0, by0, bx1, by1] = test.ranges();
const axRanges = [ax0, ax1, ax2];
const bxRanges = [bx0, bx1];
const byRanges = [by0, by1];
diff --git a/tests/cases/fourslash/findAllRefsReExportRightNameWrongSymbol.ts b/tests/cases/fourslash/findAllRefsReExportRightNameWrongSymbol.ts
index c44bdd2fffc..8649f8b3b3d 100644
--- a/tests/cases/fourslash/findAllRefsReExportRightNameWrongSymbol.ts
+++ b/tests/cases/fourslash/findAllRefsReExportRightNameWrongSymbol.ts
@@ -1,21 +1,21 @@
///
// @Filename: /a.ts
-////export const [|{| "isWriteAccess": true, "isDefinition": true |}x|] = 0;
+////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|]
// @Filename: /b.ts
-////export const [|{| "isWriteAccess": true, "isDefinition": true |}x|] = 0;
+////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] = 0;|]
//@Filename: /c.ts
-////export { [|{| "isWriteAccess": true, "isDefinition": true |}x|] } from "./b";
-////import { [|{| "isWriteAccess": true, "isDefinition": true |}x|] } from "./a";
+////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}x|] } from "./b";|]
+////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}x|] } from "./a";|]
////[|x|];
// @Filename: /d.ts
-////import { [|{| "isWriteAccess": true, "isDefinition": true |}x|] } from "./c";
+////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 9 |}x|] } from "./c";|]
verify.noErrors();
-const [a, b, cFromB, cFromA, cUse, d] = test.ranges();
+const [aDef, a, bDef, b, cFromBDef, cFromB, cFromADef, cFromA, cUse, dDef, d] = test.ranges();
const cFromARanges = [cFromA, cUse];
const aGroup = { definition: "const x: 0", ranges: [a] };
diff --git a/tests/cases/fourslash/findAllRefsReExportStar.ts b/tests/cases/fourslash/findAllRefsReExportStar.ts
index a82f91cc5b0..759ef38cabe 100644
--- a/tests/cases/fourslash/findAllRefsReExportStar.ts
+++ b/tests/cases/fourslash/findAllRefsReExportStar.ts
@@ -1,17 +1,17 @@
///
// @Filename: /a.ts
-////export function [|{| "isWriteAccess": true, "isDefinition": true |}foo|](): void {}
+////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|](): void {}|]
// @Filename: /b.ts
////export * from "./a";
// @Filename: /c.ts
-////import { [|{| "isWriteAccess": true, "isDefinition": true |}foo|] } from "./b";
+////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}foo|] } from "./b";|]
verify.noErrors();
const ranges = test.ranges();
-const [r0, r1] = ranges;
+const [r0Def, r0, r1Def, r1] = ranges;
const a = { definition: "function foo(): void", ranges: [r0] };
const c = { definition: "(alias) function foo(): void\nimport foo", ranges: [r1] };
verify.referenceGroups(r0, [a, c]);
diff --git a/tests/cases/fourslash/findAllRefsReExport_broken.ts b/tests/cases/fourslash/findAllRefsReExport_broken.ts
index 92e4fcaa57c..3e57c60bdec 100644
--- a/tests/cases/fourslash/findAllRefsReExport_broken.ts
+++ b/tests/cases/fourslash/findAllRefsReExport_broken.ts
@@ -1,6 +1,6 @@
///
// @Filename: /a.ts
-////export { [|{| "isWriteAccess": true, "isDefinition": true |}x|] };
+////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] };|]
-verify.singleReferenceGroup("export x");
+verify.singleReferenceGroup("export x", test.rangesByText().get("x"));
diff --git a/tests/cases/fourslash/findAllRefsReExport_broken2.ts b/tests/cases/fourslash/findAllRefsReExport_broken2.ts
index 1a6649465fb..bb8291403f8 100644
--- a/tests/cases/fourslash/findAllRefsReExport_broken2.ts
+++ b/tests/cases/fourslash/findAllRefsReExport_broken2.ts
@@ -1,6 +1,6 @@
///
// @Filename: /a.ts
-////export { [|{| "isWriteAccess": true, "isDefinition": true |}x|] } from "nonsense";
+////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] } from "nonsense";|]
-verify.singleReferenceGroup("export x");
+verify.singleReferenceGroup("export x", test.rangesByText().get("x"));
diff --git a/tests/cases/fourslash/findAllRefsReExports.ts b/tests/cases/fourslash/findAllRefsReExports.ts
index 89e65d5bb37..69f2cff209c 100644
--- a/tests/cases/fourslash/findAllRefsReExports.ts
+++ b/tests/cases/fourslash/findAllRefsReExports.ts
@@ -1,26 +1,36 @@
///
// @Filename: /a.ts
-////export function [|{| "isWriteAccess": true, "isDefinition": true |}foo|](): void {}
+////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|](): void {}|]
// @Filename: /b.ts
-////export { [|foo|] as [|{| "isWriteAccess": true, "isDefinition": true |}bar|] } from "./a";
+////[|export { [|{| "declarationRangeIndex": 2 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}bar|] } from "./a";|]
// @Filename: /c.ts
-////export { [|foo|] as [|{| "isWriteAccess": true, "isDefinition": true |}default|] } from "./a";
+////[|export { [|{| "declarationRangeIndex": 5 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}default|] } from "./a";|]
// @Filename: /d.ts
-////export { [|{| "isWriteAccess": true, "isDefinition": true |}default|] } from "./c";
+////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}default|] } from "./c";|]
// @Filename: /e.ts
-////import { [|{| "isWriteAccess": true, "isDefinition": true |}bar|] } from "./b";
-////import [|{| "isWriteAccess": true, "isDefinition": true |}baz|] from "./c";
-////import { [|default|] as [|{| "isWriteAccess": true, "isDefinition": true |}bang|] } from "./c";
-////import [|{| "isWriteAccess": true, "isDefinition": true |}boom|] from "./d";
+////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 10 |}bar|] } from "./b";|]
+////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 12 |}baz|] from "./c";|]
+////[|import { [|{| "declarationRangeIndex": 14 |}default|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 14 |}bang|] } from "./c";|]
+////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 17 |}boom|] from "./d";|]
////[|bar|](); [|baz|](); [|bang|](); [|boom|]();
verify.noErrors();
-const [foo0, foo1, bar0, foo2, defaultC, defaultD, bar1, baz0, defaultE, bang0, boom0, bar2, baz1, bang1, boom1] = test.ranges();
+const [
+ foo0Def, foo0,
+ foo1Def, foo1, bar0,
+ foo2Def, foo2, defaultC,
+ defaultDDef, defaultD,
+ bar1Def, bar1,
+ baz0Def, baz0,
+ defaultEDef, defaultE, bang0,
+ boom0Def, boom0,
+ bar2, baz1, bang1, boom1
+] = test.ranges();
const a = { definition: "function foo(): void", ranges: [foo0, foo1, foo2] };
const b = { definition: "(alias) function bar(): void\nexport bar", ranges: [bar0] };
const c = { definition: "(alias) function foo(): void\nexport default", ranges: [defaultC, defaultE] };
@@ -43,6 +53,7 @@ verify.referenceGroups([bang0, bang1], [eBang]);
verify.referenceGroups([boom0, boom1], [eBoom, d, a, b, eBar, c, eBaz, eBang]);
test.rangesByText().forEach((ranges, text) => {
+ if (text.indexOf("export") === 0 || text.indexOf("import") === 0) return;
switch (text) {
case "default":
for (const range of ranges) {
diff --git a/tests/cases/fourslash/findAllRefsReExports2.ts b/tests/cases/fourslash/findAllRefsReExports2.ts
index 31aa07fa29e..018bc6f6e08 100644
--- a/tests/cases/fourslash/findAllRefsReExports2.ts
+++ b/tests/cases/fourslash/findAllRefsReExports2.ts
@@ -1,13 +1,13 @@
///
// @Filename: /a.ts
-////export function [|{| "isWriteAccess": true, "isDefinition": true |}foo|](): void {}
+////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|](): void {}|]
// @Filename: /b.ts
-////import { [|foo|] as [|{| "isWriteAccess": true, "isDefinition": true |}oof|] } from "./a";
+////[|import { [|{| "declarationRangeIndex": 2 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}oof|] } from "./a";|]
verify.noErrors();
-const [r0, r1, r2] = test.ranges();
+const [r0Def, r0, r1Def, r1, r2] = test.ranges();
verify.referenceGroups(r0, [
{ definition: "function foo(): void", ranges: [r0, r1] },
{ definition: "(alias) function oof(): void\nimport oof", ranges: [r2] }
diff --git a/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts b/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts
index dff05b219be..7afa3d2ef03 100644
--- a/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts
+++ b/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts
@@ -3,17 +3,16 @@
// @noLib: true
////interface A {
-//// readonly [|{| "isDefinition": true |}x|]: number | string;
+//// [|readonly [|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|]: number | string;|]
////}
////interface B extends A {
-//// readonly [|{| "isDefinition": true |}x|]: number;
+//// [|readonly [|{| "isDefinition": true, "declarationRangeIndex": 2 |}x|]: number;|]
////}
-////const a: A = { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: 0 };
-////const b: B = { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: 0 };
+////const a: A = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}x|]: 0|] };
+////const b: B = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}x|]: 0|] };
-const ranges = test.ranges();
-const [r0, r1, r2, r3] = ranges;
-verify.referenceGroups(ranges, [
+const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3] = test.ranges();
+verify.referenceGroups([r0, r1, r2, r3], [
{ definition: "(property) A.x: string | number", ranges: [r0, r2] },
{ definition: "(property) B.x: number", ranges: [r1, r3] },
]);
diff --git a/tests/cases/fourslash/findAllRefsRenameImportWithSameName.ts b/tests/cases/fourslash/findAllRefsRenameImportWithSameName.ts
index 38c3aaf9398..b161c467d73 100644
--- a/tests/cases/fourslash/findAllRefsRenameImportWithSameName.ts
+++ b/tests/cases/fourslash/findAllRefsRenameImportWithSameName.ts
@@ -1,14 +1,14 @@
///
// @Filename: /a.ts
-////export const [|{| "isWriteAccess": true, "isDefinition": true |}x|] = 0;
+////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|]
//@Filename: /b.ts
-////import { [|x|] as [|{| "isWriteAccess": true, "isDefinition": true |}x|] } from "./a";
+////[|import { [|{| "declarationRangeIndex": 2 |}x|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] } from "./a";|]
////[|x|];
verify.noErrors();
-const [r0, r1, r2, r3] = test.ranges();
+const [r0Def, r0, r1Def, r1, r2, r3] = test.ranges();
const aRanges = [r0, r1];
const bRanges = [r2, r3];
const aGroup = { definition: "const x: 0", ranges: aRanges };
diff --git a/tests/cases/fourslash/findAllRefsRootSymbols.ts b/tests/cases/fourslash/findAllRefsRootSymbols.ts
index 18fbb8e212c..3718562cb7f 100644
--- a/tests/cases/fourslash/findAllRefsRootSymbols.ts
+++ b/tests/cases/fourslash/findAllRefsRootSymbols.ts
@@ -1,11 +1,11 @@
///
-////interface I { [|{| "isDefinition": true |}x|]: {}; }
-////interface J { [|{| "isDefinition": true |}x|]: {}; }
-////declare const o: (I | J) & { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: string };
+////interface I { [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|]: {};|] }
+////interface J { [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}x|]: {};|] }
+////declare const o: (I | J) & { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}x|]: string|] };
////o.[|x|];
-const [r0, r1, r2, r3] = test.ranges();
+const [r0Def, r0, r1Def, r1, r2Def, r2, r3] = test.ranges();
const i = { definition: "(property) I.x: {}", ranges: [r0] };
const j = { definition: "(property) J.x: {}", ranges: [r1] };
const anon = { definition: "(property) x: string", ranges: [r2] };
diff --git a/tests/cases/fourslash/findAllRefsThisKeyword.ts b/tests/cases/fourslash/findAllRefsThisKeyword.ts
index b0045e91bc1..25601011ad2 100644
--- a/tests/cases/fourslash/findAllRefsThisKeyword.ts
+++ b/tests/cases/fourslash/findAllRefsThisKeyword.ts
@@ -21,10 +21,10 @@
//// }
////}
////// These are *not* real uses of the 'this' keyword, they are identifiers.
-////const x = { [|{| "isWriteAccess": true, "isDefinition": true |}this|]: 0 }
+////const x = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 9 |}this|]: 0|] }
////x.[|this|];
-const [glob, f0, f1, g0, g1, x, y, constructor, method, propDef, propUse] = test.ranges();
+const [glob, f0, f1, g0, g1, x, y, constructor, method, propDefDef, propDef, propUse] = test.ranges();
verify.singleReferenceGroup("this: typeof globalThis", [glob]);
verify.singleReferenceGroup("(parameter) this: any", [f0, f1]);
verify.singleReferenceGroup("(parameter) this: any", [g0, g1]);
diff --git a/tests/cases/fourslash/findAllRefsTypedef.ts b/tests/cases/fourslash/findAllRefsTypedef.ts
index 2e7d8601656..3ca4e51cacd 100644
--- a/tests/cases/fourslash/findAllRefsTypedef.ts
+++ b/tests/cases/fourslash/findAllRefsTypedef.ts
@@ -5,11 +5,11 @@
// @Filename: /a.js
/////**
//// * @typedef I {Object}
-//// * @prop [|{| "isDefinition": true |}p|] {number}
-//// */
+//// * [|@prop [|{| "isDefinition": true, "declarationRangeIndex": 0 |}p|] {number}
+//// |]*/
////
/////** @type {I} */
////let x;
////x.[|p|];
-verify.singleReferenceGroup("(property) p: number");
+verify.singleReferenceGroup("(property) p: number", test.rangesByText().get("p"));
diff --git a/tests/cases/fourslash/findAllRefsTypedef_importType.ts b/tests/cases/fourslash/findAllRefsTypedef_importType.ts
index ddd0cb7c966..aad77aeb712 100644
--- a/tests/cases/fourslash/findAllRefsTypedef_importType.ts
+++ b/tests/cases/fourslash/findAllRefsTypedef_importType.ts
@@ -4,11 +4,11 @@
// @Filename: /a.js
////module.exports = 0;
-/////** @typedef {number} [|{| "isWriteAccess": true, "isDefinition": true |}Foo|] */
+/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Foo|]|] */
////const dummy = 0;
// @Filename: /b.js
/////** @type {import('./a').[|Foo|]} */
////const x = 0;
-verify.singleReferenceGroup("type Foo = number");
+verify.singleReferenceGroup("type Foo = number", test.rangesByText().get("Foo"));
diff --git a/tests/cases/fourslash/findAllRefsTypeofImport.ts b/tests/cases/fourslash/findAllRefsTypeofImport.ts
index 77bd2d51a8c..133d2275a31 100644
--- a/tests/cases/fourslash/findAllRefsTypeofImport.ts
+++ b/tests/cases/fourslash/findAllRefsTypeofImport.ts
@@ -1,8 +1,8 @@
///
// @Filename: /a.ts
-////export const [|{| "isWriteAccess": true, "isDefinition": true |}x|] = 0;
+////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|]
////declare const a: typeof import("./a");
////a.[|x|];
-verify.singleReferenceGroup("const x: 0");
+verify.singleReferenceGroup("const x: 0", test.rangesByText().get("x"));