function parseOutputLines()

in lib/main.js [48:70]


function parseOutputLines(output, regex) {
    let errors = output.split('\n');
    let annotations = [];
    for (let i = 0; i < errors.length; i++) {
        let error = errors[i];
        let match = error.match(regex);
        if (match) {
            const groups = match.groups;
            if (!groups) {
                throw "No named capture groups in regex match.";
            }
            const annotation = makeAnnotation({
                filename: groups.filename,
                lineNumber: parseInt(groups.lineNumber),
                columnNumber: parseInt(groups.columnNumber),
                errorCode: groups.errorCode,
                errorDesc: groups.errorDesc,
            });
            annotations.push(annotation);
        }
    }
    return annotations;
}