create VfsData manually, no need for app component

This commit is contained in:
peter
2018-06-04 12:41:56 +02:00
parent bcb6a0ede7
commit 839b903dbb
3 changed files with 3 additions and 9 deletions
@@ -101,10 +101,6 @@ public class VfsData {
});
}
public static VfsData getInstance() {
return ApplicationManager.getApplication().getComponent(VfsData.class);
}
private void killInvalidatedFiles() {
synchronized (myDeadMarker) {
if (!myDyingIds.isEmpty()) {
@@ -68,6 +68,7 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone
private final AtomicBoolean myShutDown = new AtomicBoolean(false);
private final AtomicInteger myStructureModificationCount = new AtomicInteger();
private final BulkFileListener myPublisher;
private final VfsData myVfsData = new VfsData();
public PersistentFSImpl(@NotNull MessageBus bus) {
ShutDownTracker.getInstance().registerShutdownTask(this::performShutdown);
@@ -994,7 +995,7 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone
int rootId = FSRecords.findRootRecord(rootUrl);
VfsData.Segment segment = VfsData.getInstance().getSegment(rootId, true);
VfsData.Segment segment = myVfsData.getSegment(rootId, true);
VfsData.DirectoryData directoryData = new VfsData.DirectoryData();
VirtualFileSystemEntry newRoot = new FsRoot(rootId, segment, directoryData, fs, rootName, StringUtil.trimTrailing(rootPath, '/'));
@@ -1062,7 +1063,7 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone
@Override
public NewVirtualFile findFileByIdIfCached(final int id) {
return VfsData.getInstance().hasLoadedFile(id) ? findFileById(id) : null;
return myVfsData.hasLoadedFile(id) ? findFileById(id) : null;
}
@Override
@@ -24,9 +24,6 @@
<interface-class>com.intellij.openapi.vfs.newvfs.ManagingFS</interface-class>
<implementation-class>com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl</implementation-class>
</component>
<component>
<implementation-class>com.intellij.openapi.vfs.newvfs.impl.VfsData</implementation-class>
</component>
<component>
<interface-class>com.intellij.openapi.vfs.LocalFileSystem</interface-class>