Java Code Examples for com.intellij.openapi.vfs.pointers.VirtualFilePointer

The following examples show how to use com.intellij.openapi.vfs.pointers.VirtualFilePointer. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: consulo   Source File: ContentEntryImpl.java    License: Apache License 2.0 6 votes vote down vote up
private List<ContentFolder> getFolders0(Predicate<ContentFolderTypeProvider> predicate) {
  List<ContentFolder> list = new ArrayList<>(myContentFolders.size());
  for (ContentFolder contentFolder : myContentFolders) {
    if (predicate.apply(contentFolder.getType())) {
      list.add(contentFolder);
    }
  }

  Module module = getModuleRootLayer().getModule();
  if(module.getModuleDirUrl() == null) {
    return list;
  }

  if (predicate.apply(ExcludedContentFolderTypeProvider.getInstance())) {
    for (DirectoryIndexExcludePolicy excludePolicy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(getRootModel().getProject())) {
      final VirtualFilePointer[] files = excludePolicy.getExcludeRootsForModule(myModuleRootLayer);
      for (VirtualFilePointer file : files) {
        list.add(new LightContentFolderImpl(file, ExcludedContentFolderTypeProvider.getInstance(), this));
      }
    }
  }
  return list;
}
 
Example 2
Source Project: consulo   Source File: LibraryImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public List<String> getInvalidRootUrls(@Nonnull OrderRootType type) {
  if (myDisposed) return Collections.emptyList();

  VirtualFilePointerContainer container = myRoots.get(type);
  final List<VirtualFilePointer> pointers = container == null ? Collections.emptyList() : container.getList();
  List<String> invalidPaths = null;
  for (VirtualFilePointer pointer : pointers) {
    if (!pointer.isValid()) {
      if (invalidPaths == null) {
        invalidPaths = new SmartList<>();
      }
      invalidPaths.add(pointer.getUrl());
    }
  }
  return ContainerUtil.notNullize(invalidPaths);
}
 
Example 3
Source Project: consulo   Source File: LibraryImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public boolean removeRoot(@Nonnull String url, @Nonnull OrderRootType rootType) {
  checkDisposed();
  LOG.assertTrue(isWritable());

  final VirtualFilePointerContainer container = myRoots.get(rootType);
  final VirtualFilePointer byUrl = container == null ? null : container.findByUrl(url);
  if (byUrl != null) {
    container.remove(byUrl);
    if (myExcludedRoots != null) {
      for (String excludedRoot : myExcludedRoots.getUrls()) {
        if (!isUnderRoots(excludedRoot)) {
          VirtualFilePointer pointer = myExcludedRoots.findByUrl(excludedRoot);
          if (pointer != null) {
            myExcludedRoots.remove(pointer);
          }
        }
      }
    }
    container.removeJarDirectory(url);
    return true;
  }
  return false;
}
 
Example 4
Source Project: consulo   Source File: ProjectRootManagerComponent.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void beforeValidityChanged(@Nonnull VirtualFilePointer[] pointers) {
  if (!myProject.isDisposed()) {
    if (myInsideRefresh == 0) {
      if (affectsRoots(pointers)) {
        beforeRootsChange(false);
        if (myDoLogCachesUpdate) LOG.debug(new Throwable(pointers.length > 0 ? pointers[0].getPresentableUrl() : ""));
      }
    }
    else if (!myPointerChangesDetected) {
      //this is the first pointer changing validity
      if (affectsRoots(pointers)) {
        myPointerChangesDetected = true;
        myProject.getMessageBus().syncPublisher(ProjectTopics.PROJECT_ROOTS).beforeRootsChange(new ModuleRootEventImpl(myProject, false));
        if (myDoLogCachesUpdate) LOG.debug(new Throwable(pointers.length > 0 ? pointers[0].getPresentableUrl() : ""));
      }
    }
  }
}
 
Example 5
Source Project: consulo   Source File: BackgroundTaskByVfsChangeTaskImpl.java    License: Apache License 2.0 6 votes vote down vote up
public BackgroundTaskByVfsChangeTaskImpl(@Nonnull Project project,
                                         @Nonnull VirtualFilePointer pointer,
                                         @Nonnull BackgroundTaskByVfsParameters parameters,
                                         @Nonnull String providerName,
                                         @Nonnull String name,
                                         @Nullable BackgroundTaskByVfsChangeProvider provider,
                                         @Nonnull BackgroundTaskByVfsChangeManagerImpl manager) {
  myProject = project;
  myParameters = parameters;
  myVirtualFilePointer = pointer;

  myProviderName = providerName;
  myName = name;
  myProvider = provider;
  myManager = manager;
}
 
Example 6
Source Project: consulo   Source File: VirtualFilePointerTest.java    License: Apache License 2.0 6 votes vote down vote up
public void testMultipleNotifications() throws Exception {
  final File tempDir = createTempDirectory();
  final File file_f1 = new File(tempDir, "f1");
  final File file_f2 = new File(tempDir, "f2");
  final LoggingListener listener = new LoggingListener();
  final VirtualFilePointer pointer_f1 = createPointerByFile(file_f1, listener);
  final VirtualFilePointer pointer_f2 = createPointerByFile(file_f2, listener);
  assertFalse(pointer_f1.isValid());
  assertFalse(pointer_f2.isValid());
  file_f1.createNewFile();
  file_f2.createNewFile();
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      LocalFileSystem.getInstance().refresh(false);
    }
  });
  assertEquals("[before:false:false, after:true:true]", listener.getLog().toString());
}
 
Example 7
Source Project: consulo   Source File: VirtualFilePointerTest.java    License: Apache License 2.0 6 votes vote down vote up
private static void stressRead(@Nonnull final VirtualFilePointer pointer) {
  boolean b = JobLauncher.getInstance().invokeConcurrentlyUnderProgress(Collections.nCopies(10, null), null, false, new Processor<Object>() {
    @Override
    public boolean process(Object o) {
      ApplicationManager.getApplication().runReadAction(new Runnable() {
        @Override
        public void run() {
          VirtualFile file = pointer.getFile();
          if (file != null && !file.isValid()) {
            throw new IncorrectOperationException("I've caught it. I am that good");
          }
        }
      });

      return true;
    }
  });
  assertTrue(b);
}
 
Example 8
Source Project: consulo   Source File: VirtualFilePointerTest.java    License: Apache License 2.0 6 votes vote down vote up
public void testTwoPointersBecomeOneAfterFileRenamedUnderTheOtherName() throws IOException {
  final File tempDir = createTempDirectory();
  final File f1 = new File(tempDir, "f1");
  boolean created = f1.createNewFile();
  assertTrue(created);

  final String url1 = VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, f1.getCanonicalPath().replace(File.separatorChar, '/'));
  final VirtualFile vFile1 = refreshAndFind(url1);

  VirtualFilePointer pointer1 = myVirtualFilePointerManager.create(url1, disposable, null);
  assertTrue(pointer1.isValid());
  String url2 = VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, tempDir.getCanonicalPath().replace(File.separatorChar, '/')+"/f2");
  VirtualFilePointer pointer2 = myVirtualFilePointerManager.create(url2, disposable, null);
  assertFalse(pointer2.isValid());

  rename(vFile1, "f2");

  assertTrue(pointer1.isValid());
  assertTrue(pointer2.isValid());
}
 
Example 9
Source Project: consulo   Source File: ModuleCompilerPathsManagerImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Override
@Nullable
public String getCompilerOutputUrl(@Nonnull ContentFolderTypeProvider contentFolderType) {
  if (!myInheritOutput) {
    VirtualFilePointer virtualFilePointer = myVirtualFilePointers.get(contentFolderType.getId());
    if (virtualFilePointer != null) {
      return virtualFilePointer.getUrl();
    }
  }

  String backUrl = myCompilerConfiguration.getCompilerOutputUrl() + "/" + contentFolderType.getId().toLowerCase() + "/" + myModule.getName();

  VirtualFile compilerOutput = myCompilerConfiguration.getCompilerOutput();
  if (compilerOutput == null) {
    return backUrl;
  }
  VirtualFile outDir = compilerOutput.findFileByRelativePath(contentFolderType.getId().toLowerCase() + "/" + myModule.getName());
  return outDir != null ? outDir.getUrl() : backUrl;
}
 
Example 10
Source Project: consulo   Source File: ModuleCompilerPathsManagerImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Nullable
@Override
public VirtualFile getCompilerOutput(@Nonnull ContentFolderTypeProvider contentFolderType) {
  if (!myInheritOutput) {
    VirtualFilePointer virtualFilePointer = myVirtualFilePointers.get(contentFolderType.getId());
    if (virtualFilePointer != null) {
      return virtualFilePointer.getFile();
    }
  }

  VirtualFile compilerOutput = myCompilerConfiguration.getCompilerOutput();
  if (compilerOutput == null) {
    return null;
  }
  VirtualFile outDir = compilerOutput.findFileByRelativePath(contentFolderType.getId().toLowerCase() + "/" + myModule.getName());
  return outDir != null ? outDir : null;
}
 
Example 11
Source Project: consulo   Source File: ModuleCompilerPathsManagerImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Nullable
@Override
public Element getState() {
  if (myInheritOutput) {
    return null;
  }

  Element moduleElement = new Element(MODULE_OUTPUT_TAG);
  moduleElement.setAttribute(NAME, myModule.getName());
  if (!isExcludeOutput()) {
    moduleElement.setAttribute(EXCLUDE, String.valueOf(isExcludeOutput()));
  }

  for (Map.Entry<String, VirtualFilePointer> tempEntry : myVirtualFilePointers.entrySet()) {
    final Element elementForOutput = createElementForOutput(tempEntry.getValue());
    elementForOutput.setAttribute(TYPE, tempEntry.getKey());
    moduleElement.addContent(elementForOutput);
  }

  return moduleElement;
}
 
Example 12
Source Project: consulo   Source File: HistoryEntry.java    License: Apache License 2.0 6 votes vote down vote up
@Nonnull
public static HistoryEntry createHeavy(@Nonnull Project project,
                                       @Nonnull VirtualFile file,
                                       @Nonnull FileEditorProvider[] providers,
                                       @Nonnull FileEditorState[] states,
                                       @Nonnull FileEditorProvider selectedProvider) {
  if (project.isDisposed()) return createLight(file, providers, states, selectedProvider);

  Disposable disposable = Disposable.newDisposable();
  VirtualFilePointer pointer = VirtualFilePointerManager.getInstance().create(file, disposable, null);

  HistoryEntry entry = new HistoryEntry(pointer, selectedProvider, disposable);
  for (int i = 0; i < providers.length; i++) {
    FileEditorProvider provider = providers[i];
    FileEditorState state = states[i];
    if (provider != null && state != null) {
      entry.putState(provider, state);
    }
  }
  return entry;
}
 
Example 13
Source Project: consulo   Source File: VirtualFilePointerManagerImpl.java    License: Apache License 2.0 6 votes vote down vote up
private synchronized void assertAllPointersDisposed() {
  List<VirtualFilePointer> leaked = new ArrayList<>(dumpAllPointers());
  Collections.sort(leaked, Comparator.comparing(VirtualFilePointer::getUrl));
  for (VirtualFilePointer pointer : leaked) {
    try {
      ((VirtualFilePointerImpl)pointer).getTraceableDisposable().throwDisposalError("Not disposed pointer: " + pointer);
    }
    finally {
      ((VirtualFilePointerImpl)pointer).dispose();
    }
  }

  synchronized (myContainers) {
    if (!myContainers.isEmpty()) {
      VirtualFilePointerContainerImpl container = myContainers.iterator().next();
      container.getTraceableDisposable().throwDisposalError("Not disposed container");
    }
  }
}
 
Example 14
Source Project: consulo   Source File: ProjectRootManagerComponent.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void beforeValidityChanged(@Nonnull VirtualFilePointer[] pointers) {
  if (myProject.isDisposed()) {
    return;
  }

  if (myInsideRefresh == 0) {
    beforeRootsChange(false);
    if (LOG_CACHES_UPDATE || LOG.isDebugEnabled()) {
      LOG.debug(new Throwable(pointers.length > 0 ? pointers[0].getPresentableUrl() : ""));
    }
  }
  else if (!myPointerChangesDetected) {
    //this is the first pointer changing validity
    myPointerChangesDetected = true;
    myProject.getMessageBus().syncPublisher(ProjectTopics.PROJECT_ROOTS).beforeRootsChange(new ModuleRootEventImpl(myProject, false));
    if (LOG_CACHES_UPDATE || LOG.isDebugEnabled()) {
      LOG.debug(new Throwable(pointers.length > 0 ? pointers[0].getPresentableUrl() : ""));
    }
  }
}
 
Example 15
Source Project: consulo   Source File: FileTreeNode.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected boolean acceptFilter(Pair<PackageSetBase, NamedScopesHolder> filter, boolean showOnlyFilteredItems) {
  try {
    VirtualFilePointer filePointer = getFilePointer();
    if (!filePointer.isValid()) {
      return false;
    }
    VirtualFile file = filePointer.getFile();
    if (file != null && file.isValid() && filter.first.contains(file, filter.second)) {
      applyFilter(true);
      return true;
    }
  }
  catch (Throwable e) {
    // TODO: catch and ignore exceptions: see to FilePatternPackageSet
    // sometimes for new file DirectoryFileIndex.getContentRootForFile() return random path
  }
  return false;
}
 
Example 16
Source Project: consulo   Source File: ExcludeCompilerOutputPolicy.java    License: Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public VirtualFilePointer[] getExcludeRootsForModule(@Nonnull final ModuleRootLayer moduleRootLayer) {
  ModuleCompilerPathsManager manager = ModuleCompilerPathsManager.getInstance(moduleRootLayer.getModule());
  List<VirtualFilePointer> result = new ArrayList<VirtualFilePointer>(3);

  if (manager.isInheritedCompilerOutput()) {
    final VirtualFilePointer compilerOutputPointer = CompilerConfiguration.getInstance(myProject).getCompilerOutputPointer();
    for (ContentEntry contentEntry : moduleRootLayer.getContentEntries()) {
      if (compilerOutputPointer.getUrl().contains(contentEntry.getUrl())) {
        result.add(compilerOutputPointer);
      }
    }
  }
  else {
    if (!manager.isExcludeOutput()) {
      return VirtualFilePointer.EMPTY_ARRAY;
    }

    for (ContentFolderTypeProvider contentFolderType : ContentFolderTypeProvider.filter(ContentFolderScopes.productionAndTest())) {
      result.add(manager.getCompilerOutputPointer(contentFolderType));
    }
  }
  return result.isEmpty() ? VirtualFilePointer.EMPTY_ARRAY : result.toArray(new VirtualFilePointer[result.size()]);
}
 
Example 17
Source Project: consulo   Source File: UpdateInfoTree.java    License: Apache License 2.0 6 votes vote down vote up
private void step() {
  myNext = null;
  while (myEnum.hasMoreElements()) {
    final Object o = myEnum.nextElement();
    if (o instanceof FileTreeNode) {
      final FileTreeNode treeNode = (FileTreeNode)o;
      VirtualFilePointer filePointer = treeNode.getFilePointer();
      if (!filePointer.isValid()) continue;

      myNext = getFilePath(filePointer);
      myStatus = FileStatus.MODIFIED;

      final GroupTreeNode parent = findParentGroupTreeNode(treeNode.getParent());
      if (parent != null) {
        final String id = parent.getFileGroupId();
        if (FileGroup.CREATED_ID.equals(id)) {
          myStatus = FileStatus.ADDED;
        }
        else if (FileGroup.REMOVED_FROM_REPOSITORY_ID.equals(id)) {
          myStatus = FileStatus.DELETED;
        }
      }
      break;
    }
  }
}
 
Example 18
Source Project: consulo   Source File: SdkImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void beforeValidityChanged(@Nonnull VirtualFilePointer[] pointers) {
  //todo check if this sdk is really used in the project
  for (Project project : ProjectManager.getInstance().getOpenProjects()) {
    VirtualFilePointerListener listener = ((ProjectRootManagerImpl)ProjectRootManager.getInstance(project)).getRootsValidityChangedListener();
    listener.beforeValidityChanged(pointers);
  }
}
 
Example 19
Source Project: consulo   Source File: SdkImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void validityChanged(@Nonnull VirtualFilePointer[] pointers) {
  //todo check if this sdk is really used in the project
  for (Project project : ProjectManager.getInstance().getOpenProjects()) {
    VirtualFilePointerListener listener = ((ProjectRootManagerImpl)ProjectRootManager.getInstance(project)).getRootsValidityChangedListener();
    listener.validityChanged(pointers);
  }
}
 
Example 20
Source Project: consulo   Source File: RootsAsVirtualFilePointers.java    License: Apache License 2.0 5 votes vote down vote up
public void removeRoot(@Nonnull String url, @Nonnull OrderRootType type) {
  VirtualFilePointerContainer container = myRoots.get(type);
  VirtualFilePointer pointer = container == null ? null : container.findByUrl(url);
  if (pointer != null) {
    container.remove(pointer);
  }
}
 
Example 21
Source Project: consulo   Source File: ContentFolderImpl.java    License: Apache License 2.0 5 votes vote down vote up
protected ContentFolderImpl(@Nonnull VirtualFilePointer filePointer,
                            @Nullable Map<String, Object> properties,
                            @Nonnull ContentFolderTypeProvider contentFolderType,
                            @Nonnull ContentEntryImpl contentEntry) {
  super(contentEntry.getModuleRootLayer());
  myContentEntry = contentEntry;
  myContentFolderType = contentFolderType;
  myProperties = properties;
  myFilePointer = VirtualFilePointerManager.getInstance().duplicate(filePointer, this, null);
}
 
Example 22
Source Project: consulo   Source File: LibraryImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean removeExcludedRoot(@Nonnull String url) {
  if (myExcludedRoots != null) {
    VirtualFilePointer pointer = myExcludedRoots.findByUrl(url);
    if (pointer != null) {
      myExcludedRoots.remove(pointer);
      return true;
    }
  }
  return false;
}
 
Example 23
Source Project: consulo   Source File: VirtualFilePointerTest.java    License: Apache License 2.0 5 votes vote down vote up
private static String buildMessage(@NonNls final String startMsg, VirtualFilePointer[] pointers) {
  StringBuilder buffer = new StringBuilder(startMsg);
  buffer.append(":");
  for (int i = 0; i < pointers.length; i++) {
    VirtualFilePointer pointer = pointers[i];
    final String s = Boolean.toString(pointer.isValid());
    if (i > 0) buffer.append(":");
    buffer.append(s);
  }
  return buffer.toString();
}
 
Example 24
Source Project: consulo   Source File: VirtualFilePointerTest.java    License: Apache License 2.0 5 votes vote down vote up
public void testMove() throws Exception {
  File tempDirectory = createTempDirectory();
  final File moveTarget = new File(tempDirectory, "moveTarget");
  moveTarget.mkdir();
  final File fileToMove = new File(tempDirectory, "toMove.txt");
  fileToMove.createNewFile();

  final LoggingListener fileToMoveListener = new LoggingListener();
  final VirtualFilePointer fileToMovePointer = createPointerByFile(fileToMove, fileToMoveListener);
  assertTrue(fileToMovePointer.isValid());
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      final VirtualFile virtualFile = getVirtualFile(fileToMove);
      assertTrue(virtualFile.isValid());
      final VirtualFile target = getVirtualFile(moveTarget);
      assertTrue(target.isValid());
      try {
        virtualFile.move(null, target);
      }
      catch (IOException e) {
        fail();
      }
    }
  });
  assertTrue(fileToMovePointer.isValid());
  assertEquals("[]", fileToMoveListener.getLog().toString());
}
 
Example 25
Source Project: consulo   Source File: VirtualFilePointerTest.java    License: Apache License 2.0 5 votes vote down vote up
public void testCreate1() throws Exception {
  final File tempDirectory = createTempDirectory();
  final File fileToCreate = new File(tempDirectory, "toCreate1.txt");
  final LoggingListener fileToCreateListener = new LoggingListener();
  final VirtualFilePointer fileToCreatePointer = createPointerByFile(fileToCreate, fileToCreateListener);
  assertFalse(fileToCreatePointer.isValid());
  fileToCreate.createNewFile();
  final Runnable postRunnable = new Runnable() {
    @Override
    public void run() {
      assertTrue(fileToCreatePointer.isValid());
      assertEquals("[before:false, after:true]", fileToCreateListener.getLog().toString());
      try {
        String expectedUrl = VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, fileToCreate.getCanonicalPath().replace(File.separatorChar, '/'));
        assertEquals(expectedUrl.toUpperCase(), fileToCreatePointer.getUrl().toUpperCase());
      } catch (IOException e) {
        fail();
      }
    }
  };
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      VirtualFileManager.getInstance().syncRefresh();
      final VirtualFile virtualFile = getVirtualFile(tempDirectory);
      virtualFile.refresh(false, true);
    }
  });
  postRunnable.run();
}
 
Example 26
Source Project: consulo   Source File: VirtualFilePointerTest.java    License: Apache License 2.0 5 votes vote down vote up
private VirtualFilePointer createPointerByFile(final File file, final VirtualFilePointerListener fileListener) throws IOException {
  final String url = VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, file.getCanonicalPath().replace(File.separatorChar, '/'));
  final VirtualFile vFile = refreshAndFind(url);
  return vFile == null
         ? myVirtualFilePointerManager.create(url, disposable, fileListener)
         : myVirtualFilePointerManager.create(vFile, disposable, fileListener);
}
 
Example 27
Source Project: consulo   Source File: VirtualFilePointerTest.java    License: Apache License 2.0 5 votes vote down vote up
public void testMultipleCreationOfTheSamePointerPerformance() throws IOException {
  final LoggingListener listener = new LoggingListener();
  final VirtualFilePointer thePointer = myVirtualFilePointerManager.create(VfsUtilCore.pathToUrl("/a/b/c/d/e"), disposable, listener);
  TempFileSystem.getInstance();
  PlatformTestUtil.startPerformanceTest("same url vfp create", 500, new ThrowableRunnable() {
    @Override
    public void run() throws Throwable {
      for (int i=0; i<1000000; i++) {
        VirtualFilePointer pointer = myVirtualFilePointerManager.create(VfsUtilCore.pathToUrl("/a/b/c/d/e"), disposable, listener);
        assertSame(pointer, thePointer);
      }
    }
  }).assertTiming();
}
 
Example 28
Source Project: consulo   Source File: CompilerConfigurationImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public VirtualFilePointer getCompilerOutputPointer() {
  if (myOutputDirPointer == null) {
    return new LightFilePointer(getCompilerOutputUrl());
  }
  return myOutputDirPointer;
}
 
Example 29
Source Project: consulo   Source File: ModuleCompilerPathsManagerImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public VirtualFilePointer getCompilerOutputPointer(@Nonnull ContentFolderTypeProvider contentFolderType) {
  if (myInheritOutput) {
    throw new IllegalArgumentException("Then module is inherit output dir - output virtual file pointer not exists");
  }
  else {
    VirtualFilePointer virtualFilePointer = myVirtualFilePointers.get(contentFolderType.getId());
    if (virtualFilePointer != null) {
      return virtualFilePointer;
    }
    return new LightFilePointer(myCompilerConfiguration.getCompilerOutputUrl() + "/" + contentFolderType.getId().toLowerCase() + "/" + myModule.getName());
  }
}
 
Example 30
Source Project: consulo   Source File: ProjectRootManagerComponent.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void validityChanged(@Nonnull VirtualFilePointer[] pointers) {
  if (myProject.isDisposed()) {
    return;
  }

  if (myInsideRefresh > 0) {
    clearScopesCaches();
  }
  else {
    rootsChanged(false);
  }
}