mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-86898 - assert: CaretImpl.lambda$doSetSelection$
open another editor if fix is invoked from method call
This commit is contained in:
+4
-2
@@ -135,7 +135,7 @@ public class MethodReturnTypeFix extends LocalQuickFixAndIntentionActionOnPsiEle
|
||||
}
|
||||
|
||||
if (statementToSelect != null) {
|
||||
Editor editorForMethod = getEditorForMethod(myMethod, project, editor, statementToSelect.getContainingFile());
|
||||
Editor editorForMethod = getEditorForMethod(myMethod, project, editor, file);
|
||||
if (editorForMethod != null) {
|
||||
selectReturnValueInEditor(statementToSelect, editorForMethod);
|
||||
}
|
||||
@@ -308,7 +308,9 @@ public class MethodReturnTypeFix extends LocalQuickFixAndIntentionActionOnPsiEle
|
||||
}
|
||||
|
||||
static void selectReturnValueInEditor(final PsiReturnStatement returnStatement, final Editor editor) {
|
||||
TextRange range = returnStatement.getReturnValue().getTextRange();
|
||||
final PsiExpression returnValue = returnStatement.getReturnValue();
|
||||
LOG.assertTrue(returnValue != null, returnStatement);
|
||||
TextRange range = returnValue.getTextRange();
|
||||
int offset = range.getStartOffset();
|
||||
|
||||
editor.getCaretModel().moveToOffset(offset);
|
||||
|
||||
@@ -119,7 +119,7 @@ make.vararg.parameter.last.family=Make vararg parameter last
|
||||
make.vararg.parameter.last.text=Move ''{0}'' to the end of the list
|
||||
fix.parameter.type.family=Fix Parameter Type
|
||||
fix.parameter.type.text=Make ''{0}'' take parameter of type ''{1}'' here
|
||||
fix.return.type.family=Fix Return Type
|
||||
fix.return.type.family=Fix return type
|
||||
fix.return.type.text=Make ''{0}'' return ''{1}''
|
||||
fix.throws.list.family=Fix Throws List
|
||||
fix.throws.list.add.exception=Add ''{0}'' to ''{1}'' throws list
|
||||
|
||||
Reference in New Issue
Block a user