Replacing setTextValue → setText, setText2Value → setText2, setDescriptionValue → setDescription#36
Conversation
…ptionValue → setDescription.
There was a problem hiding this comment.
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
setTextValue→setTextandsetText2Value→setText2onProgressIndicator. - Replaced
setTextValue/setDescriptionValue→setText/setDescriptionon actionPresentations. - 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.
| public GitUpdateResult update(UpdateMethod updateMethod) { | ||
| LOG.info("update started|" + updateMethod); | ||
| LocalizeValue oldText = myProgressIndicator.getTextValue(); | ||
| myProgressIndicator.setTextValue(LocalizeValue.localizeTODO("Updating...")); | ||
| myProgressIndicator.setText(LocalizeValue.localizeTODO("Updating...")); | ||
|
|
There was a problem hiding this comment.
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.
| LocalizeValue originalText = myProgressIndicator.getTextValue(); | ||
| myProgressIndicator.setTextValue(LocalizeValue.localizeTODO("Merging" + GitUtil.mention(myRepository) + "...")); | ||
| myProgressIndicator.setText(LocalizeValue.localizeTODO("Merging" + GitUtil.mention(myRepository) + "...")); | ||
| try { |
There was a problem hiding this comment.
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.
No description provided.