Repository navigation
Executing "Force Java compilation" from the command palette shows confusing error message #437
Description
Activity
I guess we need to change the scope of the command to something workspace friendly
Alt+Shift+B works for me, how did you run the command?
command palette of course
Ok so this is not a multi-root problem. The problem is caused by the server build failing , eg. due to compilation errors, then the promise is rejected L197:
Lines 181 to 202 in 2a993d3
commands.registerCommand(Commands.COMPILE_WORKSPACE, (isFullCompile : boolean) => { return window.withProgress({ location: ProgressLocation.Window }, async p => { if (typeof isFullCompile !== 'boolean') { const selection = await window.showQuickPick(['Incremental', 'Full'], {'placeHolder' : 'please choose compile type:'}); isFullCompile = selection !== 'Incremental'; } p.report({ message: 'Compiling workspace...' }); const start = new Date().getTime(); const res = await languageClient.sendRequest(CompileWorkspaceRequest.type, isFullCompile); const elapsed = new Date().getTime() - start; const humanVisibleDelay = elapsed < 1000? 1000:0; return new Promise((resolve, reject) => { setTimeout(() => { // set a timeout so user would still see the message when build time is short if (res === CompileWorkspaceStatus.SUCCEED) { resolve(res); } else { reject(res); } }, humanVisibleDelay); }); }); }); When the command results fails, when launched from the command palette, vscode reports it couldn't run the command. When launched from a shortcut, rejected promise is ignored. Not sure what the best way is to deal with that. @ansyral any idea?
Reacted by Matti- changed the title
[-]Force compilation error on multi-root workspaces[/-][+]Executing "Force Java compilation" from the command palette shows confusing error message[/+]on Feb 15, 2018 It should be made more obvious, that there was a build error. Because I never thought of that. I though my installation is messed up
This looks fixed by (#4032). I ran Java: Force Java Compilation → Full on a project with a compile error, in both single-folder and multi-root workspaces, and the "can not be run from here" error no longer appears.
I get a
Command 'Java: Force Java compilation' can not be run from here.error dialog when I execute force Java Compilation on a multi-root project. Although it looks like the compilation seems to execute.