mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+10
-7
@@ -181,13 +181,16 @@ public class ImportToggleAliasIntention implements IntentionAction {
|
||||
InjectedLanguageManager.getInstance(project).getInjectedPsiFiles(host);
|
||||
if (files != null) {
|
||||
for (Pair<PsiElement, TextRange> pair : files) {
|
||||
final ScopeOwner scopeOwner = (ScopeOwner)pair.getFirst();
|
||||
PsiTreeUtil.processElements(scopeOwner, new PsiElementProcessor() {
|
||||
public boolean execute(@NotNull PsiElement element) {
|
||||
getReferences(element);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
final PsiElement first = pair.getFirst();
|
||||
if (first instanceof ScopeOwner) {
|
||||
final ScopeOwner scopeOwner = (ScopeOwner)first;
|
||||
PsiTreeUtil.processElements(scopeOwner, new PsiElementProcessor() {
|
||||
public boolean execute(@NotNull PsiElement element) {
|
||||
getReferences(element);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,10 @@ import com.intellij.util.Consumer;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.containers.hash.HashMap;
|
||||
import com.jetbrains.python.*;
|
||||
import com.jetbrains.python.PyBundle;
|
||||
import com.jetbrains.python.PyNames;
|
||||
import com.jetbrains.python.PythonFileType;
|
||||
import com.jetbrains.python.PythonLanguage;
|
||||
import com.jetbrains.python.codeInsight.codeFragment.PyCodeFragment;
|
||||
import com.jetbrains.python.codeInsight.controlflow.ControlFlowCache;
|
||||
import com.jetbrains.python.codeInsight.controlflow.ScopeOwner;
|
||||
@@ -332,9 +335,12 @@ public class PyExtractMethodUtil {
|
||||
}
|
||||
}
|
||||
|
||||
private static void setSelectionAndCaret(Editor editor, final PsiElement callElement) {
|
||||
private static void setSelectionAndCaret(Editor editor, @Nullable final PsiElement callElement) {
|
||||
editor.getSelectionModel().removeSelection();
|
||||
editor.getCaretModel().moveToOffset(callElement.getTextOffset());
|
||||
if (callElement != null) {
|
||||
final int offset = callElement.getTextOffset();
|
||||
editor.getCaretModel().moveToOffset(offset);
|
||||
}
|
||||
}
|
||||
|
||||
private static PsiElement replaceElements(final List<PsiElement> elementsRange, @NotNull PsiElement callElement) {
|
||||
|
||||
Reference in New Issue
Block a user