@@ -61,26 +61,51 @@ public void storeToLemminxOptions(Object value, Map<String, Object> options) {
6161 }
6262 }
6363
64+ // Catalog settings
6465 public static final LemminxPreference XML_PREFERENCES_CATAGLOGS = new LemminxPreference ("catalogs" );
66+
67+ // CodeLens settings
6568 public static final LemminxPreference XML_PREFERENCES_CODELENS_ENABLED = new LemminxPreference ("codeLens/enabled" );
69+
70+ // Folding settings
71+ public static final LemminxPreference XML_PREFERENCES_FOLDING_INCLUDE_CLOSING_TAG_IN_FOLD = new LemminxPreference ("foldings/includeClosingTagInFold" );
72+
73+ // Format settings
74+ public static final LemminxPreference XML_PREFERENCES_FORMAT_EMPTY_ELEMENTS = new LemminxPreference ("format/emptyElements" );
75+ public static final LemminxPreference XML_PREFERENCES_FORMAT_SPACE_BEFORE_EMPTY_CLOSE_TAG = new LemminxPreference ("format/spaceBeforeEmptyCloseTag" );
76+ public static final LemminxPreference XML_PREFERENCES_FORMAT_SPLIT_ATTRIBUTES = new LemminxPreference ("format/splitAttributes" );
77+ public static final LemminxPreference XML_PREFERENCES_FORMAT_SPLIT_ATTRIBUTES_INDENT_SIZE = new LemminxPreference ("format/splitAttributesIndentSize" );
78+ public static final LemminxPreference XML_PREFERENCES_FORMAT_PRESERVE_ATTRIBUTE_LINE_BREAKS = new LemminxPreference ("format/preserveAttributeLineBreaks" );
79+ public static final LemminxPreference XML_PREFERENCES_FORMAT_CLOSING_BRACKET_NEW_LINE = new LemminxPreference ("format/closingBracketNewLine" );
80+ public static final LemminxPreference XML_PREFERENCES_FORMAT_XSI_SCHEMA_LOCATION_SPLIT = new LemminxPreference ("format/xsiSchemaLocationSplit" );
81+ public static final LemminxPreference XML_PREFERENCES_FORMAT_JOIN_COMMENTLINES = new LemminxPreference ("format/joinCommentLines" );
82+
83+ // Validation settings
6684 public static final LemminxPreference XML_PREFERENCES_VALIDATION_ENABLED = new LemminxPreference ("validation/enabled" );
6785 public static final LemminxPreference XML_PREFERENCES_VALIDATION_NAMESPACES_ENABLED = new LemminxPreference ("validation/namespaces/enabled" );
6886 public static final LemminxPreference XML_PREFERENCES_VALIDATION_SCHEMA_ENABLED = new LemminxPreference ("validation/schema/enabled" );
6987 public static final LemminxPreference XML_PREFERENCES_VALIDATION_DISALLOW_DOCTYPE_DECL = new LemminxPreference ("validation/disallowDocTypeDecl" );
7088 public static final LemminxPreference XML_PREFERENCES_VALIDATION_RESOLVE_EXTERNAL_ENTITIES = new LemminxPreference ("validation/resolveExternalEntities" );
7189 public static final LemminxPreference XML_PREFERENCES_VALIDATION_NO_GRAMMAR = new LemminxPreference ("validation/noGrammar" );
72- public static final LemminxPreference XML_PREFERENCES_FOLDING_INCLUDE_CLOSING_TAG_IN_FOLD = new LemminxPreference ("foldings/includeClosingTagInFold" );
7390
7491 private static final LemminxPreference [] ALL_LEMMINX_PREFERENCES = {
7592 XML_PREFERENCES_CATAGLOGS ,
7693 XML_PREFERENCES_CODELENS_ENABLED ,
94+ XML_PREFERENCES_FOLDING_INCLUDE_CLOSING_TAG_IN_FOLD ,
95+ XML_PREFERENCES_FORMAT_EMPTY_ELEMENTS ,
96+ XML_PREFERENCES_FORMAT_SPACE_BEFORE_EMPTY_CLOSE_TAG ,
97+ XML_PREFERENCES_FORMAT_SPLIT_ATTRIBUTES ,
98+ XML_PREFERENCES_FORMAT_SPLIT_ATTRIBUTES_INDENT_SIZE ,
99+ XML_PREFERENCES_FORMAT_PRESERVE_ATTRIBUTE_LINE_BREAKS ,
100+ XML_PREFERENCES_FORMAT_CLOSING_BRACKET_NEW_LINE ,
101+ XML_PREFERENCES_FORMAT_XSI_SCHEMA_LOCATION_SPLIT ,
102+ XML_PREFERENCES_FORMAT_JOIN_COMMENTLINES ,
77103 XML_PREFERENCES_VALIDATION_ENABLED ,
78104 XML_PREFERENCES_VALIDATION_NAMESPACES_ENABLED ,
79105 XML_PREFERENCES_VALIDATION_SCHEMA_ENABLED ,
80106 XML_PREFERENCES_VALIDATION_DISALLOW_DOCTYPE_DECL ,
81107 XML_PREFERENCES_VALIDATION_RESOLVE_EXTERNAL_ENTITIES ,
82- XML_PREFERENCES_VALIDATION_NO_GRAMMAR ,
83- XML_PREFERENCES_FOLDING_INCLUDE_CLOSING_TAG_IN_FOLD
108+ XML_PREFERENCES_VALIDATION_NO_GRAMMAR
84109 };
85110
86111 public static Optional <LemminxPreference > getLemminxPreference (PropertyChangeEvent event ) {
@@ -92,10 +117,28 @@ private XMLPreferenceConstants() {
92117 }
93118
94119 public static void storePreferencesToLemminxOptions (IPreferenceStore store , Map <String , Object > xmlOpts ) {
120+ // Catalo settings
95121 XML_PREFERENCES_CATAGLOGS .storeToLemminxOptions (
96122 XMLCatalogs .getAllCatalogs (store ).stream ().map (File ::getAbsolutePath ).toArray (String []::new ),
97123 xmlOpts );
124+
125+ // CodeLens settings
98126 XML_PREFERENCES_CODELENS_ENABLED .storeToLemminxOptions (store .getBoolean (XML_PREFERENCES_CODELENS_ENABLED .preferenceId ), xmlOpts );
127+
128+ // Folding settings
129+ XML_PREFERENCES_FOLDING_INCLUDE_CLOSING_TAG_IN_FOLD .storeToLemminxOptions (store .getBoolean (XML_PREFERENCES_FOLDING_INCLUDE_CLOSING_TAG_IN_FOLD .preferenceId ), xmlOpts );
130+
131+ // Format settings
132+ XML_PREFERENCES_FORMAT_EMPTY_ELEMENTS .storeToLemminxOptions (store .getString (XML_PREFERENCES_FORMAT_EMPTY_ELEMENTS .preferenceId ), xmlOpts );
133+ XML_PREFERENCES_FORMAT_SPACE_BEFORE_EMPTY_CLOSE_TAG .storeToLemminxOptions (store .getBoolean (XML_PREFERENCES_FORMAT_SPACE_BEFORE_EMPTY_CLOSE_TAG .preferenceId ), xmlOpts );
134+ XML_PREFERENCES_FORMAT_SPLIT_ATTRIBUTES .storeToLemminxOptions (store .getBoolean (XML_PREFERENCES_FORMAT_SPLIT_ATTRIBUTES .preferenceId ), xmlOpts );
135+ XML_PREFERENCES_FORMAT_SPLIT_ATTRIBUTES_INDENT_SIZE .storeToLemminxOptions (store .getInt (XML_PREFERENCES_FORMAT_SPLIT_ATTRIBUTES_INDENT_SIZE .preferenceId ), xmlOpts );
136+ XML_PREFERENCES_FORMAT_PRESERVE_ATTRIBUTE_LINE_BREAKS .storeToLemminxOptions (store .getBoolean (XML_PREFERENCES_FORMAT_PRESERVE_ATTRIBUTE_LINE_BREAKS .preferenceId ), xmlOpts );
137+ XML_PREFERENCES_FORMAT_CLOSING_BRACKET_NEW_LINE .storeToLemminxOptions (store .getBoolean (XML_PREFERENCES_FORMAT_CLOSING_BRACKET_NEW_LINE .preferenceId ), xmlOpts );
138+ XML_PREFERENCES_FORMAT_XSI_SCHEMA_LOCATION_SPLIT .storeToLemminxOptions (store .getString (XML_PREFERENCES_FORMAT_XSI_SCHEMA_LOCATION_SPLIT .preferenceId ), xmlOpts );
139+ XML_PREFERENCES_FORMAT_JOIN_COMMENTLINES .storeToLemminxOptions (store .getBoolean (XML_PREFERENCES_FORMAT_JOIN_COMMENTLINES .preferenceId ), xmlOpts );
140+
141+ // Validation settings
99142 XML_PREFERENCES_VALIDATION_ENABLED .storeToLemminxOptions (store .getBoolean (XML_PREFERENCES_VALIDATION_ENABLED .preferenceId ), xmlOpts );
100143 XML_PREFERENCES_VALIDATION_NAMESPACES_ENABLED .storeToLemminxOptions (store .getString (XML_PREFERENCES_VALIDATION_NAMESPACES_ENABLED .preferenceId ), xmlOpts );
101144 XML_PREFERENCES_VALIDATION_SCHEMA_ENABLED .storeToLemminxOptions (store .getString (XML_PREFERENCES_VALIDATION_SCHEMA_ENABLED .preferenceId ),
@@ -105,7 +148,6 @@ public static void storePreferencesToLemminxOptions(IPreferenceStore store, Map<
105148 XML_PREFERENCES_VALIDATION_RESOLVE_EXTERNAL_ENTITIES .storeToLemminxOptions (
106149 store .getBoolean (XML_PREFERENCES_VALIDATION_RESOLVE_EXTERNAL_ENTITIES .preferenceId ), xmlOpts );
107150 XML_PREFERENCES_VALIDATION_NO_GRAMMAR .storeToLemminxOptions (store .getString (XML_PREFERENCES_VALIDATION_NO_GRAMMAR .preferenceId ),
108- xmlOpts );
109- XML_PREFERENCES_FOLDING_INCLUDE_CLOSING_TAG_IN_FOLD .storeToLemminxOptions (store .getBoolean (XML_PREFERENCES_FOLDING_INCLUDE_CLOSING_TAG_IN_FOLD .preferenceId ), xmlOpts );
151+ xmlOpts );
110152 }
111153}
0 commit comments