Create imported projects in a single workspace operation - #4257
Open
vogella wants to merge 2 commits into
Open
Conversation
SmartImportJob turns auto-building off for the duration of the import and turns it back on as the last statement of its try block. A configurator that throws, or a cancellation, skips that statement, so the workspace is left with auto-building permanently disabled until the user notices and toggles it manually. Restore the previous setting in a finally block instead. Also null check the optional import listener when closing projects after the import.
SmartImportJob created every selected project in its own workspace operation, so each project produced its own resource delta and every listener (JDT, PDE, Project Explorer, team providers) was notified once per project. The creation loop now runs as one workspace operation, which collapses those deltas into a single one. No configurator runs in that loop, so the parallel configuration phase and its scheduling rules stay as they are. The import also walked each project twice: importProjectAndChildrenRecursively refreshes the container with DEPTH_INFINITE and afterwards refreshes the project it created for that container, which is the same resource for a project selected in the wizard. The second refresh is now done only when the project differs from the container, which is the case for nested projects detected in a child folder.
Contributor
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.
Smart import created every selected project in its own workspace operation, so an import of N projects produced N resource deltas and woke every listener (JDT, PDE, Project Explorer, team providers) N times. Running the creation loop as one workspace operation collapses that into a single delta, in the same spirit as the batching done for the existing projects import. The parallel configuration phase and its scheduling rules are untouched, no configurator runs in the batched loop.
The second change removes a duplicated full refresh: the container is refreshed with DEPTH_INFINITE and then the project created for that container is refreshed again, which is the same resource for a project selected in the wizard. The extra refresh is now done only for nested projects, where the project really is a different resource than the container.
Both are covered by a new test asserting that all projects arrive in one resource change event. Builds on #4256, so the first commit belongs to that PR.