Skip to content

Rebuild commands mostly perform "full" instead of "incremental" #878

Closed

Description

Looking through the UI contributions, I see that builds tend to run "full".

{
"command": "java.project.build.workspace",
"when": "view == javaProjectExplorer && java:serverMode == Standard && !java:noJavaProjects && !java:importFailed",
"group": "navigation@30"
},

{
"command": "java.project.build.workspace",
"when": "view == javaProjectExplorer && viewItem =~ /java:project(?=.*?\\b\\+java\\b)(?=.*?\\b\\+uri\\b)/",
"group": "8_execution@5"
},

context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_PROJECT_BUILD_WORKSPACE, () =>
commands.executeCommand(Commands.JAVA_BUILD_WORKSPACE, true /*fullCompile*/)));

context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_PROJECT_REBUILD, async (node: INodeData) => {
if (!node.uri) {
sendError(new Error("Uri not available when building project"));
window.showErrorMessage("The URI of the project is not available, you can try to trigger the command 'Java: Rebuild Projects' from Command Palette.");
return;
}
commands.executeCommand(Commands.BUILD_PROJECT, Uri.parse(node.uri), true);
}));

From #854 (comment) & https://wiki.eclipse.org/FAQ_How_do_I_turn_off_autobuilding_of_Java_code%3F the consensus seems to be that if a user has a large enough project, and they observe very slow performance on builds, one thing to try is disabling autobuild and switching to manually performing the build. If doing this, wouldn't it be best to make every build-related UI element do it incrementally ? That way the least amount of work is done, and if a full build is needed, the incremental builder would just fall back to that.

Sheng Chen (@jdneo) , what are your thoughts on a proposal to change most of these commands to "incremental" ? Are there certain UI elements that should absolutely remain "full" ?

Update:

Activity

  1. wissamblue69-dotcom commented on Mar 17, 2026

    @wissamblue69-dotcom

    Looking through the UI contributions, I see that builds tend to run "full".

    {
    "command": "java.project.build.workspace",
    "when": "view == javaProjectExplorer && java:serverMode == Standard && !java:noJavaProjects && !java:importFailed",
    "group": "navigation@30"
    },

    {
    "command": "java.project.build.workspace",
    "when": "view == javaProjectExplorer && viewItem =~ /java:project(?=.*?\\b\\+java\\b)(?=.*?\\b\\+uri\\b)/",
    "group": "8_execution@5"
    },

    context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_PROJECT_BUILD_WORKSPACE, () =>
    commands.executeCommand(Commands.JAVA_BUILD_WORKSPACE, true /*fullCompile*/)));

    context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_PROJECT_REBUILD, async (node: INodeData) => {
    if (!node.uri) {
    sendError(new Error("Uri not available when building project"));
    window.showErrorMessage("The URI of the project is not available, you can try to trigger the command 'Java: Rebuild Projects' from Command Palette.");
    return;
    }
    commands.executeCommand(Commands.BUILD_PROJECT, Uri.parse(node.uri), true);
    }));

    From #854 (comment) & https://wiki.eclipse.org/FAQ_How_do_I_turn_off_autobuilding_of_Java_code%3F the consensus seems to be that if a user has a large enough project, and they observe very slow performance on builds, one thing to try is disabling autobuild and switching to manually performing the build. If doing this, wouldn't it be best to make every build-related UI element do it incrementally ? That way the least amount of work is done, and if a full build is needed, the incremental builder would just fall back to that.

    Sheng Chen (@jdneo) , what are your thoughts on a proposal to change most of these commands to "incremental" ? Are there certain UI elements that should absolutely remain "full" ?

    Update:

  2. wissamblue69-dotcom commented on Mar 18, 2026

    @wissamblue69-dotcom

    Looking through the UI contributions, I see that builds tend to run "full".

    {
    "command": "java.project.build.workspace",
    "when": "view == javaProjectExplorer && java:serverMode == Standard && !java:noJavaProjects && !java:importFailed",
    "group": "navigation@30"
    },

    {
    "command": "java.project.build.workspace",
    "when": "view == javaProjectExplorer && viewItem =~ /java:project(?=.*?\\b\\+java\\b)(?=.*?\\b\\+uri\\b)/",
    "group": "8_execution@5"
    },

    context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_PROJECT_BUILD_WORKSPACE, () =>
    commands.executeCommand(Commands.JAVA_BUILD_WORKSPACE, true /*fullCompile*/)));

    context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_PROJECT_REBUILD, async (node: INodeData) => {
    if (!node.uri) {
    sendError(new Error("Uri not available when building project"));
    window.showErrorMessage("The URI of the project is not available, you can try to trigger the command 'Java: Rebuild Projects' from Command Palette.");
    return;
    }
    commands.executeCommand(Commands.BUILD_PROJECT, Uri.parse(node.uri), true);
    }));

    From #854 (comment) & https://wiki.eclipse.org/FAQ_How_do_I_turn_off_autobuilding_of_Java_code%3F the consensus seems to be that if a user has a large enough project, and they observe very slow performance on builds, one thing to try is disabling autobuild and switching to manually performing the build. If doing this, wouldn't it be best to make every build-related UI element do it incrementally ? That way the least amount of work is done, and if a full build is needed, the incremental builder would just fall back to that.

    Sheng Chen (@jdneo) , what are your thoughts on a proposal to change most of these commands to "incremental" ? Are there certain UI elements that should absolutely remain "full" ?

    Update:

  3. wissamblue69-dotcom commented on Mar 18, 2026

    @wissamblue69-dotcom

    Looking through the UI contributions, I see that builds tend to run "full".

    {
    "command": "java.project.build.workspace",
    "when": "view == javaProjectExplorer && java:serverMode == Standard && !java:noJavaProjects && !java:importFailed",
    "group": "navigation@30"
    },

    {
    "command": "java.project.build.workspace",
    "when": "view == javaProjectExplorer && viewItem =~ /java:project(?=.*?\\b\\+java\\b)(?=.*?\\b\\+uri\\b)/",
    "group": "8_execution@5"
    },

    context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_PROJECT_BUILD_WORKSPACE, () =>
    commands.executeCommand(Commands.JAVA_BUILD_WORKSPACE, true /*fullCompile*/)));

    context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_PROJECT_REBUILD, async (node: INodeData) => {
    if (!node.uri) {
    sendError(new Error("Uri not available when building project"));
    window.showErrorMessage("The URI of the project is not available, you can try to trigger the command 'Java: Rebuild Projects' from Command Palette.");
    return;
    }
    commands.executeCommand(Commands.BUILD_PROJECT, Uri.parse(node.uri), true);
    }));

    From #854 (comment) & https://wiki.eclipse.org/FAQ_How_do_I_turn_off_autobuilding_of_Java_code%3F the consensus seems to be that if a user has a large enough project, and they observe very slow performance on builds, one thing to try is disabling autobuild and switching to manually performing the build. If doing this, wouldn't it be best to make every build-related UI element do it incrementally ? That way the least amount of work is done, and if a full build is needed, the incremental builder would just fall back to that.

    Sheng Chen (@jdneo) , what are your thoughts on a proposal to change most of these commands to "incremental" ? Are there certain UI elements that should absolutely remain "full" ?

    Update:

  4. wissamblue69-dotcom commented on Mar 18, 2026

    @wissamblue69-dotcom

    Looking through the UI contributions, I see that builds tend to run "full".

    {
    "command": "java.project.build.workspace",
    "when": "view == javaProjectExplorer && java:serverMode == Standard && !java:noJavaProjects && !java:importFailed",
    "group": "navigation@30"
    },

    {
    "command": "java.project.build.workspace",
    "when": "view == javaProjectExplorer && viewItem =~ /java:project(?=.*?\\b\\+java\\b)(?=.*?\\b\\+uri\\b)/",
    "group": "8_execution@5"
    },

    context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_PROJECT_BUILD_WORKSPACE, () =>
    commands.executeCommand(Commands.JAVA_BUILD_WORKSPACE, true /*fullCompile*/)));

    context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_PROJECT_REBUILD, async (node: INodeData) => {
    if (!node.uri) {
    sendError(new Error("Uri not available when building project"));
    window.showErrorMessage("The URI of the project is not available, you can try to trigger the command 'Java: Rebuild Projects' from Command Palette.");
    return;
    }
    commands.executeCommand(Commands.BUILD_PROJECT, Uri.parse(node.uri), true);
    }));

    From #854 (comment) & https://wiki.eclipse.org/FAQ_How_do_I_turn_off_autobuilding_of_Java_code%3F the consensus seems to be that if a user has a large enough project, and they observe very slow performance on builds, one thing to try is disabling autobuild and switching to manually performing the build. If doing this, wouldn't it be best to make every build-related UI element do it incrementally ? That way the least amount of work is done, and if a full build is needed, the incremental builder would just fall back to that.

    Sheng Chen (@jdneo) , what are your thoughts on a proposal to change most of these commands to "incremental" ? Are there certain UI elements that should absolutely remain "full" ?

    Update:

  5. wenytang-ms commented on Apr 28, 2026

    @wenytang-ms
    Contributor

    I opened a PR to address this: #998

    The change makes the Project Manager build entry points incremental by default:

    • Build All now calls java.workspace.compile(false).
    • Build Project now calls java.project.build(..., false).
    • The default Java build task now uses isFullBuild: false.
    • Clean Workspace remains the explicit clean/full rebuild path.

    I also verified the call chain: the false flag is passed through vscode-java to JDT LS, where it maps to
    IncrementalProjectBuilder.INCREMENTAL_BUILD; true remains the clean/full build path.

  6. wenytang-ms commented on May 21, 2026

    @wenytang-ms
    Contributor

    0.27.3 support such feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions