mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove unneeded code
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
package com.jetbrains.python.refactoring;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author oleg
|
||||
*/
|
||||
public class FileDataContext implements DataContext {
|
||||
private final PsiFile myFile;
|
||||
|
||||
public FileDataContext(final PsiFile file) {
|
||||
myFile = file;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Object getData(@NonNls String dataId) {
|
||||
if (LangDataKeys.LANGUAGE.is(dataId)) {
|
||||
return myFile.getLanguage();
|
||||
}
|
||||
if (PlatformDataKeys.PROJECT.is(dataId)) {
|
||||
return myFile.getProject();
|
||||
}
|
||||
if (LangDataKeys.PSI_FILE.is(dataId)) {
|
||||
return myFile;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Data not supported: " + dataId);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jetbrains.python.refactoring;
|
||||
|
||||
import com.intellij.lang.LanguageRefactoringSupport;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.refactoring.RefactoringActionHandler;
|
||||
import com.jetbrains.python.PythonLanguage;
|
||||
import com.jetbrains.python.fixtures.LightMarkedTestCase;
|
||||
@@ -19,7 +20,7 @@ public class PyExtractMethodTest extends LightMarkedTestCase {
|
||||
try {
|
||||
System.setProperty(PyExtractMethodUtil.NAME, name);
|
||||
try {
|
||||
handler.invoke(myFixture.getProject(), myFixture.getEditor(), myFixture.getFile(), new FileDataContext(myFixture.getFile()));
|
||||
handler.invoke(myFixture.getProject(), myFixture.getEditor(), myFixture.getFile(), ((EditorEx) myFixture.getEditor()).getDataContext());
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (result.endsWith(".py")) { // expected output file, not an exception
|
||||
|
||||
Reference in New Issue
Block a user