Skip to content

Commit 4080514

Browse files
authored
Fix issue with currently selected compiler being listed last in task list (#11299)
1 parent ae904ec commit 4080514

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Extension/src/LanguageServer/cppBuildTaskProvider.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,18 @@ export class CppBuildTaskProvider implements TaskProvider {
148148
}
149149

150150
// Create a build task per compiler path
151-
let result: CppBuildTask[] = [];
152-
// Tasks for known compiler paths
153-
if (knownCompilerPaths) {
154-
result = knownCompilerPaths.map<Task>(compilerPath => this.getTask(compilerPath, appendSourceToName, undefined));
155-
}
151+
const result: CppBuildTask[] = [];
152+
156153
// Task for valid user compiler path setting
157154
if (isCompilerValid && userCompilerPath) {
158155
result.push(this.getTask(userCompilerPath, appendSourceToName, userCompilerPathAndArgs?.allCompilerArgs));
159156
}
157+
158+
// Tasks for known compiler paths
159+
if (knownCompilerPaths) {
160+
result.push(...knownCompilerPaths.map<Task>(compilerPath => this.getTask(compilerPath, appendSourceToName, undefined)));
161+
}
162+
160163
return result;
161164
}
162165

0 commit comments

Comments
 (0)