mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
@@ -100,7 +100,7 @@ public class CreateFileFix extends LocalQuickFixAndIntentionActionOnPsiElement {
|
||||
@Override
|
||||
public void invoke(@NotNull final Project project, @NotNull PsiFile file, @NotNull PsiElement startElement, @NotNull PsiElement endElement) {
|
||||
final PsiDirectory myDirectory = (PsiDirectory)startElement;
|
||||
if (isAvailable(project, null, null)) {
|
||||
if (isAvailable(project, null, file)) {
|
||||
new WriteCommandAction(project) {
|
||||
protected void run(Result result) throws Throwable {
|
||||
invoke(project, myDirectory);
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.intellij.codeInspection.ex;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.codeInspection.ui.ProblemDescriptionNode;
|
||||
import com.intellij.lang.injection.InjectedLanguageManager;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
@@ -95,10 +94,9 @@ public class ProblemDescriptorImpl extends CommonProblemDescriptorImpl implement
|
||||
|
||||
myHighlightType = highlightType;
|
||||
final Project project = startElement.getProject();
|
||||
final boolean useLazy = !onTheFly || ApplicationManager.getApplication().isHeadlessEnvironment();
|
||||
final SmartPointerManager manager = SmartPointerManager.getInstance(project);
|
||||
myStartSmartPointer = useLazy? manager.createLazyPointer(startElement) : manager.createSmartPsiElementPointer(startElement);
|
||||
myEndSmartPointer = startElement == endElement ? null : useLazy ? manager.createLazyPointer(endElement) : manager.createSmartPsiElementPointer(endElement);
|
||||
myStartSmartPointer = manager.createSmartPsiElementPointer(startElement);
|
||||
myEndSmartPointer = startElement == endElement ? null : manager.createSmartPsiElementPointer(endElement);
|
||||
|
||||
myAfterEndOfLine = isAfterEndOfLine;
|
||||
myTextRangeInElement = rangeInElement;
|
||||
|
||||
+1
@@ -270,6 +270,7 @@ public class InjectedLanguageUtil {
|
||||
TextRange hostRange = place.host.getTextRange();
|
||||
if (hostRange.cutOut(place.getRangeInsideHost()).grown(1).contains(hostOffset)) {
|
||||
DocumentWindowImpl document = (DocumentWindowImpl)documentManager.getCachedDocument(injectedPsi);
|
||||
if (document == null) return;
|
||||
int injectedOffset = document.hostToInjected(hostOffset);
|
||||
PsiElement injElement = injectedPsi.findElementAt(injectedOffset);
|
||||
out.set(injElement == null ? injectedPsi : injElement);
|
||||
|
||||
Reference in New Issue
Block a user