mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Reverting commit 4f326053, it breaks compilation
GitOrigin-RevId: e506e1af36d8b316d7c02df6fd72c9607469955b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3009c1793c
commit
d1b7e01039
@@ -42,7 +42,9 @@ public class CodeStyleSettingsManager implements PersistentStateComponent<Elemen
|
||||
return getInstance();
|
||||
}
|
||||
|
||||
return ServiceManager.getService(project, ProjectCodeStyleSettingsManager.class);
|
||||
ProjectCodeStyleSettingsManager projectSettingsManager = ServiceManager.getService(project, ProjectCodeStyleSettingsManager.class);
|
||||
projectSettingsManager.initProjectSettings(project);
|
||||
return projectSettingsManager;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+24
-17
@@ -35,32 +35,37 @@ public class ProjectCodeStyleSettingsManager extends CodeStyleSettingsManager {
|
||||
private static final String MAIN_PROJECT_CODE_STYLE_NAME = "Project";
|
||||
private static final String PROJECT_CODE_STYLE_CONFIG_FILE_NAME = "codeStyleConfig";
|
||||
|
||||
private volatile boolean myIsLoaded;
|
||||
private static final Object LEGACY_SETTINGS_IMPORT_LOCK = new Object();
|
||||
private final Map<String,CodeStyleSettings> mySettingsMap = new HashMap<>();
|
||||
|
||||
private static final NotificationGroup NOTIFICATION_GROUP =
|
||||
new NotificationGroup("Code style settings migration", NotificationDisplayType.STICKY_BALLOON, true);
|
||||
|
||||
public ProjectCodeStyleSettingsManager(Project project) {
|
||||
public ProjectCodeStyleSettingsManager() {
|
||||
setMainProjectCodeStyle(null);
|
||||
initProjectSettings(project);
|
||||
//noinspection deprecation
|
||||
getCurrentSettings(); // cache default scheme
|
||||
}
|
||||
|
||||
private void initProjectSettings(@NotNull Project project) {
|
||||
LegacyCodeStyleSettingsManager legacySettingsManager = ServiceManager.getService(project, LegacyCodeStyleSettingsManager.class);
|
||||
if (legacySettingsManager != null && legacySettingsManager.getState() != null) {
|
||||
loadState(legacySettingsManager.getState());
|
||||
if (!project.isDefault() &&
|
||||
!ApplicationManager.getApplication().isUnitTestMode() &&
|
||||
!ApplicationManager.getApplication().isHeadlessEnvironment()) {
|
||||
saveProjectAndNotify(project);
|
||||
void initProjectSettings(@NotNull Project project) {
|
||||
if (!myIsLoaded) {
|
||||
synchronized (LEGACY_SETTINGS_IMPORT_LOCK) {
|
||||
if (!myIsLoaded) {
|
||||
LegacyCodeStyleSettingsManager legacySettingsManager = ServiceManager.getService(project, LegacyCodeStyleSettingsManager.class);
|
||||
if (legacySettingsManager != null && legacySettingsManager.getState() != null) {
|
||||
loadState(legacySettingsManager.getState());
|
||||
if (!project.isDefault() &&
|
||||
!ApplicationManager.getApplication().isUnitTestMode() &&
|
||||
!ApplicationManager.getApplication().isHeadlessEnvironment()) {
|
||||
saveProjectAndNotify(project);
|
||||
}
|
||||
LOG.info("Imported old project code style settings.");
|
||||
}
|
||||
else {
|
||||
initDefaults();
|
||||
LOG.info("Initialized from default code style settings.");
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG.info("Imported old project code style settings.");
|
||||
}
|
||||
else {
|
||||
initDefaults();
|
||||
LOG.info("Initialized from default code style settings.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +98,7 @@ public class ProjectCodeStyleSettingsManager extends CodeStyleSettingsManager {
|
||||
USE_PER_PROJECT_SETTINGS = appCodeStyleSettingsManager.USE_PER_PROJECT_SETTINGS;
|
||||
PREFERRED_PROJECT_CODE_STYLE = appCodeStyleSettingsManager.PREFERRED_PROJECT_CODE_STYLE;
|
||||
}
|
||||
myIsLoaded = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,6 +116,7 @@ public class ProjectCodeStyleSettingsManager extends CodeStyleSettingsManager {
|
||||
mySettingsMap.put(name, settings);
|
||||
}
|
||||
}
|
||||
myIsLoaded = true;
|
||||
}
|
||||
|
||||
private void updateFromOldProjectSettings() {
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
<applicationService serviceInterface="com.intellij.codeInsight.editorActions.TabOutScopesTracker"
|
||||
serviceImplementation="com.intellij.codeInsight.editorActions.TabOutScopesTrackerImpl"/>
|
||||
|
||||
<projectService serviceImplementation="com.intellij.psi.codeStyle.ProjectCodeStyleSettingsManager" preload="true"/>
|
||||
<projectService serviceImplementation="com.intellij.psi.codeStyle.ProjectCodeStyleSettingsManager"/>
|
||||
|
||||
<projectService serviceImplementation="com.intellij.psi.codeStyle.LegacyCodeStyleSettingsManager"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user