in src/build.ts [76:120]
async function showFixSuggestions(operationId: string) {
let buildFiles: string[] = [];
try {
buildFiles = await Jdtls.resolveBuildFiles();
} catch (error) {
// do nothing
}
const pickitems: QuickPickItem[] = [];
pickitems.push({
label: "Clean workspace cache",
detail: "Clean the stale workspace and reload the window",
});
if (buildFiles.length) {
pickitems.push({
label: "Update project configuration",
detail: "Force the language server to update the project configuration/classpath",
});
}
pickitems.push({
label: "Open log file",
detail: "Open log file to view more details for the build errors",
});
const ans = await window.showQuickPick(pickitems, {
placeHolder: "Please fix the errors in PROBLEMS first, then try the fix suggestions below.",
});
sendInfo(operationId, {
operationName: "build",
choiceForBuildFix: ans ? ans.label : "esc",
});
if (!ans) {
return;
}
if (ans.label === "Clean workspace cache") {
commands.executeCommand("java.clean.workspace");
} else if (ans.label === "Update project configuration") {
for (const buildFile of buildFiles) {
await commands.executeCommand("java.projectConfiguration.update", Uri.parse(buildFile));
}
} else if (ans.label === "Open log file") {
commands.executeCommand("java.open.serverLog");
}
}