A Regex file extension that makes it way easier to edit large regex.
results line up in editor now
1 file changed, +3 -7
+3-7src/highlighter.ts
| @@ -101,18 +101,14 @@ class Highlighter { | ||
| 101 | 101 | backgroundColor: "rgba(255, 255, 255, 0.1)", |
| 102 | 102 | }); |
| 103 | 103 | |
| 104 | - let groupIndex = 1; | |
| 105 | 104 | for (const groupName in match.groups) { |
| 106 | - // output.log(`Match: ${groupName}`); | |
| 107 | - const groupStartIndex = (match as any).indices[groupIndex][0]; | |
| 108 | - const groupEndIndex = (match as any).indices[groupIndex][1]; | |
| 109 | - const start = document.positionAt(groupStartIndex); | |
| 110 | - const end = document.positionAt(groupEndIndex); | |
| 105 | + const groupIndices = (match as any).indices.groups[groupName]; | |
| 106 | + const start = document.positionAt(groupIndices[0]); | |
| 107 | + const end = document.positionAt(groupIndices[1]); | |
| 111 | 108 | this.updateOrCreateHighlightGroup( |
| 112 | 109 | groupName, |
| 113 | 110 | new vscode.Range(start, end) |
| 114 | 111 | ); |
| 115 | - groupIndex++; | |
| 116 | 112 | } |
| 117 | 113 | i++; |
| 118 | 114 | } |