Skip to content

feat: provide completion for Resource Bundle keys - #3598

Draft
fbricon wants to merge 1 commit into
eclipse-jdtls:mainfrom
fbricon:completion-resourcebundles
Draft

feat: provide completion for Resource Bundle keys#3598
fbricon wants to merge 1 commit into
eclipse-jdtls:mainfrom
fbricon:completion-resourcebundles

Conversation

@fbricon

@fbricon fbricon commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

Fixes #881

  • provide completion for keys in resource bundles
  • controled by the "java.completion.resourceBundle.enabled" preference, enabled by default.
Screenshot 2025-11-18 at 10 24 29

Known limitations:

  • only checks for bundles in the project, not bundles embedded in jars on the classpath or modulepath
  • doesn't provide completion for bundle names (doable but would require scanning the whole source tree). Maybe later

Opens the door to more potential enhancements

  • key validation
  • navigation to bundle
  • hover on keys showing value

Signed-off-by: Fred Bricon fbricon@gmail.com

@fbricon
fbricon requested a review from datho7561 November 18, 2025 11:59

@datho7561 datho7561 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Works pretty good!

Completions are still suggested at the second argument, eg.

bundle.getString("my.first.translation", /* here */);

Annoying but not a deal breaker IMO.

If I hardcode a locale, the completion details still show the value from the bundle without the locale. I guess this behaviour makes sense, since the locale is usually dynamic instead of hardcoded.

@fbricon

fbricon commented Jan 20, 2026

Copy link
Copy Markdown
Contributor Author

Adding support to the locale, I had to throw away a lot of code to change my approach. I'm getting there.

Signed-off-by: Fred Bricon <fbricon@gmail.com>
@fbricon
fbricon force-pushed the completion-resourcebundles branch from 67e9431 to 18e3df7 Compare January 20, 2026 16:33
@fbricon
fbricon marked this pull request as draft January 20, 2026 16:35
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.

Provide content-assist for resource bundle keys

2 participants