com.intellij.psi.augment.PsiAugmentProvider Java Examples

The following examples show how to use com.intellij.psi.augment.PsiAugmentProvider. 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 File: JavaAnalyzer.java    From java2typescript with Apache License 2.0 4 votes vote down vote up
public JavaAnalyzer() {
    Disposable d = () -> {
    };

    CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), ClsCustomNavigationPolicy.EP_NAME, ClsCustomNavigationPolicy.class);



    ExtensionsArea area = Extensions.getRootArea();
    CoreApplicationEnvironment.registerExtensionPoint(area, BinaryFileStubBuilders.EP_NAME, FileTypeExtensionPoint.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, FileContextProvider.EP_NAME, FileContextProvider.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, MetaDataContributor.EP_NAME, MetaDataContributor.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, PsiAugmentProvider.EP_NAME, PsiAugmentProvider.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, JavaMainMethodProvider.EP_NAME, JavaMainMethodProvider.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, ContainerProvider.EP_NAME, ContainerProvider.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, ClassFileDecompilers.EP_NAME, ClassFileDecompilers.Decompiler.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, TypeAnnotationModifier.EP_NAME, TypeAnnotationModifier.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, MetaLanguage.EP_NAME, MetaLanguage.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, JavaModuleSystem.EP_NAME, JavaModuleSystem.class);

    CoreApplicationEnvironment.registerApplicationExtensionPoint(ContainerProvider.EP_NAME, JavaContainerProvider.class);

    appEnvironment = new JavaCoreApplicationEnvironment(d);
    appEnvironment.registerApplicationService(JavaClassSupers.class, new JavaClassSupersImpl());

    javaEnvironment = new JavaCoreProjectEnvironment(d, appEnvironment) {
        @Override
        protected void preregisterServices() {
            ExtensionsArea a = Extensions.getArea(myProject);
            CoreApplicationEnvironment.registerExtensionPoint(a, PsiTreeChangePreprocessor.EP_NAME, PsiTreeChangePreprocessor.class);
            CoreApplicationEnvironment.registerExtensionPoint(a, PsiElementFinder.EP_NAME, PsiElementFinder.class);
            CoreApplicationEnvironment.registerExtensionPoint(a, JvmElementProvider.EP_NAME, JvmElementProvider.class);
        }
        @Override
        protected void registerJavaPsiFacade() {
            JavaFileManager javaFileManager = getProject().getComponent(JavaFileManager.class);
            CoreJavaFileManager coreJavaFileManager = (CoreJavaFileManager) javaFileManager;
            ServiceManager.getService(getProject(), CoreJavaFileManager.class);
            getProject().registerService(CoreJavaFileManager.class, coreJavaFileManager);
            getProject().registerService(PsiNameHelper.class, PsiNameHelperImpl.getInstance());
            PsiElementFinder finder = new PsiElementFinderImpl(getProject(), coreJavaFileManager);
            ExtensionsArea area = Extensions.getArea(getProject());
            area.getExtensionPoint(PsiElementFinder.EP_NAME).registerExtension(finder);
            super.registerJavaPsiFacade();
        }
    };
    System.setProperty("idea.use.native.fs.for.win", "false");
}