All IDE code uses VirtualFileFinder instead of KotlinClassFinder + proper service discovery
This commit is contained in:
+1
-1
@@ -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();
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
+9
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user