static void reparseOnRemoved(Collection<FileImpl> removedPhysically, Collection<FileImpl> removedAsExcluded, ProjectBase project) { if (TRACE) { LOG.log(Level.INFO, "reparseOnRemoved \nPHYSICAL:{0}\nEXCLUDED:{1}", new Object[] {toString(removedPhysically), toString(removedAsExcluded)}); } CndFileUtils.clearFileExistenceCache(); Set<CsmFile> topParents = new HashSet<>(); Set<CsmFile> coherence = new HashSet<>(); // physically removed can cause broken #includes => we need to reparse parent and coherence files for (FileImpl impl : removedPhysically) { if (impl != null) { topParents.addAll(project.getGraph().getTopParentFiles(impl).getCompilationUnits()); coherence.addAll(project.getGraph().getCoherenceFiles(impl).getCoherenceFiles()); project.getGraph().removeFile(impl); topParents.remove(impl); coherence.remove(impl); } } // excluded are just removed, because their model excluded from model // but physically they could be in place, no need to reparse those who includes them for (FileImpl impl : removedAsExcluded) { project.getGraph().removeFile(impl); topParents.remove(impl); coherence.remove(impl); } addToReparse(project, topParents, coherence, false); }
public final void onFileObjectExternalCreate(Collection<FileObject> files) { try { ParserQueue.instance().onStartAddingProjectFiles(this); CndFileUtils.clearFileExistenceCache(); // #196664 - Code Model ignores the generated files" // when external file was created and assigned to this project => // create csm file for it if possible List<NativeFileItem> nativeFileItems = new ArrayList<>(); // Try to find native file if (getPlatformProject() instanceof NativeProject) { NativeProject prj = (NativeProject) getPlatformProject(); for (FileObject fo : files) { if (prj != null) { NativeFileItem item = prj.findFileItem(fo); if (item != null) { nativeFileItems.add(item); } } } } // schedule reparse like added NFI if (!nativeFileItems.isEmpty()) { onFileItemsAdded(nativeFileItems); } // allow to fix broken includes DeepReparsingUtils.reparseOnAdded(nativeFileItems, this); } finally { ParserQueue.instance().onEndAddingProjectFiles(this); } }
@Override public void scheduleReparse(Collection<CsmProject> projects) { CndFileUtils.clearFileExistenceCache(); ParserQueue.instance().clearParseWatch(); APTFileCacheManager.invalidateAll();
private void cleanCaches() { TextCache.getManager().dispose(); FilePathCache.getManager().dispose(); QualifiedNameCache.getManager().dispose(); NameCache.getManager().dispose(); UniqueNameCache.getManager().dispose(); FileNameCache.getManager().dispose(); ProjectNameCache.getManager().dispose(); APTDriver.close(); APTFileCacheManager.close(); UIDManager.instance().dispose(); KeyManager.instance().dispose(); CndFileUtils.clearFileExistenceCache(); APTFileCacheManager.invalidateAll(); APTSystemStorage.dispose(); }