All IDE code uses VirtualFileFinder instead of KotlinClassFinder + proper service discovery

This commit is contained in:
Andrey Breslav
2014-01-07 20:29:18 +04:00
parent b3f4527bb8
commit 8f8b85101e
10 changed files with 22 additions and 21 deletions
@@ -87,7 +87,7 @@ public class InjectorForJavaDescriptorResolver {
this.psiBasedExternalAnnotationResolver = new PsiBasedExternalAnnotationResolver();
this.javaDescriptorResolver = new JavaDescriptorResolver();
this.javaPackageFragmentProvider = new JavaPackageFragmentProviderImpl();
this.virtualFileFinder = com.intellij.openapi.components.ServiceManager.getService(project, VirtualFileFinder.class);
this.virtualFileFinder = org.jetbrains.jet.lang.resolve.kotlin.VirtualFileFinder.SERVICE.getInstance(project);
this.module = org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM.createJavaModule("<fake-jdr-module>");
this.javaAnnotationResolver = new JavaAnnotationResolver();
this.javaAnnotationArgumentResolver = new JavaAnnotationArgumentResolver();
@@ -159,7 +159,7 @@ public class InjectorForTopDownAnalyzerForJvm implements InjectorForTopDownAnaly
this.mutablePackageFragmentProvider = new MutablePackageFragmentProvider(getModuleDescriptor());
this.namespaceFactory = new NamespaceFactoryImpl();
this.javaPackageFragmentProvider = new JavaPackageFragmentProviderImpl();
this.virtualFileFinder = com.intellij.openapi.components.ServiceManager.getService(project, VirtualFileFinder.class);
this.virtualFileFinder = org.jetbrains.jet.lang.resolve.kotlin.VirtualFileFinder.SERVICE.getInstance(project);
this.declarationResolver = new DeclarationResolver();
this.annotationResolver = new AnnotationResolver();
this.callResolver = new CallResolver();
@@ -16,12 +16,21 @@
package org.jetbrains.jet.lang.resolve.kotlin;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.resolve.name.FqName;
public interface VirtualFileFinder extends KotlinClassFinder {
class SERVICE {
@NotNull
public static VirtualFileFinder getInstance(@NotNull Project project) {
return ServiceManager.getService(project, VirtualFileFinder.class);
}
}
// TODO: support scope
@Nullable
VirtualFile findVirtualFile(@NotNull FqName className);