Skip to content

Commit 02a3152

Browse files
authored
Fix duplicate build task when compilerPath has args. (#3360)
1 parent 77806f6 commit 02a3152

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Extension/src/LanguageServer/extension.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,13 @@ export async function getBuildTasks(returnComplerPath: boolean): Promise<vscode.
171171

172172
let map: Map<string, string> = new Map<string, string>();
173173
const insertOrAssignEntry: (compilerPath: string) => void = (compilerPath: string): void => {
174-
const basename: string = path.basename(compilerPath);
175-
//map.has(basename) ? map.basename] = compilerPath :
174+
let basename: string = compilerPath;
175+
if (compilerPath === userCompilerPath) {
176+
// Make sure the compiler args are not part of the basename.
177+
const compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(compilerPath);
178+
basename = compilerPathAndArgs.compilerPath;
179+
}
180+
basename = path.basename(basename);
176181
map.set(basename, compilerPath);
177182
};
178183
compilerPaths.forEach(insertOrAssignEntry);

0 commit comments

Comments
 (0)