Skip to content

Localizing GroovyMarkerTypes#71

Merged
VISTALL merged 1 commit into
consulo:masterfrom
unv-unv:localizing-groovy-marker-types
Apr 21, 2026
Merged

Localizing GroovyMarkerTypes#71
VISTALL merged 1 commit into
consulo:masterfrom
unv-unv:localizing-groovy-marker-types

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 updates Groovy gutter marker tooltips/navigation strings to use the localization infrastructure (DaemonLocalize) instead of the legacy bundle access, and modernizes HTML tooltip composition.

Changes:

  • Replaced DaemonBundle.message(...) usage with DaemonLocalize calls for several marker tooltips and navigation titles.
  • Refactored tooltip HTML building to use HtmlBuilder/HtmlChunk and a localized BiFunction formatting pattern.
  • Updated overriding/overridden marker navigators to use the new localized titles in more places.

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

Comment on lines +171 to +201
if (DumbService.isDumb(element.getProject())) {
DumbService.getInstance(element.getProject())
.showDumbModeNotification("Navigation to overriding classes is not possible during index update");
return;
}

CommonProcessors.CollectProcessor<PsiMethod> collectProcessor =
new CommonProcessors.CollectProcessor<>(new HashSet<>());
if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(
() -> field.getApplication().runReadAction(() -> {
for (GrAccessorMethod method : GroovyPropertyUtils.getFieldAccessors(field)) {
OverridingMethodsSearch.search(method, true).forEach(collectProcessor);
}
}),
"Searching for overriding methods",
true,
field.getProject(),
(JComponent) e.getComponent()
)) {
return;
}

PsiMethod[] overridings = collectProcessor.toArray(PsiMethod.EMPTY_ARRAY);
if (overridings.length == 0) {
return;
}
LocalizeValue title = DaemonLocalize.navigationTitleOverriderMethod(field.getName(), overridings.length);
boolean showMethodNames = !PsiUtil.allMethodsHaveSameSignature(overridings);
MethodCellRenderer renderer = new MethodCellRenderer(showMethodNames);
Arrays.sort(overridings, renderer.getComparator());
PsiElementListNavigator.openTargets(e, overridings, title.get(), "Overriding Methods of " + field.getName(), renderer);
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

These user-facing strings are still hard-coded in English (dumb-mode notification, progress title, and the navigator “find usages” title). Since the rest of this class is being moved to DaemonLocalize, please localize these remaining strings as well (and add new localization keys if needed).

Copilot uses AI. Check for mistakes.
e,
overridings,
methodsUpdater.getCaption(overridings.length),
"Overriding Methods of " + method.getName(),
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The “Overriding Methods of …” title passed to openTargets is still hard-coded in English. Please replace it with a localized message (or add a DaemonLocalize key) so the navigation popup is fully localizable.

Suggested change
"Overriding Methods of " + method.getName(),
DaemonLocalize.navigationTitleOverridingMethods(method.getName()).get(),

Copilot uses AI. Check for mistakes.
}
if (DumbService.isDumb(element.getProject())) {
DumbService.getInstance(element.getProject())
.showDumbModeNotification("Navigation to overriding classes is not possible during index update");
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

This dumb-mode notification string is still hard-coded in English. Please move it to the localization bundle (DaemonLocalize / appropriate localize class) to match the rest of the localized navigation UI.

Suggested change
.showDumbModeNotification("Navigation to overriding classes is not possible during index update");
.showDumbModeNotification(DaemonLocalize.navigationToOverridingClassesNotPossibleDuringIndexUpdate().get());

Copilot uses AI. Check for mistakes.
myRenderer.getComparator())) {
indicator.cancel();
public OverridingMethodsUpdater(GrMethod method, PsiElementListCellRenderer renderer) {
super(method.getProject(), LocalizeValue.localizeTODO(MarkerType.SEARCHING_FOR_OVERRIDING_METHODS));
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

Using LocalizeValue.localizeTODO(...) here leaves a TODO-localized placeholder in user-visible UI. Please wire this to a real localized key/value (or keep the existing MarkerType constant if the base API still expects a String).

Suggested change
super(method.getProject(), LocalizeValue.localizeTODO(MarkerType.SEARCHING_FOR_OVERRIDING_METHODS));
super(method.getProject(), LocalizeValue.of(MarkerType.SEARCHING_FOR_OVERRIDING_METHODS));

Copilot uses AI. Check for mistakes.
@VISTALL VISTALL merged commit a4f8223 into consulo:master Apr 21, 2026
5 checks passed
@unv-unv unv-unv deleted the localizing-groovy-marker-types branch April 21, 2026 16:21
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