mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Make inlay parameter hints blacklist explanation text overridable per language
PHP WI-35135 Java-specific help text in "Configure Parameter Name Hint" dialog (cherry picked from commit 409eb3d)
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.codeInsight.hints;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightBundle;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -75,6 +76,13 @@ public interface InlayParameterHintsProvider {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Text explaining black list patterns
|
||||
*/
|
||||
default String getBlacklistExplanationHTML() {
|
||||
return CodeInsightBundle.message("inlay.hints.blacklist.pattern.explanation");
|
||||
}
|
||||
|
||||
/**
|
||||
* Customise hints presentation
|
||||
*/
|
||||
|
||||
+10
-1
@@ -222,12 +222,21 @@ public class ParameterNameHintsConfigurable extends DialogWrapper {
|
||||
blacklistPanel.setLayout(layout);
|
||||
blacklistPanel.setBorder(IdeBorderFactory.createTitledBorder("Blacklist"));
|
||||
|
||||
blacklistPanel.add(new JBLabel(CodeInsightBundle.message("inlay.hints.blacklist.pattern.explanation")));
|
||||
blacklistPanel.add(new JBLabel(getBlacklistExplanationHTML(language)));
|
||||
blacklistPanel.add(editorTextField);
|
||||
|
||||
return blacklistPanel;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getBlacklistExplanationHTML(Language language) {
|
||||
InlayParameterHintsProvider hintsProvider = InlayParameterHintsExtension.INSTANCE.forLanguage(language);
|
||||
if (hintsProvider == null) {
|
||||
return CodeInsightBundle.message("inlay.hints.blacklist.pattern.explanation");
|
||||
}
|
||||
return hintsProvider.getBlacklistExplanationHTML();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private JPanel createOptionsPanel(@NotNull Language language) {
|
||||
List<Option> options = getOptions(language);
|
||||
|
||||
Reference in New Issue
Block a user