Java 类com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl 实例源码

项目:intellij-ce-playground    文件:CoreApplicationEnvironment.java   
public CoreApplicationEnvironment(@NotNull Disposable parentDisposable) {
  myParentDisposable = parentDisposable;

  myFileTypeRegistry = new CoreFileTypeRegistry();

  myApplication = createApplication(myParentDisposable);
  ApplicationManager.setApplication(myApplication,
                                    new StaticGetter<FileTypeRegistry>(myFileTypeRegistry),
                                    myParentDisposable);
  myLocalFileSystem = createLocalFileSystem();
  myJarFileSystem = createJarFileSystem();

  Extensions.registerAreaClass(ExtensionAreas.IDEA_PROJECT, null);

  final MutablePicoContainer appContainer = myApplication.getPicoContainer();
  registerComponentInstance(appContainer, FileDocumentManager.class, new MockFileDocumentManagerImpl(new Function<CharSequence, Document>() {
    @Override
    public Document fun(CharSequence charSequence) {
      return new DocumentImpl(charSequence);
    }
  }, null));

  VirtualFileSystem[] fs = {myLocalFileSystem, myJarFileSystem};
  VirtualFileManagerImpl virtualFileManager = new VirtualFileManagerImpl(fs, MessageBusFactory.newMessageBus(myApplication));
  registerComponentInstance(appContainer, VirtualFileManager.class, virtualFileManager);

  registerApplicationService(EncodingManager.class, new CoreEncodingRegistry());
  registerApplicationService(VirtualFilePointerManager.class, createVirtualFilePointerManager());
  registerApplicationService(DefaultASTFactory.class, new CoreASTFactory());
  registerApplicationService(PsiBuilderFactory.class, new PsiBuilderFactoryImpl());
  registerApplicationService(ReferenceProvidersRegistry.class, new ReferenceProvidersRegistryImpl());
  registerApplicationService(StubTreeLoader.class, new CoreStubTreeLoader());
  registerApplicationService(PsiReferenceService.class, new PsiReferenceServiceImpl());
  registerApplicationService(MetaDataRegistrar.class, new MetaRegistry());

  registerApplicationService(ProgressManager.class, createProgressIndicatorProvider());

  registerApplicationService(JobLauncher.class, createJobLauncher());
  registerApplicationService(CodeFoldingSettings.class, new CodeFoldingSettings());
  registerApplicationService(CommandProcessor.class, new CoreCommandProcessor());
  myApplication.registerService(ApplicationInfo.class, ApplicationInfoImpl.class);
}