Skip to content

Replacing setTextValue → setText, setText2Value → setText2, setDescriptionValue → setDescription#36

Merged
VISTALL merged 1 commit intoconsulo:masterfrom
unv-unv:eliminating-set-text-value
Apr 7, 2026
Merged

Replacing setTextValue → setText, setText2Value → setText2, setDescriptionValue → setDescription#36
VISTALL merged 1 commit intoconsulo:masterfrom
unv-unv:eliminating-set-text-value

Conversation

@unv-unv
Copy link
Copy Markdown
Contributor

@unv-unv unv-unv commented Apr 6, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Git plugin code to align with newer UI/progress APIs by replacing the deprecated *Value setter methods with their newer equivalents, keeping localization (LocalizeValue) usage intact.

Changes:

  • Replaced setTextValuesetText and setText2ValuesetText2 on ProgressIndicator.
  • Replaced setTextValue/setDescriptionValuesetText/setDescription on action Presentations.
  • Minor import cleanup/reordering in a few action classes.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
plugin/src/main/java/git4idea/update/GitUpdateProcess.java Switches progress indicator text updates to setText.
plugin/src/main/java/git4idea/update/GitMergeUpdater.java Switches progress indicator text updates to setText.
plugin/src/main/java/git4idea/ui/branch/GitBranchPopupActions.java Uses setDescription / setText instead of *Value methods.
plugin/src/main/java/git4idea/stash/GitStashChangesSaver.java Uses ProgressIndicator.setText instead of setTextValue.
plugin/src/main/java/git4idea/stash/GitShelveChangesSaver.java Uses ProgressIndicator.setText instead of setTextValue.
plugin/src/main/java/git4idea/reset/GitResetAction.java Uses Presentation.setText instead of setTextValue.
plugin/src/main/java/git4idea/commands/GitTask.java Uses ProgressIndicator.setText instead of setTextValue during task execution.
plugin/src/main/java/git4idea/commands/GitHandlerUtil.java Uses indicator.setText and indicator.setText2 instead of *Value methods.
plugin/src/main/java/git4idea/annotate/GitAnnotationProvider.java Uses ProgressIndicator.setText instead of setTextValue.
plugin/src/main/java/git4idea/actions/GitFileActionGroup.java Uses Presentation.setText; minor import ordering changes.
plugin/src/main/java/git4idea/actions/GitCreateTagAction.java Uses Presentation.setText/setDescription.
plugin/src/main/java/git4idea/actions/GitCreateNewBranchAction.java Uses Presentation.setText/setDescription; import ordering change.
plugin/src/main/java/git4idea/actions/GitCompareWithBranchAction.java Uses Presentation.setText; removes unused import.
plugin/src/main/java/git4idea/actions/GitCheckoutRevisionAction.java Uses Presentation.setText.
plugin/src/main/java/consulo/git/action/VcsMenuGroup.java Uses Presentation.setText.
plugin/src/main/java/consulo/git/action/ContextMenuGroup.java Uses Presentation.setText.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 124 to 128
public GitUpdateResult update(UpdateMethod updateMethod) {
LOG.info("update started|" + updateMethod);
LocalizeValue oldText = myProgressIndicator.getTextValue();
myProgressIndicator.setTextValue(LocalizeValue.localizeTODO("Updating..."));
myProgressIndicator.setText(LocalizeValue.localizeTODO("Updating..."));

Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oldText is saved but the progress indicator text is only restored at the very end of the method. All early return GitUpdateResult.NOT_READY; paths (and any exception before line 149) leave the indicator text as "Updating...", which can leak into subsequent operations if the same indicator instance is reused. Consider wrapping the body in a try/finally that always restores oldText, or restoring it immediately before each early return.

Copilot uses AI. Check for mistakes.
Comment on lines 89 to 91
LocalizeValue originalText = myProgressIndicator.getTextValue();
myProgressIndicator.setTextValue(LocalizeValue.localizeTODO("Merging" + GitUtil.mention(myRepository) + "..."));
myProgressIndicator.setText(LocalizeValue.localizeTODO("Merging" + GitUtil.mention(myRepository) + "..."));
try {
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The progress indicator text is restored only on the success/failure path inside the try block. If ProcessCanceledException is thrown, the method returns without resetting the text to originalText, which can leave stale "Merging..." in the UI if the indicator is reused. Consider restoring originalText in a finally block (or in the cancel path) before returning.

Copilot uses AI. Check for mistakes.
@VISTALL VISTALL merged commit 476ef64 into consulo:master Apr 7, 2026
5 checks passed
@unv-unv unv-unv deleted the eliminating-set-text-value branch April 7, 2026 10:17
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.

3 participants