Skip to content

Commit 26726df

Browse files
author
Elaheh Rashedi
authored
check for valid user compiler path (#6606)
* valid user compiler path * fix lint error
1 parent b7a0279 commit 26726df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Extension/src/LanguageServer/cppBuildTaskProvider.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,12 @@ export class CppBuildTaskProvider implements TaskProvider {
142142
if (knownCompilerPaths) {
143143
result = knownCompilerPaths.map<Task>(compilerPath => this.getTask(compilerPath, appendSourceToName, undefined));
144144
}
145-
// Task for user compiler path setting
145+
// Task for valid user compiler path setting
146146
if (userCompilerPath) {
147-
result.push(this.getTask(userCompilerPath, appendSourceToName, userCompilerPathAndArgs?.additionalArgs));
147+
const isCompilerValid: boolean = await util.checkFileExists(userCompilerPath);
148+
if (isCompilerValid) {
149+
result.push(this.getTask(userCompilerPath, appendSourceToName, userCompilerPathAndArgs?.additionalArgs));
150+
}
148151
}
149152
return result;
150153
}

0 commit comments

Comments
 (0)