Skip to content

Add atomic coordinated Cleanup preview changes - #100

Draft
carstenartur wants to merge 23 commits into
feature/multifile-cleanup-scope-expansion-4.40from
feature/coordinated-cleanup-preview-4.40
Draft

Add atomic coordinated Cleanup preview changes#100
carstenartur wants to merge 23 commits into
feature/multifile-cleanup-scope-expansion-4.40from
feature/coordinated-cleanup-preview-4.40

Conversation

@carstenartur

Copy link
Copy Markdown
Owner

Summary

Adds an optional, dependency-free contract for presenting a coordinated multi-file Cleanup migration as one atomic LTK preview entry.

  • cleanups may expose getCoordinatedCleanUpPreview(IJavaProject) and return stable candidate metadata, affected compilation units, a user-facing name/description, and safety details;
  • CleanUpRefactoring groups the ordinary per-file changes for those units into a unique non-text CoordinatedCleanUpChange;
  • the wrapper is rendered as one top-level checkbox instead of exposing unsafe file/edit-group checkboxes;
  • ordinary local cleanup changes in unrelated files retain the standard fine-grained LTK preview;
  • overlapping coordinated candidates are merged into one safe atomic component;
  • validation and direct perform(...) both fail closed if internal changes are partially disabled programmatically;
  • apply and undo still delegate to the standard LTK CompositeChange machinery;
  • original GroupCategorySet metadata is preserved while cleanup changes are merged.

Tests

CoordinatedCleanUpPreviewTest covers:

  • one coordinated two-file candidate plus an independently selectable local file change;
  • atomic enable/disable propagation;
  • fatal validation and direct-perform rejection for a partial nested selection before resources are modified;
  • atomic apply and byte-exact undo across both files;
  • safe merging of overlapping coordinated candidate IDs.

The productive source and test are listed in .github/fork-specific-files.txt, so the fork synchronization workflow cannot silently remove the contract.

Refs #96
Refs carstenartur/sandbox#1451

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant