@@ -10,8 +10,9 @@ import 'strings.dart';
10
10
import 'utils.dart' ;
11
11
import 'wrap.dart' ;
12
12
13
- /// Returns a [SourceEdit] describing the change to be made on [yaml] to achieve
14
- /// the effect of setting the element at [index] to [newValue] when re-parsed.
13
+ /// Returns a [SourceEdit] describing the change to be made on [yamlEdit] to
14
+ /// achieve the effect of setting the element at [index] to [newValue] when
15
+ /// re-parsed.
15
16
SourceEdit updateInList (
16
17
YamlEditor yamlEdit, YamlList list, int index, YamlNode newValue) {
17
18
RangeError .checkValueInInterval (index, 0 , list.length - 1 );
@@ -56,8 +57,8 @@ SourceEdit updateInList(
56
57
}
57
58
}
58
59
59
- /// Returns a [SourceEdit] describing the change to be made on [yaml ] to achieve
60
- /// the effect of appending [item] to the list.
60
+ /// Returns a [SourceEdit] describing the change to be made on [yamlEdit ] to
61
+ /// achieve the effect of appending [item] to the list.
61
62
SourceEdit appendIntoList (YamlEditor yamlEdit, YamlList list, YamlNode item) {
62
63
if (list.style == CollectionStyle .FLOW ) {
63
64
return _appendToFlowList (yamlEdit, list, item);
@@ -66,8 +67,8 @@ SourceEdit appendIntoList(YamlEditor yamlEdit, YamlList list, YamlNode item) {
66
67
}
67
68
}
68
69
69
- /// Returns a [SourceEdit] describing the change to be made on [yaml ] to achieve
70
- /// the effect of inserting [item] to the list at [index] .
70
+ /// Returns a [SourceEdit] describing the change to be made on [yamlEdit ] to
71
+ /// achieve the effect of inserting [item] to the list at [index] .
71
72
SourceEdit insertInList (
72
73
YamlEditor yamlEdit, YamlList list, int index, YamlNode item) {
73
74
RangeError .checkValueInInterval (index, 0 , list.length);
@@ -85,8 +86,8 @@ SourceEdit insertInList(
85
86
}
86
87
}
87
88
88
- /// Returns a [SourceEdit] describing the change to be made on [yaml ] to achieve
89
- /// the effect of removing the element at [index] when re-parsed.
89
+ /// Returns a [SourceEdit] describing the change to be made on [yamlEdit ] to
90
+ /// achieve the effect of removing the element at [index] when re-parsed.
90
91
SourceEdit removeInList (YamlEditor yamlEdit, YamlList list, int index) {
91
92
final nodeToRemove = list.nodes[index];
92
93
@@ -97,17 +98,18 @@ SourceEdit removeInList(YamlEditor yamlEdit, YamlList list, int index) {
97
98
}
98
99
}
99
100
100
- /// Returns a [SourceEdit] describing the change to be made on [yaml] to achieve
101
- /// the effect of addition [item] into [nodes] , noting that this is a flow list.
101
+ /// Returns a [SourceEdit] describing the change to be made on [yamlEdit] to
102
+ /// achieve the effect of addition [item] into [list] , noting that this is a
103
+ /// flow list.
102
104
SourceEdit _appendToFlowList (
103
105
YamlEditor yamlEdit, YamlList list, YamlNode item) {
104
106
final valueString = _formatNewFlow (list, item, true );
105
107
return SourceEdit (list.span.end.offset - 1 , 0 , valueString);
106
108
}
107
109
108
- /// Returns a [SourceEdit] describing the change to be made on [yaml ] to achieve
109
- /// the effect of addition [item] into [nodes ] , noting that this is a block
110
- /// list.
110
+ /// Returns a [SourceEdit] describing the change to be made on [yamlEdit ] to
111
+ /// achieve the effect of addition [item] into [list ] , noting that this is a
112
+ /// block list.
111
113
SourceEdit _appendToBlockList (
112
114
YamlEditor yamlEdit, YamlList list, YamlNode item) {
113
115
var formattedValue = _formatNewBlock (yamlEdit, list, item);
@@ -159,11 +161,11 @@ String _formatNewFlow(YamlList list, YamlNode item, [bool isLast = false]) {
159
161
return valueString;
160
162
}
161
163
162
- /// Returns a [SourceEdit] describing the change to be made on [yaml ] to achieve
163
- /// the effect of inserting [item] into [nodes ] at [index] , noting that this is
164
- /// a block list.
164
+ /// Returns a [SourceEdit] describing the change to be made on [yamlEdit ] to
165
+ /// achieve the effect of inserting [item] into [list ] at [index] , noting that
166
+ /// this is a block list.
165
167
///
166
- /// [index] should be non-negative and less than or equal to [ length] .
168
+ /// [index] should be non-negative and less than or equal to `list. length` .
167
169
SourceEdit _insertInBlockList (
168
170
YamlEditor yamlEdit, YamlList list, int index, YamlNode item) {
169
171
RangeError .checkValueInInterval (index, 0 , list.length);
@@ -180,11 +182,11 @@ SourceEdit _insertInBlockList(
180
182
return SourceEdit (start, 0 , formattedValue);
181
183
}
182
184
183
- /// Returns a [SourceEdit] describing the change to be made on [yaml ] to achieve
184
- /// the effect of inserting [item] into [nodes ] at [index] , noting that this is
185
- /// a flow list.
185
+ /// Returns a [SourceEdit] describing the change to be made on [yamlEdit ] to
186
+ /// achieve the effect of inserting [item] into [list ] at [index] , noting that
187
+ /// this is a flow list.
186
188
///
187
- /// [index] should be non-negative and less than or equal to [ length] .
189
+ /// [index] should be non-negative and less than or equal to `list. length` .
188
190
SourceEdit _insertInFlowList (
189
191
YamlEditor yamlEdit, YamlList list, int index, YamlNode item) {
190
192
RangeError .checkValueInInterval (index, 0 , list.length);
@@ -202,11 +204,11 @@ SourceEdit _insertInFlowList(
202
204
return SourceEdit (start, 0 , formattedValue);
203
205
}
204
206
205
- /// Returns a [SourceEdit] describing the change to be made on [yaml ] to achieve
206
- /// the effect of removing [nodeToRemove] from [nodes ] , noting that this is a
207
- /// block list.
207
+ /// Returns a [SourceEdit] describing the change to be made on [yamlEdit ] to
208
+ /// achieve the effect of removing [nodeToRemove] from [list ] , noting that this
209
+ /// is a block list.
208
210
///
209
- /// [index] should be non-negative and less than or equal to [ length] .
211
+ /// [index] should be non-negative and less than or equal to `list. length` .
210
212
SourceEdit _removeFromBlockList (
211
213
YamlEditor yamlEdit, YamlList list, YamlNode nodeToRemove, int index) {
212
214
RangeError .checkValueInInterval (index, 0 , list.length - 1 );
@@ -277,11 +279,11 @@ SourceEdit _removeFromBlockList(
277
279
return SourceEdit (start, end - start, '' );
278
280
}
279
281
280
- /// Returns a [SourceEdit] describing the change to be made on [yaml ] to achieve
281
- /// the effect of removing [nodeToRemove] from [nodes ] , noting that this is a
282
- /// flow list.
282
+ /// Returns a [SourceEdit] describing the change to be made on [yamlEdit ] to
283
+ /// achieve the effect of removing [nodeToRemove] from [list ] , noting that this
284
+ /// is a flow list.
283
285
///
284
- /// [index] should be non-negative and less than or equal to [ length] .
286
+ /// [index] should be non-negative and less than or equal to `list. length` .
285
287
SourceEdit _removeFromFlowList (
286
288
YamlEditor yamlEdit, YamlList list, YamlNode nodeToRemove, int index) {
287
289
RangeError .checkValueInInterval (index, 0 , list.length - 1 );
0 commit comments