mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-30 21:41:46 +01:00
Replace some common index based for loops with for-of loops
Replaces many loops of the form:
```js
for (let i = 0; i < elements.length; ++i) {
const i = elements[i];
...
}
```
with:
```js
for (const element of elements) {
...
}
```
Mix of a horrible regex based find/replace and manual touch ups
This commit is contained in:
@@ -119,9 +119,7 @@ function getNextAttribute(selectionStart: vscode.Position, selectionEnd: vscode.
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < node.attributes.length; i++) {
|
||||
let attr = node.attributes[i];
|
||||
|
||||
for (const attr of node.attributes) {
|
||||
if (selectionEnd.isBefore(attr.start)) {
|
||||
// select full attr
|
||||
return new vscode.Selection(attr.start, attr.end);
|
||||
|
||||
Reference in New Issue
Block a user