Search in sources :

Example 41 with BlazeContext

use of com.google.idea.blaze.base.scope.BlazeContext in project intellij by bazelbuild.

the class BlazeJavascriptSyncPluginTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    super.initTest(applicationServices, projectServices);
    ExtensionPointImpl<BlazeSyncPlugin> ep = registerExtensionPoint(BlazeSyncPlugin.EP_NAME, BlazeSyncPlugin.class);
    ep.registerExtension(new BlazeJavascriptSyncPlugin());
    ep.registerExtension(new BlazeSyncPlugin() {

        @Override
        public WorkspaceType getDefaultWorkspaceType() {
            return WorkspaceType.JAVA;
        }
    });
    context = new BlazeContext();
    context.addOutputSink(IssueOutput.class, errorCollector);
}
Also used : BlazeContext(com.google.idea.blaze.base.scope.BlazeContext) WorkspaceType(com.google.idea.blaze.base.model.primitives.WorkspaceType) BlazeSyncPlugin(com.google.idea.blaze.base.sync.BlazeSyncPlugin)

Example 42 with BlazeContext

use of com.google.idea.blaze.base.scope.BlazeContext in project intellij by bazelbuild.

the class BlazeTypescriptSyncPluginTest method initTest.

@Override
protected void initTest(@NotNull Container applicationServices, @NotNull Container projectServices) {
    super.initTest(applicationServices, projectServices);
    ExtensionPointImpl<BlazeSyncPlugin> ep = registerExtensionPoint(BlazeSyncPlugin.EP_NAME, BlazeSyncPlugin.class);
    ep.registerExtension(new BlazeTypescriptSyncPlugin());
    // add java, because we need at least one WorkspaceType available.
    ep.registerExtension(new BlazeSyncPlugin() {

        @Override
        public ImmutableList<WorkspaceType> getSupportedWorkspaceTypes() {
            return ImmutableList.of(WorkspaceType.JAVA);
        }

        @Override
        public Set<LanguageClass> getSupportedLanguagesInWorkspace(WorkspaceType workspaceType) {
            return ImmutableSet.of(LanguageClass.JAVA);
        }

        @Override
        public WorkspaceType getDefaultWorkspaceType() {
            return WorkspaceType.JAVA;
        }
    });
    context = new BlazeContext();
    context.addOutputSink(IssueOutput.class, errorCollector);
}
Also used : BlazeContext(com.google.idea.blaze.base.scope.BlazeContext) WorkspaceType(com.google.idea.blaze.base.model.primitives.WorkspaceType) ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet) ImmutableList(com.google.common.collect.ImmutableList) BlazeSyncPlugin(com.google.idea.blaze.base.sync.BlazeSyncPlugin)

Aggregations

BlazeContext (com.google.idea.blaze.base.scope.BlazeContext)42 ImmutableList (com.google.common.collect.ImmutableList)18 Nullable (javax.annotation.Nullable)18 ProjectViewSet (com.google.idea.blaze.base.projectview.ProjectViewSet)17 List (java.util.List)16 WorkspaceRoot (com.google.idea.blaze.base.model.primitives.WorkspaceRoot)15 Project (com.intellij.openapi.project.Project)15 File (java.io.File)15 Set (java.util.Set)15 Lists (com.google.common.collect.Lists)13 BlazeSyncPlugin (com.google.idea.blaze.base.sync.BlazeSyncPlugin)12 ArtifactLocationDecoder (com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder)12 Logger (com.intellij.openapi.diagnostic.Logger)12 Collection (java.util.Collection)12 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)11 BlazeProjectData (com.google.idea.blaze.base.model.BlazeProjectData)10 Map (java.util.Map)10 ImmutableSet (com.google.common.collect.ImmutableSet)9 BlazeCommand (com.google.idea.blaze.base.command.BlazeCommand)9 Collectors (java.util.stream.Collectors)9