Skip to content

Commit

Permalink
check for valid user compiler path (#6606)
Browse files Browse the repository at this point in the history
* valid user compiler path

* fix lint error
  • Loading branch information
elahehrashedi authored Dec 14, 2020
1 parent b7a0279 commit 26726df
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Extension/src/LanguageServer/cppBuildTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,12 @@ export class CppBuildTaskProvider implements TaskProvider {
if (knownCompilerPaths) {
result = knownCompilerPaths.map<Task>(compilerPath => this.getTask(compilerPath, appendSourceToName, undefined));
}
// Task for user compiler path setting
// Task for valid user compiler path setting
if (userCompilerPath) {
result.push(this.getTask(userCompilerPath, appendSourceToName, userCompilerPathAndArgs?.additionalArgs));
const isCompilerValid: boolean = await util.checkFileExists(userCompilerPath);
if (isCompilerValid) {
result.push(this.getTask(userCompilerPath, appendSourceToName, userCompilerPathAndArgs?.additionalArgs));
}
}
return result;
}
Expand Down

0 comments on commit 26726df

Please sign in to comment.