mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-119475 Can't remove file reverence
This commit is contained in:
+9
-1
@@ -75,7 +75,8 @@ public class UnInjectLanguageAction implements IntentionAction, LowPriorityActio
|
||||
final PsiFile psiFile = InjectedLanguageUtil.findInjectedPsiNoCommit(file, offset);
|
||||
if (psiFile == null) {
|
||||
PsiReference reference = file.findReferenceAt(offset);
|
||||
if (reference != null && reference.getElement() instanceof PsiLanguageInjectionHost) {
|
||||
if (reference == null) return;
|
||||
if (reference.getElement() instanceof PsiLanguageInjectionHost) {
|
||||
PsiLanguageInjectionHost host = (PsiLanguageInjectionHost)reference.getElement();
|
||||
for (LanguageInjectionSupport support : InjectorUtils.getActiveInjectionSupports()) {
|
||||
if (support.isApplicableTo(host) && support.removeInjectionInPlace(host)) {
|
||||
@@ -84,6 +85,13 @@ public class UnInjectLanguageAction implements IntentionAction, LowPriorityActio
|
||||
}
|
||||
}
|
||||
}
|
||||
PsiElement element = reference.getElement();
|
||||
LanguageInjectionSupport support = element.getUserData(LanguageInjectionSupport.INJECTOR_SUPPORT);
|
||||
if (support != null) {
|
||||
if (support.removeInjection(element)) {
|
||||
((PsiModificationTrackerImpl)PsiManager.getInstance(project).getModificationTracker()).incCounter();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
final PsiLanguageInjectionHost host = InjectedLanguageManager.getInstance(project).getInjectionHost(psiFile);
|
||||
|
||||
Reference in New Issue
Block a user