Skip to content

Commit d8c3426

Browse files
authored
Enable colorized output in tasks for clang (#9655)
1 parent ae17dab commit d8c3426

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Extension/src/LanguageServer/cppBuildTaskProvider.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,12 @@ export class CppBuildTaskProvider implements TaskProvider {
178178
const taskLabel: string = ((appendSourceToName && !compilerPathBase.startsWith(ext.configPrefix)) ?
179179
ext.configPrefix : "") + compilerPathBase + " " + localize("build_active_file", "build active file");
180180
const programName: string = util.defaultExePath();
181-
let args: string[] = isCl ? ['/Zi', '/EHsc', '/nologo', `/Fe${programName}`, '${file}'] : ['-fdiagnostics-color=always', '-g', '${file}', '-o', programName];
181+
const isClang: boolean = !isCl && compilerPathBase.toLowerCase().includes("clang");
182+
let args: string[] = isCl ?
183+
['/Zi', '/EHsc', '/nologo', `/Fe${programName}`, '${file}'] :
184+
isClang ?
185+
['-fcolor-diagnostics', '-fansi-escape-codes', '-g', '${file}', '-o', programName] :
186+
['-fdiagnostics-color=always', '-g', '${file}', '-o', programName];
182187
if (compilerArgs && compilerArgs.length > 0) {
183188
args = args.concat(compilerArgs);
184189
}

0 commit comments

Comments
 (0)