@@ -80,25 +80,30 @@ export interface GeneratedRange {
80
80
/**
81
81
* Expressions that compute the values of the variables of this OriginalScope. The length
82
82
* of `values` matches the length of `originalScope.variables`.
83
- *
84
- * For each variable this can either be a single expression (valid for the full `GeneratedRange`),
85
- * or an array of `BindingRange`s, e.g. if computing the value requires different expressions
86
- * throughout the range or if the variable is only available in parts of the `GeneratedRange`.
87
- *
88
- * When a value uses `BindingRange[]`, then the "from" of the first `BindingRange` and the
89
- * "to" of the last `BindingRange` are equal to the GeneratedRange's "start" and "end" position
90
- * respectively.
91
- *
92
- * `undefined` denotes that the value of a variable is unavailable in the whole range.
93
- * This can happen e.g. if the variable was optimized out and can't be recomputed.
94
83
*/
95
- values : ( string | undefined | BindingRange [ ] ) [ ] ;
84
+ values : Binding [ ] ;
96
85
97
86
children : GeneratedRange [ ] ;
98
87
parent ?: GeneratedRange ;
99
88
}
100
89
101
- export interface BindingRange {
90
+ /**
91
+ * For each variable, this can either be:
92
+ *
93
+ * 1) A single expression (valid for a full `GeneratedRange`).
94
+ *
95
+ * 2) `undefined` if this variable is unavailable in the whole range. This can
96
+ * happen e.g. when the variable was optimized out and can't be recomputed.
97
+ *
98
+ * 3) A list of `SubRangeBinding`s. Used when computing the value requires different
99
+ * expressions throughout the `GeneratedRange` or if the variable is unavailable in
100
+ * parts of the `GeneratedRange`.
101
+ * The "from" of the first `SubRangeBinding` and the "to" of the last `SubRangeBinding`
102
+ * are qual to the `GeneratedRange`s "start" and "end" position respectively.
103
+ */
104
+ export type Binding = string | undefined | SubRangeBinding [ ] ;
105
+
106
+ export interface SubRangeBinding {
102
107
value ?: string ;
103
108
from : Position ;
104
109
to : Position ;
0 commit comments