From 599f12193c2819a07d5db9012dc6d3dd29da2e57 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Tue, 1 Oct 2013 22:28:20 +0200 Subject: [PATCH] fix yellow code producing by CommonDataKeys --- .../com/jetbrains/python/hierarchy/PyTypeHierachyProvider.java | 2 +- .../refactoring/changeSignature/PyChangeSignatureHandler.java | 2 +- .../refactoring/invertBoolean/PyInvertBooleanHandler.java | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/python/src/com/jetbrains/python/hierarchy/PyTypeHierachyProvider.java b/python/src/com/jetbrains/python/hierarchy/PyTypeHierachyProvider.java index dd064dda8bb8..e626be7250b2 100644 --- a/python/src/com/jetbrains/python/hierarchy/PyTypeHierachyProvider.java +++ b/python/src/com/jetbrains/python/hierarchy/PyTypeHierachyProvider.java @@ -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); diff --git a/python/src/com/jetbrains/python/refactoring/changeSignature/PyChangeSignatureHandler.java b/python/src/com/jetbrains/python/refactoring/changeSignature/PyChangeSignatureHandler.java index 44336da71c71..08916747bb8a 100644 --- a/python/src/com/jetbrains/python/refactoring/changeSignature/PyChangeSignatureHandler.java +++ b/python/src/com/jetbrains/python/refactoring/changeSignature/PyChangeSignatureHandler.java @@ -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); } diff --git a/python/src/com/jetbrains/python/refactoring/invertBoolean/PyInvertBooleanHandler.java b/python/src/com/jetbrains/python/refactoring/invertBoolean/PyInvertBooleanHandler.java index 8496818d4b94..141aff8189c8 100644 --- a/python/src/com/jetbrains/python/refactoring/invertBoolean/PyInvertBooleanHandler.java +++ b/python/src/com/jetbrains/python/refactoring/invertBoolean/PyInvertBooleanHandler.java @@ -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()); }