com.intellij.psi.FileViewProvider



API Populatity

3 Client projects

Project: com.intellij

Package: com.intellij.psi

Project JetBrains/intellij-community in file ...ellij.openapi.editor.actions.moveUpDown.Mover.java (2007-10-01)
@@ -4,6 +4,7 @@ import com.intellij.openapi.editor.*;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.TextRange;
 import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.psi.FileViewProvider;
 import com.intellij.psi.PsiDocumentManager;
 import com.intellij.psi.PsiFile;
 import com.intellij.psi.codeStyle.CodeStyleManager;
@@ -110,7 +111,9 @@ abstract class Mover {
       while(!lineContainsNonSpaces(document, realLine2) && realLine2 > realLine1) realLine2--;
 
       try {
-        codeStyleManager.adjustLineIndent(file, new TextRange(document.getLineStartOffset(realLine1), document.getLineStartOffset(realLine2)));
+        final FileViewProvider provider = file.getViewProvider();
+        PsiFile rootToAdjustIndentIn = provider.getPsi(provider.getBaseLanguage());
+        codeStyleManager.adjustLineIndent(rootToAdjustIndentIn, new TextRange(document.getLineStartOffset(realLine1), document.getLineStartOffset(realLine2)));
       } catch (IncorrectOperationException ex) {
         throw new RuntimeException(ex);
       }
Project JetBrains/intellij-community in file ...odeInsight.daemon.impl.UpdateHighlightersUtil.java (2014-09-09)
@@ -33,8 +33,6 @@ import com.intellij.openapi.editor.impl.RedBlackTree;
 import com.intellij.openapi.editor.markup.*;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.*;
-import com.intellij.openapi.vfs.NonPhysicalFileSystem;
-import com.intellij.psi.FileViewProvider;
 import com.intellij.psi.PsiDocumentManager;
 import com.intellij.psi.PsiFile;
 import com.intellij.util.Consumer;
@@ -214,8 +212,7 @@ public class UpdateHighlightersUtil {
         if (!atStart) return true;
         if (!info.isFromInjection() && info.getEndOffset() < document.getTextLength() && (info.getEndOffset() <= startOffset || info.getStartOffset()>=endOffset)) return true; // injections are oblivious to restricting range
 
-        FileViewProvider provider = psiFile.getViewProvider();
-        if (info.isFileLevelAnnotation() && (provider.isPhysical() || provider.getVirtualFile().getFileSystem() instanceof NonPhysicalFileSystem)) {
+        if (info.isFileLevelAnnotation()) {
           codeAnalyzer.addFileLevelHighlight(project, group, info, psiFile);
           changed[0] = true;
           return true;
Project JetBrains/intellij-community in file ....impl.source.jsp.jspJava.OuterLanguageElement.java (2006-02-02)
@@ -8,6 +8,8 @@ import com.intellij.psi.jsp.JspFile;
 import com.intellij.psi.tree.IElementType;
 import com.intellij.psi.xml.XmlTag;
 import com.intellij.psi.xml.XmlText;
+import com.intellij.psi.FileViewProvider;
+import com.intellij.psi.util.PsiUtil;
 import com.intellij.util.CharTable;
 
 import java.util.HashSet;
@@ -48,7 +50,8 @@ public class OuterLanguageElement extends LeafPsiElement {
   public XmlTag[] getIncludeDirectivesInScope() {
     if(myIncludes != null) return myIncludes;
     final TextRange textRange = getTextRange();
-    final JspFile jspFile = (JspFile)getContainingFile();
+    final FileViewProvider viewProvider = getContainingFile().getViewProvider();
+    final JspFile jspFile = PsiUtil.getJspFile(viewProvider.getPsi(viewProvider.getBaseLanguage()));
     final XmlTag[] directiveTags = jspFile.getDirectiveTags(JspDirectiveKind.INCLUDE, false);
     final Set<XmlTag> includeDirectives = new HashSet<XmlTag>();
     for (final XmlTag directiveTag : directiveTags) {