mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
correct handler inferring for refactoring actions
This commit is contained in:
+9
-8
@@ -60,14 +60,7 @@ public abstract class BasePlatformRefactoringAction extends BaseRefactoringActio
|
||||
|
||||
@Override
|
||||
protected final RefactoringActionHandler getHandler(DataContext dataContext) {
|
||||
|
||||
PsiElement element = LangDataKeys.PSI_ELEMENT.getData(dataContext);
|
||||
if (element != null) {
|
||||
RefactoringActionHandler handler = getHandler(element.getLanguage(), element);
|
||||
if (handler != null) {
|
||||
return handler;
|
||||
}
|
||||
}
|
||||
PsiElement element;
|
||||
|
||||
Editor editor = LangDataKeys.EDITOR.getData(dataContext);
|
||||
PsiFile file = LangDataKeys.PSI_FILE.getData(dataContext);
|
||||
@@ -81,6 +74,14 @@ public abstract class BasePlatformRefactoringAction extends BaseRefactoringActio
|
||||
}
|
||||
}
|
||||
|
||||
element = LangDataKeys.PSI_ELEMENT.getData(dataContext);
|
||||
if (element != null) {
|
||||
RefactoringActionHandler handler = getHandler(element.getLanguage(), element);
|
||||
if (handler != null) {
|
||||
return handler;
|
||||
}
|
||||
}
|
||||
|
||||
final Language[] languages = LangDataKeys.CONTEXT_LANGUAGES.getData(dataContext);
|
||||
if (languages != null) {
|
||||
for (Language language : languages) {
|
||||
|
||||
Reference in New Issue
Block a user