Skip to content

Commit

Permalink
Fix issue with currently selected compiler being listed last in task …
Browse files Browse the repository at this point in the history
…list (#11299)
  • Loading branch information
Colengms authored Aug 7, 2023
1 parent ae904ec commit 4080514
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Extension/src/LanguageServer/cppBuildTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,18 @@ export class CppBuildTaskProvider implements TaskProvider {
}

// Create a build task per compiler path
let result: CppBuildTask[] = [];
// Tasks for known compiler paths
if (knownCompilerPaths) {
result = knownCompilerPaths.map<Task>(compilerPath => this.getTask(compilerPath, appendSourceToName, undefined));
}
const result: CppBuildTask[] = [];

// Task for valid user compiler path setting
if (isCompilerValid && userCompilerPath) {
result.push(this.getTask(userCompilerPath, appendSourceToName, userCompilerPathAndArgs?.allCompilerArgs));
}

// Tasks for known compiler paths
if (knownCompilerPaths) {
result.push(...knownCompilerPaths.map<Task>(compilerPath => this.getTask(compilerPath, appendSourceToName, undefined)));
}

return result;
}

Expand Down

0 comments on commit 4080514

Please sign in to comment.