protected static boolean isFileReadOnly( @NotNull Project project, @NotNull PsiFile file )
{
VirtualFile virtualFile = file.getVirtualFile();
ReadonlyStatusHandler readonlyStatusHandler = ReadonlyStatusHandler.getInstance( project );
ReadonlyStatusHandler.OperationStatus operationStatus =
readonlyStatusHandler.ensureFilesWritable( virtualFile );
return operationStatus.hasReadonlyFiles();
}
@Nullable
private PsiElement findMatchingElement( @NotNull PsiFile file, @NotNull Editor editor )