fix: replace global needRebuild() with project-scoped rebuild APIs#1300
Merged
joaodinissf merged 1 commit intodsldevkit:masterfrom Apr 6, 2026
Merged
Conversation
cd9b3aa to
dd4b31f
Compare
ba39b55 to
068faeb
Compare
rubenporras
approved these changes
Apr 3, 2026
068faeb to
4fb930a
Compare
BuildContext.needRebuild() called IncrementalProjectBuilder.needRebuild(), which sets a global rebuildRequested flag on Eclipse's BuildManager, causing ALL projects in the build cycle to be rebuilt — not just the current project. This was redundant because RebuildingXtextBuilder already handles generated-source reprocessing via an internal rebuild loop (up to 2 extra iterations in doBuild()). The global call was a leftover from a 2014 workaround (Eclipse Bug #452399) that was never removed. Additionally, BuildContext did not override needRebuild(IProject) (added in Xtext 2.27), so callers using the modern API fell through to the deprecated global version. Changes: - Remove builder.needRebuild() from the no-arg needRebuild(), keeping only the internal rebuildRequired flag - Override needRebuild(IProject) using Eclipse 3.17+ project-scoped APIs (triggerRequestProjectRebuild / triggerRequestProjectsRebuild), matching the upstream Xtext pattern (eclipse-archived/xtext-eclipse#1820) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4fb930a to
44ad9d6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IncrementalProjectBuilder.needRebuild()call that triggered global workspace rebuilds every time a builder participant generated a fileneedRebuild(IProject)using Eclipse 3.17+ project-scoped APIs, matching the upstream Xtext 2.27+ patternWhat Changes
No-arg
needRebuild(): Removebuilder.needRebuild(), keeping only the internalrebuildRequiredflag.New
needRebuild(IProject)override: Uses project-scoped Eclipse APIs:builder.triggerRequestProjectRebuild()— rebuilds only this projectbuilder.triggerRequestProjectsRebuild(project)— rebuilds only that projectReferences
needRebuild()identified as cause of O(n²) build behaviorRebuildingXtextBuilderneedRebuild(IProject)Test plan
🤖 Generated with Claude Code