mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-101798 [fix-all]: cleanup
GitOrigin-RevId: 98a349814d5560248be06e8509c3e26d1b487296
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b001f5d6a6
commit
3e1409ad64
+7
-10
@@ -86,26 +86,23 @@ public final class CleanupInspectionIntention implements IntentionAction, HighPr
|
||||
PsiFile targetFile = myPsiFile == null ? psiFile : myPsiFile;
|
||||
if (targetFile == null) return null;
|
||||
InjectedLanguageManager manager = InjectedLanguageManager.getInstance(targetFile.getProject());
|
||||
boolean injected = manager.isInjectedFragment(targetFile);
|
||||
List<ProblemDescriptor> descriptions;
|
||||
if (injected) {
|
||||
descriptions = new ArrayList<>();
|
||||
List<ProblemDescriptor> descriptors;
|
||||
if (manager.isInjectedFragment(targetFile)) {
|
||||
descriptors = new ArrayList<>();
|
||||
PsiFile topLevelFile = manager.getTopLevelFile(targetFile);
|
||||
PsiTreeUtil.processElements(topLevelFile, PsiLanguageInjectionHost.class, host -> {
|
||||
manager.enumerateEx(host, topLevelFile, false, (injectedPsi, places) -> {
|
||||
descriptions.addAll(getDescriptors(project, injectedPsi));
|
||||
});
|
||||
manager.enumerateEx(host, topLevelFile, false, (injectedPsi, places) -> descriptors.addAll(getDescriptors(project, injectedPsi)));
|
||||
return true;
|
||||
});
|
||||
}
|
||||
else {
|
||||
descriptions = getDescriptors(project, targetFile);
|
||||
descriptors = getDescriptors(project, targetFile);
|
||||
}
|
||||
|
||||
String message = null;
|
||||
if (!descriptions.isEmpty() && FileModificationService.getInstance().preparePsiElementForWrite(targetFile)) {
|
||||
if (!descriptors.isEmpty() && FileModificationService.getInstance().preparePsiElementForWrite(targetFile)) {
|
||||
AbstractPerformFixesTask fixesTask = CleanupInspectionUtil.getInstance()
|
||||
.applyFixes(project, LangBundle.message("apply.fixes"), descriptions, ReportingClassSubstitutor.getClassToReport(myQuickfix),
|
||||
.applyFixes(project, LangBundle.message("apply.fixes"), descriptors, ReportingClassSubstitutor.getClassToReport(myQuickfix),
|
||||
myQuickfix.startInWriteAction());
|
||||
|
||||
message = fixesTask.getResultMessage(myText);
|
||||
|
||||
Reference in New Issue
Block a user