use of com.intellij.openapi.roots.LanguageLevelProjectExtension in project intellij by bazelbuild.
the class IntellijPluginSyncPlugin method updateProjectSdk.
@Override
public void updateProjectSdk(Project project, BlazeContext context, ProjectViewSet projectViewSet, BlazeVersionData blazeVersionData, BlazeProjectData blazeProjectData) {
if (!blazeProjectData.workspaceLanguageSettings.isWorkspaceType(WorkspaceType.INTELLIJ_PLUGIN)) {
return;
}
LanguageLevel javaLanguageLevel = JavaLanguageLevelHelper.getJavaLanguageLevel(projectViewSet, blazeProjectData, LanguageLevel.JDK_1_7);
// Leave the SDK, but set the language level
Transactions.submitWriteActionTransactionAndWait(() -> {
LanguageLevelProjectExtension ext = LanguageLevelProjectExtension.getInstance(project);
ext.setLanguageLevel(javaLanguageLevel);
});
}
Aggregations