public interface PsiFile extends PsiFileSystemItem
Iconable.IconFlags, Iconable.LastComputedIcon
Modifier and Type | Field and Description |
---|---|
static PsiFile[] |
EMPTY_ARRAY
The empty array of PSI files which can be reused to avoid unnecessary allocations.
|
ARRAY_FACTORY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
Modifier and Type | Method and Description |
---|---|
default void |
clearCaches()
Invalidate any file-specific cache in this method.
|
PsiDirectory |
getContainingDirectory()
Returns the directory containing the file.
|
default IFileElementType |
getFileElementType() |
FileType |
getFileType()
Returns the file type for the file.
|
long |
getModificationStamp()
Gets the modification stamp value.
|
FileASTNode |
getNode()
Returns the AST node corresponding to the element.
|
PsiFile |
getOriginalFile()
If the file is a non-physical copy of a file, returns the original file which had
been copied.
|
PsiDirectory |
getParent()
Returns the parent of the PSI element.
|
PsiFile [] |
getPsiRoots()
Deprecated.
Use
FileViewProvider.getAllFiles() instead. |
FileViewProvider |
getViewProvider() |
VirtualFile |
getVirtualFile()
Returns the virtual file corresponding to the PSI file.
|
void |
subtreeChanged()
Called by the PSI framework when the contents of the file changes.
|
getName, isDirectory, processChildren
checkSetName
setName
accept, acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNavigationElement, getNextSibling, getOriginalElement, getOwnReferences, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray, toString
getUserData, putUserData
getPresentation
canNavigate, canNavigateToSource, navigate
static final PsiFile[] EMPTY_ARRAY
VirtualFile getVirtualFile()
getVirtualFile
in interface PsiFileSystemItem
null
if the file exists only in memory.PsiDirectory getContainingDirectory()
null
if the file exists only in memory.PsiDirectory getParent()
PsiElement
getParent
in interface PsiElement
getParent
in interface PsiFileSystemItem
long getModificationStamp()
VirtualFile.getModificationStamp()
PsiFile getOriginalFile()
FileType getFileType()
@Deprecated PsiFile [] getPsiRoots()
FileViewProvider.getAllFiles()
instead.this
if the file has only a single language.FileViewProvider getViewProvider()
FileASTNode getNode()
PsiElement
getNode
in interface PsiElement
void subtreeChanged()
clearCaches()
since file contents can be reloaded completely (without any specific subtree change) without this method being called.default void clearCaches()
default IFileElementType getFileElementType()