@@ -33,10 +33,14 @@ public static class LemminxPreference {
3333 */
3434 public final String lemminxOptionPath ;
3535
36- public LemminxPreference (String preferenceId , String lemminxOptionPath ) {
37- this .preferenceId = preferenceId ;
36+ public LemminxPreference (String lemminxOptionPath ) {
37+ this .preferenceId = getPreferenceId ( lemminxOptionPath ) ;
3838 this .lemminxOptionPath = lemminxOptionPath ;
3939 }
40+
41+ private static String getPreferenceId (String lemminxOptionPath ) {
42+ return Activator .PLUGIN_ID + "." + lemminxOptionPath .replace ("/" , "." );
43+ }
4044
4145 public void storeToLemminxOptions (Object value , Map <String , Object > options ) {
4246 Map <String , Object > result = options ;
@@ -57,15 +61,16 @@ public void storeToLemminxOptions(Object value, Map<String, Object> options) {
5761 }
5862 }
5963
60- public static final LemminxPreference XML_PREFERENCES_CATAGLOGS = new LemminxPreference (Activator .PLUGIN_ID + ".catalogs" , "catalogs" );
61- public static final LemminxPreference XML_PREFERENCES_CODELENS_ENABLED = new LemminxPreference (Activator .PLUGIN_ID + ".codeLens.enabled" , "codeLens/enabled" );
62- public static final LemminxPreference XML_PREFERENCES_VALIDATION_ENABLED = new LemminxPreference (Activator .PLUGIN_ID + ".validation.enabled" , "validation/enabled" );
63- public static final LemminxPreference XML_PREFERENCES_VALIDATION_NAMESPACES_ENABLED = new LemminxPreference (Activator .PLUGIN_ID + ".validation.namespaces.enabled" , "validation/namespaces/enabled" );
64- public static final LemminxPreference XML_PREFERENCES_VALIDATION_SCHEMA_ENABLED = new LemminxPreference (Activator .PLUGIN_ID + ".validation.schema.enabled" , "validation/schema/enabled" );
65- public static final LemminxPreference XML_PREFERENCES_VALIDATION_DISALLOW_DOCTYPE_DECL = new LemminxPreference (Activator .PLUGIN_ID + ".validation.disallowDocTypeDecl" , "validation/disallowDocTypeDecl" );
66- public static final LemminxPreference XML_PREFERENCES_VALIDATION_RESOLVE_EXTERNAL_ENTITIES = new LemminxPreference (Activator .PLUGIN_ID + ".validation.resolveExternalEntities" , "validation/resolveExternalEntities" );
67- public static final LemminxPreference XML_PREFERENCES_VALIDATION_NO_GRAMMAR = new LemminxPreference (Activator .PLUGIN_ID + ".validation.noGrammar" , "validation/noGrammar" );
68-
64+ public static final LemminxPreference XML_PREFERENCES_CATAGLOGS = new LemminxPreference ("catalogs" );
65+ public static final LemminxPreference XML_PREFERENCES_CODELENS_ENABLED = new LemminxPreference ("codeLens/enabled" );
66+ public static final LemminxPreference XML_PREFERENCES_VALIDATION_ENABLED = new LemminxPreference ("validation/enabled" );
67+ public static final LemminxPreference XML_PREFERENCES_VALIDATION_NAMESPACES_ENABLED = new LemminxPreference ("validation/namespaces/enabled" );
68+ public static final LemminxPreference XML_PREFERENCES_VALIDATION_SCHEMA_ENABLED = new LemminxPreference ("validation/schema/enabled" );
69+ public static final LemminxPreference XML_PREFERENCES_VALIDATION_DISALLOW_DOCTYPE_DECL = new LemminxPreference ("validation/disallowDocTypeDecl" );
70+ public static final LemminxPreference XML_PREFERENCES_VALIDATION_RESOLVE_EXTERNAL_ENTITIES = new LemminxPreference ("validation/resolveExternalEntities" );
71+ 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" );
73+
6974 private static final LemminxPreference [] ALL_LEMMINX_PREFERENCES = {
7075 XML_PREFERENCES_CATAGLOGS ,
7176 XML_PREFERENCES_CODELENS_ENABLED ,
@@ -74,7 +79,8 @@ public void storeToLemminxOptions(Object value, Map<String, Object> options) {
7479 XML_PREFERENCES_VALIDATION_SCHEMA_ENABLED ,
7580 XML_PREFERENCES_VALIDATION_DISALLOW_DOCTYPE_DECL ,
7681 XML_PREFERENCES_VALIDATION_RESOLVE_EXTERNAL_ENTITIES ,
77- XML_PREFERENCES_VALIDATION_NO_GRAMMAR
82+ XML_PREFERENCES_VALIDATION_NO_GRAMMAR ,
83+ XML_PREFERENCES_FOLDING_INCLUDE_CLOSING_TAG_IN_FOLD
7884 };
7985
8086 public static Optional <LemminxPreference > getLemminxPreference (PropertyChangeEvent event ) {
@@ -100,5 +106,6 @@ public static void storePreferencesToLemminxOptions(IPreferenceStore store, Map<
100106 store .getBoolean (XML_PREFERENCES_VALIDATION_RESOLVE_EXTERNAL_ENTITIES .preferenceId ), xmlOpts );
101107 XML_PREFERENCES_VALIDATION_NO_GRAMMAR .storeToLemminxOptions (store .getString (XML_PREFERENCES_VALIDATION_NO_GRAMMAR .preferenceId ),
102108 xmlOpts );
109+ XML_PREFERENCES_FOLDING_INCLUDE_CLOSING_TAG_IN_FOLD .storeToLemminxOptions (store .getBoolean (XML_PREFERENCES_FOLDING_INCLUDE_CLOSING_TAG_IN_FOLD .preferenceId ), xmlOpts );
103110 }
104111}
0 commit comments