use of com.intellij.codeInsight.hints.InlayParameterHintsProvider in project intellij-community by JetBrains.
the class ParameterNameHintsConfigurable method getLanguageBlackList.
@NotNull
private static String getLanguageBlackList(@NotNull Language language) {
InlayParameterHintsProvider hintsProvider = InlayParameterHintsExtension.INSTANCE.forLanguage(language);
if (hintsProvider == null) {
return "";
}
Diff diff = ParameterNameHintsSettings.getInstance().getBlackListDiff(language);
Set<String> blackList = diff.applyOn(hintsProvider.getDefaultBlackList());
return StringUtil.join(blackList, "\n");
}
use of com.intellij.codeInsight.hints.InlayParameterHintsProvider in project intellij-community by JetBrains.
the class ParameterNameHintsConfigurable method storeBlackListDiff.
private static void storeBlackListDiff(@NotNull Language language, @NotNull String text) {
Set<String> updatedBlackList = StringUtil.split(text, "\n").stream().filter((e) -> !e.trim().isEmpty()).collect(Collectors.toCollection(LinkedHashSet::new));
InlayParameterHintsProvider provider = InlayParameterHintsExtension.INSTANCE.forLanguage(language);
Set<String> defaultBlackList = provider.getDefaultBlackList();
Diff diff = Diff.Builder.build(defaultBlackList, updatedBlackList);
ParameterNameHintsSettings.getInstance().setBlackListDiff(language, diff);
}
use of com.intellij.codeInsight.hints.InlayParameterHintsProvider in project intellij-community by JetBrains.
the class ParameterNameHintsConfigurable method createBlacklistPanel.
@Nullable
private JPanel createBlacklistPanel(@NotNull Language language) {
InlayParameterHintsProvider provider = InlayParameterHintsExtension.INSTANCE.forLanguage(language);
if (!provider.isBlackListSupported())
return null;
String blackList = getLanguageBlackList(language);
EditorTextField editorTextField = createEditorField(blackList);
editorTextField.addDocumentListener(new DocumentAdapter() {
@Override
public void documentChanged(DocumentEvent e) {
updateOkEnabled(language, editorTextField);
}
});
updateOkEnabled(language, editorTextField);
myEditors.put(language, editorTextField);
JPanel blacklistPanel = new JPanel();
BoxLayout layout = new BoxLayout(blacklistPanel, BoxLayout.Y_AXIS);
blacklistPanel.setLayout(layout);
blacklistPanel.setBorder(IdeBorderFactory.createTitledBorder("Blacklist"));
blacklistPanel.add(new JBLabel(getBlacklistExplanationHTML(language)));
blacklistPanel.add(editorTextField);
return blacklistPanel;
}
Aggregations