diff --git a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/JetCoreEnvironment.java b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/JetCoreEnvironment.java index d65add35fcd..90ddc553e07 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/JetCoreEnvironment.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/JetCoreEnvironment.java @@ -223,19 +223,18 @@ public class JetCoreEnvironment { MockProject project = projectEnvironment.getProject(); project.registerService(JetScriptDefinitionProvider.class, new JetScriptDefinitionProvider()); - CliLightClassGenerationSupport cliLightClassGenerationSupport = new CliLightClassGenerationSupport(); - project.registerService(LightClassGenerationSupport.class, cliLightClassGenerationSupport); - project.registerService(CliLightClassGenerationSupport.class, cliLightClassGenerationSupport); project.registerService(KotlinLightClassForPackage.FileStubCache.class, new KotlinLightClassForPackage.FileStubCache(project)); - - Extensions.getArea(project) - .getExtensionPoint(PsiElementFinder.EP_NAME) - .registerExtension(new JavaElementFinder(project, cliLightClassGenerationSupport)); } private static void registerProjectServicesForCLI(@NotNull JavaCoreProjectEnvironment projectEnvironment) { MockProject project = projectEnvironment.getProject(); project.registerService(CoreJavaFileManager.class, (CoreJavaFileManager) ServiceManager.getService(project, JavaFileManager.class)); + CliLightClassGenerationSupport cliLightClassGenerationSupport = new CliLightClassGenerationSupport(); + project.registerService(LightClassGenerationSupport.class, cliLightClassGenerationSupport); + project.registerService(CliLightClassGenerationSupport.class, cliLightClassGenerationSupport); + Extensions.getArea(project) + .getExtensionPoint(PsiElementFinder.EP_NAME) + .registerExtension(new JavaElementFinder(project, cliLightClassGenerationSupport)); } @NotNull