diff --git a/CHANGELOG.md b/CHANGELOG.md index 2859311..ce9a22c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Bug Fixes: Improvements: - Add telemetry about how many users are hitting the dry-run warning and how many users are stopping the dry-run process due to it. [#565](https://github.com/microsoft/vscode-makefile-tools/pull/565) +- Remove preprocessed regular expressions to reduce time. [#580](https://github.com/microsoft/vscode-makefile-tools/pull/580) ## 0.8 Bug Fixes: diff --git a/src/parser.ts b/src/parser.ts index 7a74db5..cc5fa87 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -226,11 +226,12 @@ export async function preprocessDryRunOutput( // about them anyway and also there will be a correspondent line in the dryrun with these variables expanded. // Don't remove lines with $ without paranthesis, there are valid compilation lines that would be ignored otherwise. preprocessTasks.push(function (): void { - regexp = /.*\$\(.*/gm; - preprocessedDryRunOutputStr = preprocessedDryRunOutputStr.replace( - regexp, - "" - ); + preprocessedDryRunOutputStr = preprocessedDryRunOutputStr + .split("\n") + .map((e) => { + return e.indexOf("$(") >= 0 ? "" : e; + }) + .join("\n"); }); // Extract the link command