Search in sources :

Example 1 with ScalaJavaLikeLanguage

use of com.google.idea.blaze.scala.sync.source.ScalaJavaLikeLanguage in project intellij by bazelbuild.

the class ScalaSourceDirectoryCalculatorTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    super.initTest(applicationServices, projectServices);
    mockInputStreamProvider = new MockInputStreamProvider();
    applicationServices.register(InputStreamProvider.class, mockInputStreamProvider);
    applicationServices.register(JavaSourcePackageReader.class, new JavaSourcePackageReader());
    applicationServices.register(PackageManifestReader.class, new PackageManifestReader());
    applicationServices.register(PrefetchService.class, new MockPrefetchService());
    ExtensionPoint<JavaLikeLanguage> javaLikeLanguages = registerExtensionPoint(JavaLikeLanguage.EP_NAME, JavaLikeLanguage.class);
    javaLikeLanguages.registerExtension(new JavaLikeLanguage.Java());
    javaLikeLanguages.registerExtension(new ScalaJavaLikeLanguage());
    context.addOutputSink(IssueOutput.class, issues);
    sourceDirectoryCalculator = new SourceDirectoryCalculator();
}
Also used : MockPrefetchService(com.google.idea.blaze.base.prefetch.MockPrefetchService) MockInputStreamProvider(com.google.idea.blaze.base.io.MockInputStreamProvider) ScalaJavaLikeLanguage(com.google.idea.blaze.scala.sync.source.ScalaJavaLikeLanguage) ScalaJavaLikeLanguage(com.google.idea.blaze.scala.sync.source.ScalaJavaLikeLanguage)

Example 2 with ScalaJavaLikeLanguage

use of com.google.idea.blaze.scala.sync.source.ScalaJavaLikeLanguage in project intellij by bazelbuild.

the class BlazeScalaWorkspaceImporterTest method initTest.

@Override
// False positive on getDeclaredPackageOfJavaFile.
@SuppressWarnings("FunctionalInterfaceClash")
protected void initTest(@NotNull Container applicationServices, @NotNull Container projectServices) {
    super.initTest(applicationServices, projectServices);
    context = new BlazeContext();
    context.addOutputSink(IssueOutput.class, errorCollector);
    registerExtensionPoint(BlazeJavaSyncAugmenter.EP_NAME, BlazeJavaSyncAugmenter.class);
    BlazeImportSettingsManager importSettingsManager = new BlazeImportSettingsManager();
    importSettingsManager.setImportSettings(new BlazeImportSettings("", "", "", "", BuildSystem.Blaze));
    projectServices.register(BlazeImportSettingsManager.class, importSettingsManager);
    applicationServices.register(PrefetchService.class, new MockPrefetchService());
    applicationServices.register(PackageManifestReader.class, new PackageManifestReader());
    // will silently fall back to FilePathJavaPackageReader
    applicationServices.register(JavaSourcePackageReader.class, new JavaSourcePackageReader() {

        @Nullable
        @Override
        public String getDeclaredPackageOfJavaFile(BlazeContext context, ArtifactLocationDecoder artifactLocationDecoder, SourceArtifact sourceArtifact) {
            return null;
        }
    });
    ExtensionPoint<JavaLikeLanguage> javaLikeLanguages = registerExtensionPoint(JavaLikeLanguage.EP_NAME, JavaLikeLanguage.class);
    javaLikeLanguages.registerExtension(new JavaLikeLanguage.Java());
    javaLikeLanguages.registerExtension(new ScalaJavaLikeLanguage());
}
Also used : BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) BlazeImportSettings(com.google.idea.blaze.base.settings.BlazeImportSettings) JavaLikeLanguage(com.google.idea.blaze.java.sync.source.JavaLikeLanguage) ScalaJavaLikeLanguage(com.google.idea.blaze.scala.sync.source.ScalaJavaLikeLanguage) PackageManifestReader(com.google.idea.blaze.java.sync.source.PackageManifestReader) ScalaJavaLikeLanguage(com.google.idea.blaze.scala.sync.source.ScalaJavaLikeLanguage) SourceArtifact(com.google.idea.blaze.java.sync.source.SourceArtifact) BlazeContext(com.google.idea.blaze.base.scope.BlazeContext) MockPrefetchService(com.google.idea.blaze.base.prefetch.MockPrefetchService) ArtifactLocationDecoder(com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder) JavaSourcePackageReader(com.google.idea.blaze.java.sync.source.JavaSourcePackageReader) Nullable(javax.annotation.Nullable)

Aggregations

MockPrefetchService (com.google.idea.blaze.base.prefetch.MockPrefetchService)2 ScalaJavaLikeLanguage (com.google.idea.blaze.scala.sync.source.ScalaJavaLikeLanguage)2 MockInputStreamProvider (com.google.idea.blaze.base.io.MockInputStreamProvider)1 BlazeContext (com.google.idea.blaze.base.scope.BlazeContext)1 BlazeImportSettings (com.google.idea.blaze.base.settings.BlazeImportSettings)1 BlazeImportSettingsManager (com.google.idea.blaze.base.settings.BlazeImportSettingsManager)1 ArtifactLocationDecoder (com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder)1 JavaLikeLanguage (com.google.idea.blaze.java.sync.source.JavaLikeLanguage)1 JavaSourcePackageReader (com.google.idea.blaze.java.sync.source.JavaSourcePackageReader)1 PackageManifestReader (com.google.idea.blaze.java.sync.source.PackageManifestReader)1 SourceArtifact (com.google.idea.blaze.java.sync.source.SourceArtifact)1 Nullable (javax.annotation.Nullable)1