mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Bug fix: other languages' properties are applied to a wrong language
This commit is contained in:
+6
-1
@@ -83,7 +83,7 @@ public class EditorConfigCodeStyleSettingsModifier implements CodeStyleSettingsM
|
||||
String ideLangPrefix = EditorConfigIntellijNameUtil.getIdeLangPrefix(mapper);
|
||||
boolean isModified = false;
|
||||
for (OutPair option : editorConfigOptions) {
|
||||
if (!languageSpecific || option.getKey().startsWith(ideLangPrefix)) {
|
||||
if (!languageSpecific && isGeneric(option.getKey()) || option.getKey().startsWith(ideLangPrefix)) {
|
||||
String intellijName = EditorConfigIntellijNameUtil.toIntellijName(mapper, option.getKey());
|
||||
if (intellijName != null) {
|
||||
CodeStylePropertyAccessor accessor = mapper.getAccessor(intellijName);
|
||||
@@ -96,6 +96,11 @@ public class EditorConfigCodeStyleSettingsModifier implements CodeStyleSettingsM
|
||||
return isModified;
|
||||
}
|
||||
|
||||
private static boolean isGeneric(@NotNull String optionKey) {
|
||||
return !optionKey.startsWith(EditorConfigIntellijNameUtil.IDE_PREFIX) ||
|
||||
optionKey.startsWith(EditorConfigIntellijNameUtil.GENERIC_OPTION_KEY_PREFIX);
|
||||
}
|
||||
|
||||
private static List<OutPair> getEditorConfigOptions(@NotNull Project project, @NotNull PsiFile psiFile, @NotNull ParserCallback callback)
|
||||
throws EditorConfigException {
|
||||
String filePath = Utils.getFilePath(project, psiFile.getVirtualFile());
|
||||
|
||||
+3
-2
@@ -10,8 +10,9 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class EditorConfigIntellijNameUtil {
|
||||
private final static String IDE_PREFIX = "ij_";
|
||||
private final static String GENERIC_PROPERTY_PREFIX = "any_";
|
||||
final static String IDE_PREFIX = "ij_";
|
||||
final static String GENERIC_PROPERTY_PREFIX = "any_";
|
||||
final static String GENERIC_OPTION_KEY_PREFIX = IDE_PREFIX + GENERIC_PROPERTY_PREFIX;
|
||||
|
||||
private EditorConfigIntellijNameUtil() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user