mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix yellow code producing by CommonDataKeys
This commit is contained in:
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
public class PyTypeHierachyProvider implements HierarchyProvider {
|
||||
@Nullable
|
||||
public PsiElement getTarget(@NotNull DataContext dataContext) {
|
||||
PsiElement element = LangDataKeys.PSI_ELEMENT.getData(dataContext);
|
||||
PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(dataContext);
|
||||
if (element == null) {
|
||||
final Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
|
||||
final PsiFile file = LangDataKeys.PSI_FILE.getData(dataContext);
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public class PyChangeSignatureHandler implements ChangeSignatureHandler {
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file, DataContext dataContext) {
|
||||
PsiElement element = findTargetMember(file, editor);
|
||||
if (element == null) {
|
||||
element = LangDataKeys.PSI_ELEMENT.getData(dataContext);
|
||||
element = CommonDataKeys.PSI_ELEMENT.getData(dataContext);
|
||||
}
|
||||
invokeOnElement(project, element, editor);
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package com.jetbrains.python.refactoring.invertBoolean;
|
||||
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -22,7 +23,7 @@ public class PyInvertBooleanHandler implements RefactoringActionHandler {
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file, DataContext dataContext) {
|
||||
PsiElement element = LangDataKeys.PSI_ELEMENT.getData(dataContext);
|
||||
PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(dataContext);
|
||||
if (element == null && editor != null && file != null) {
|
||||
element = file.findElementAt(editor.getCaretModel().getOffset());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user