oderwat / vscode-indent-rainbow

Extension which shows indentation with a faint rainbow colored background to make them more readable
MIT License
407 stars 55 forks source link

Code goes into infinite loop when adding `ignoreLinePatterns` #90

Closed gbrunow closed 4 years ago

gbrunow commented 4 years ago

The section of code that process the property ignoreLinePatterns never finishes.

ignoreLinePatterns.forEach(ignorePattern => {
    while (ignore = ignorePattern.exec(text)) {
        const pos = activeEditor.document.positionAt(ignore.index);
        const line = activeEditor.document.lineAt(pos).lineNumber;
        ignoreLines.push(line);
    }
});

I haven't been able to make sense of the intension there yet, so if you could quickly explain to me I can submit a fix along with the other one I'm working on - or separately if you prefer.

gbrunow commented 4 years ago

I think I understand it now, it is supposed to create an array of lines to not check for errors. Wouldn't it be better to only check the lines that do have an error agains the list of regex patterns?

gbrunow commented 4 years ago

Seems like it may have happened due to one of my changes, sorry about that. I'm starting to get a hang of what is going on.