use of com.google.idea.blaze.base.sync.BlazeSyncPlugin in project intellij by bazelbuild.
the class BlazeKotlinSyncPluginTest method initTest.
@Override
protected void initTest(@NotNull Container applicationServices, @NotNull Container projectServices) {
super.initTest(applicationServices, projectServices);
ExtensionPointImpl<BuildSystemProvider> buildSystems = registerExtensionPoint(BuildSystemProvider.EP_NAME, BuildSystemProvider.class);
buildSystems.registerExtension(new BazelBuildSystemProvider());
ExtensionPointImpl<BlazeSyncPlugin> syncPlugins = registerExtensionPoint(BlazeSyncPlugin.EP_NAME, BlazeSyncPlugin.class);
syncPlugins.registerExtension(new BlazeJavaSyncPlugin());
syncPlugins.registerExtension(new BlazeKotlinSyncPlugin());
context = new BlazeContext();
context.addOutputSink(IssueOutput.class, errorCollector);
}
use of com.google.idea.blaze.base.sync.BlazeSyncPlugin in project intellij by bazelbuild.
the class BlazeScalaSyncPluginTest method initTest.
@Override
protected void initTest(@NotNull Container applicationServices, @NotNull Container projectServices) {
super.initTest(applicationServices, projectServices);
ExtensionPointImpl<BlazeSyncPlugin> syncPlugins = registerExtensionPoint(BlazeSyncPlugin.EP_NAME, BlazeSyncPlugin.class);
syncPlugins.registerExtension(new BlazeJavaSyncPlugin());
syncPlugins.registerExtension(new BlazeScalaSyncPlugin());
context = new BlazeContext();
context.addOutputSink(IssueOutput.class, errorCollector);
}
use of com.google.idea.blaze.base.sync.BlazeSyncPlugin in project intellij by bazelbuild.
the class LanguageSupport method supportedLanguagesForWorkspaceType.
/**
* @return The set of {@link LanguageClass}'s supported for this {@link WorkspaceType}s.
*/
public static Set<LanguageClass> supportedLanguagesForWorkspaceType(WorkspaceType type) {
Set<LanguageClass> supportedLanguages = EnumSet.noneOf(LanguageClass.class);
for (BlazeSyncPlugin syncPlugin : BlazeSyncPlugin.EP_NAME.getExtensions()) {
supportedLanguages.addAll(syncPlugin.getSupportedLanguagesInWorkspace(type));
supportedLanguages.addAll(syncPlugin.getAlwaysActiveLanguages());
}
supportedLanguages.add(LanguageClass.GENERIC);
return supportedLanguages;
}
use of com.google.idea.blaze.base.sync.BlazeSyncPlugin in project intellij by bazelbuild.
the class LanguageSupport method getDefaultWorkspaceType.
public static WorkspaceType getDefaultWorkspaceType() {
WorkspaceType workspaceType = null;
// prioritize by enum ordinal.
for (BlazeSyncPlugin syncPlugin : BlazeSyncPlugin.EP_NAME.getExtensions()) {
WorkspaceType recommendedType = syncPlugin.getDefaultWorkspaceType();
if (recommendedType != null && (workspaceType == null || workspaceType.ordinal() > recommendedType.ordinal())) {
workspaceType = recommendedType;
}
}
// Should never happen, outside of tests without proper set up.
checkState(workspaceType != null, "No SyncPlugin present which provides a default workspace type.");
return workspaceType;
}
use of com.google.idea.blaze.base.sync.BlazeSyncPlugin in project intellij by bazelbuild.
the class BlazeGoSyncPluginTest method initTest.
@Override
protected void initTest(@NotNull Container applicationServices, @NotNull Container projectServices) {
super.initTest(applicationServices, projectServices);
syncPluginEp = registerExtensionPoint(BlazeSyncPlugin.EP_NAME, BlazeSyncPlugin.class);
syncPluginEp.registerExtension(new BlazeGoSyncPlugin());
syncPluginEp.registerExtension(new AlwaysPresentGoSyncPlugin());
// At least one sync plugin providing a default workspace type must be present
syncPluginEp.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);
}
@Nullable
@Override
public WorkspaceType getDefaultWorkspaceType() {
return WorkspaceType.JAVA;
}
});
context = new BlazeContext();
context.addOutputSink(IssueOutput.class, errorCollector);
}
Aggregations