mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
introduce variable: reassign value to the existing: correctly process occurrences
This commit is contained in:
@@ -551,8 +551,11 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase {
|
||||
final RangeMarker exprMarker = editor.getDocument().createRangeMarker(expr.getTextRange());
|
||||
final SuggestedNameInfo suggestedName = getSuggestedName(settings.getSelectedType(), expr, chosenAnchor);
|
||||
final List<RangeMarker> occurrenceMarkers = new ArrayList<RangeMarker>();
|
||||
final boolean noWrite = choice == OccurrencesChooser.ReplaceChoice.NO_WRITE;
|
||||
for (PsiExpression occurrence : occurrences) {
|
||||
occurrenceMarkers.add(editor.getDocument().createRangeMarker(occurrence.getTextRange()));
|
||||
if (allOccurences || (noWrite && !PsiUtil.isAccessedForWriting(occurrence))) {
|
||||
occurrenceMarkers.add(editor.getDocument().createRangeMarker(occurrence.getTextRange()));
|
||||
}
|
||||
}
|
||||
final String expressionText = expr.getText();
|
||||
final Runnable runnable =
|
||||
|
||||
Reference in New Issue
Block a user