void (@NotNull TextMateBundleReader reader) { Iterator<TextMatePreferences> preferencesIterator = reader.readPreferences().iterator(); while (preferencesIterator.hasNext()) { TextMatePreferences preferences = preferencesIterator.next(); CharSequence scopeName = myInterner.intern(preferences.getScopeName()); Set<TextMateBracePair> internedHighlightingPairs = ObjectUtils.doIfNotNull(preferences.getHighlightingPairs(), pairs -> ContainerUtil.map2Set(pairs, p -> new TextMateBracePair(myInterner.intern(p.getLeft()), myInterner.intern(p.getRight()))) ); Set<TextMateAutoClosingPair> internedSmartTypingPairs = ObjectUtils.doIfNotNull(preferences.getSmartTypingPairs(), pairs -> ContainerUtil.map2Set(pairs, p -> new TextMateAutoClosingPair(myInterner.intern(p.getLeft()), myInterner.intern(p.getRight()), p.getNotIn())) ); Set<TextMateBracePair> internedSurroundingPairs = ObjectUtils.doIfNotNull(preferences.getSurroundingPairs(), pairs -> ContainerUtil.map2Set(pairs, p -> new TextMateBracePair(myInterner.intern(p.getLeft()), myInterner.intern(p.getRight()))) ); myPreferenceRegistry.addPreferences(new Preferences(scopeName, internedHighlightingPairs, internedSmartTypingPairs, internedSurroundingPairs, preferences.getAutoCloseBefore(), preferences.getIndentationRules())); for (TextMateShellVariable variable : preferences.getVariables()) { myShellVariablesRegistry.addVariable(variable); } TextMateTextAttributes customHighlightingAttributes = preferences.getCustomHighlightingAttributes(); if (customHighlightingAttributes != null) { myCustomHighlightingColors.put(scopeName, new TextMateTextAttributesAdapter(scopeName, customHighlightingAttributes)); } } }