Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Extension/src/LanguageServer/cppBuildTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ class CustomBuildTaskTerminal implements Pseudoterminal {
// However, this does not apply to processes that we spawn ourselves in the Pseudoterminal, so we need to specify the
// correct environment in order to emulate the terminal behavior properly.
this.options.env = getEffectiveEnvironment();
telemetry.logLanguageServerEvent('buildUsesEnvironmentOverride');
}

const splitWriteEmitter = (lines: string | Buffer) => {
Expand Down Expand Up @@ -498,18 +499,15 @@ class CustomBuildTaskTerminal implements Pseudoterminal {

private printBuildSummary(error: string, stdout: string, stderr: string, spawnResult: number): number {
if (spawnResult !== 0) {
telemetry.logLanguageServerEvent("cppBuildTaskError");
this.writeEmitter.fire(localize("build.finished.with.error", "Build finished with error(s).") + this.endOfLine);
return -1;
}
if (error || (!stdout && stderr && stderr.includes("error")) ||
(stdout && (stdout.includes("error C") || stdout.includes("LINK : fatal error")))) { // cl.exe compiler errors
telemetry.logLanguageServerEvent("cppBuildTaskError");
this.writeEmitter.fire(localize("build.finished.with.error", "Build finished with error(s).") + this.endOfLine);
return -1;
} else if ((!stdout && stderr) || // gcc/clang
(stdout && stdout.includes("warning C"))) { // cl.exe compiler warnings
telemetry.logLanguageServerEvent("cppBuildTaskWarnings");
this.writeEmitter.fire(localize("build.finished.with.warnings", "Build finished with warning(s).") + this.endOfLine);
return 0;
} else {
Expand Down