From a02da769cc26a1c214e2dc9e28040e28ba7d25cd Mon Sep 17 00:00:00 2001 From: Peter Dell Date: Sat, 10 Sep 2022 23:09:24 +0200 Subject: [PATCH] Initialize preferences defaults per language correctly --- .../LanguagePreferencesInitializer.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/com.wudsn.ide.lng/src/com/wudsn/ide/lng/preferences/LanguagePreferencesInitializer.java b/com.wudsn.ide.lng/src/com/wudsn/ide/lng/preferences/LanguagePreferencesInitializer.java index dc3902e5..75a1c684 100644 --- a/com.wudsn.ide.lng/src/com/wudsn/ide/lng/preferences/LanguagePreferencesInitializer.java +++ b/com.wudsn.ide.lng/src/com/wudsn/ide/lng/preferences/LanguagePreferencesInitializer.java @@ -102,8 +102,7 @@ public final class LanguagePreferencesInitializer extends AbstractPreferenceInit LanguageContentAssistProcessorDefaultCase.LOWER_CASE); // Compiling. - setDefault(language, - LanguagePreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE, + setDefault(language, LanguagePreferencesConstants.EDITOR_COMPILE_COMMAND_POSITIONING_MODE, LanguageEditorCompileCommandPositioningMode.FIRST_ERROR_OR_WARNING); } @@ -115,25 +114,24 @@ public final class LanguagePreferencesInitializer extends AbstractPreferenceInit CompilerRegistry compilerRegistry = languagePlugin.getCompilerRegistry(); List compilerDefinitions = compilerRegistry.getCompilerDefinitions(language); for (CompilerDefinition compilerDefinition : compilerDefinitions) { - String compilerId; + String compilerId = compilerDefinition.getId(); String name; - compilerId = compilerDefinition.getId(); for (Hardware hardware : Hardware.values()) { if (hardware.equals(Hardware.GENERIC)) { continue; } - store.setDefault(LanguagePreferencesConstants.getCompilerTargetName(compilerId, hardware), + setDefault(language, LanguagePreferencesConstants.getCompilerTargetName(compilerId, hardware), compilerDefinition.getSupportedTargets().get(0).toString()); name = LanguagePreferencesConstants.getCompilerParametersName(compilerId, hardware); - store.setDefault(name, compilerDefinition.getDefaultParameters()); + setDefault(language, name, compilerDefinition.getDefaultParameters()); name = LanguagePreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware); - store.setDefault(name, CompilerOutputFolderMode.TEMP_FOLDER); + setDefault(language, name, CompilerOutputFolderMode.TEMP_FOLDER); name = LanguagePreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware); - store.setDefault(name, HardwareUtility.getDefaultFileExtension(hardware)); + setDefault(language, name, HardwareUtility.getDefaultFileExtension(hardware)); name = LanguagePreferencesConstants.getCompilerRunnerIdName(compilerId, hardware); - store.setDefault(name, RunnerId.DEFAULT_APPLICATION); + setDefault(language, name, RunnerId.DEFAULT_APPLICATION); } }