Set<TextMateBracePair> (@Nullable TextMateScope selector) { if (selector == null) { return Constants.DEFAULT_HIGHLIGHTING_BRACE_PAIRS; } Set<TextMateBracePair> result = new HashSet<>(); List<Preferences> preferencesForSelector = TextMateService.getInstance().getPreferenceRegistry().getPreferences(selector); for (Preferences preferences : preferencesForSelector) { final Set<TextMateBracePair> highlightingPairs = preferences.getHighlightingPairs(); if (highlightingPairs != null) { if (highlightingPairs.isEmpty()) { // smart typing pairs can be defined in preferences but can be empty (in order to disable smart typing completely) return Collections.emptySet(); } result.addAll(highlightingPairs); } } return result; }