Skip to content

Localizing GutterIconTooltipHelper#297

Merged
VISTALL merged 1 commit intoconsulo:masterfrom
unv-unv:localizing-gutter-icon-tooltip-helper
Apr 21, 2026
Merged

Localizing GutterIconTooltipHelper#297
VISTALL merged 1 commit intoconsulo:masterfrom
unv-unv:localizing-gutter-icon-tooltip-helper

Conversation

@unv-unv
Copy link
Copy Markdown
Contributor

@unv-unv unv-unv commented Apr 21, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors GutterIconTooltipHelper to support localization-friendly tooltip construction by switching from MessageFormat/String assembly to LocalizeValue + HtmlBuilder/HtmlChunk composition.

Changes:

  • Replaced MessageFormat pattern strings with a BiFunction<String, String, LocalizeValue> to generate localized tooltip lines.
  • Changed tooltip composition to build HTML via HtmlBuilder/HtmlChunk and return an HtmlChunk.Element.
  • Added @RequiredReadAction annotations to PSI-reading methods.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +40 to +47
@RequiredReadAction
public static HtmlChunk.Element composeText(
PsiElement[] elements,
String startHtml,
BiFunction<String, String, LocalizeValue> pattern
) {
return composeText(Arrays.asList(elements), startHtml, pattern);
}
Comment on lines +36 to +46
public class GutterIconTooltipHelper {
private GutterIconTooltipHelper() {
}

public static String composeText(PsiElement[] elements, String start, String pattern)
{
return composeText(Arrays.asList(elements), start, pattern);
}
@RequiredReadAction
public static HtmlChunk.Element composeText(
PsiElement[] elements,
String startHtml,
BiFunction<String, String, LocalizeValue> pattern
) {
return composeText(Arrays.asList(elements), startHtml, pattern);
Comment on lines +41 to +54
public static HtmlChunk.Element composeText(
PsiElement[] elements,
String startHtml,
BiFunction<String, String, LocalizeValue> pattern
) {
return composeText(Arrays.asList(elements), startHtml, pattern);
}

public static String composeText(Iterable<? extends PsiElement> elements, String start, String pattern)
{
return composeText(elements, start, pattern, "");
}
@RequiredReadAction
public static HtmlChunk.Element composeText(
Iterable<? extends PsiElement> elements,
String startHtml,
BiFunction<String, String, LocalizeValue> pattern
) {
@VISTALL VISTALL merged commit a5baf46 into consulo:master Apr 21, 2026
5 checks passed
@unv-unv unv-unv deleted the localizing-gutter-icon-tooltip-helper branch April 21, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants