Skip to content

Commit 8f0efa4

Browse files
committed
update option version before merging
Signed-off-by: Shi Chen <chenshi@microsoft.com>
1 parent dafe585 commit 8f0efa4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/FormatterPreferences.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
import java.util.stream.Collectors;
1717

1818
import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
19+
import org.eclipse.jdt.internal.ui.preferences.formatter.ProfileVersionerCore;
1920

2021
public class FormatterPreferences {
2122

23+
private static final int CURRENT_VERSION = 23;
24+
2225
// @formatter:off
2326
// < JDTLS settings, eclipse settings >
2427
private static Map<String, String> eclipseOptions = Map.ofEntries(
@@ -78,13 +81,14 @@ public class FormatterPreferences {
7881
* @return the converted eclipse formatter options
7982
*/
8083
public static Map<String, String> toEclipseOptions(Map<String, String> lsOptions) {
81-
return lsOptions.entrySet().stream().filter(option -> eclipseOptions.containsKey(option.getKey())).collect(Collectors.toMap(option -> eclipseOptions.get(option.getKey()), option -> {
84+
Map<String, String> options = lsOptions.entrySet().stream().filter(option -> eclipseOptions.containsKey(option.getKey())).collect(Collectors.toMap(option -> eclipseOptions.get(option.getKey()), option -> {
8285
String value = option.getValue();
8386
if (valueMap.containsKey(value)) {
8487
return valueMap.get(value);
8588
}
8689
return value;
8790
}));
91+
return ProfileVersionerCore.updateAndComplete(options, CURRENT_VERSION);
8892
}
8993

9094
/**

0 commit comments

Comments
 (0)