Skip to content

fix: DevKit no longer warns about the capitalization of the nameKey and descriptionKey of a server or debugAdapterServer extension - #2209

Closed
lagergren wants to merge 1 commit into
redhat-developer:mainfrom
lagergren:fix/devkit-capitalization-of-key-attributes
Closed

lagergren wants to merge 1 commit into
redhat-developer:mainfrom
lagergren:fix/devkit-capitalization-of-key-attributes

Conversation

@lagergren

Copy link
Copy Markdown
Collaborator

Fixes #450

What

DevKit warned that the nameKey of a server extension, such as languageServer.presentableName, "is not properly capitalized, should have title capitalization". The same goes for its descriptionKey, and for those of a debugAdapterServer extension. Those attributes carried @Nls(capitalization = …).

DevKit's PluginXmlCapitalizationInspection takes an attribute's capitalization from the @Nls of the bean field it binds to. It checks a property's text only when the value references one, and DevKit gives that reference to the key attributes of a fixed list of platform beans (ConfigurableEP, InspectionEP, …). For any other bean, it checks the key itself. The platform's own key attributes carry the same @Nls, but only work because DevKit hard-codes those beans.

Change

nameKey and descriptionKey of ServerExtensionPointBean and DebugAdapterServerExtensionPointBean are @NonNls instead of @Nls(capitalization = …). DevKit's NlsInfo reads @NonNls as not localized, and the inspection skips such a field.

Not in this PR:

  • DevKit can't resolve our keys, so it now checks neither the key nor its property's text. Checking the text would need a DevKit change.
  • name and description never had @Nls. Adding title capitalization there would warn about names such as "clangd".

Tests

New ExtensionPointBeanKeyAttributesTest (2 tests). It reads the four fields' annotations from the class files, with the platform's repackaged ASM, since DevKit reads the class-file annotations of a dependency, which reflection doesn't see.

  • Red-green: both tests fail without the change and pass with it.
  • Headless on IC 2024.2, 2025.3 and IU 2026.3: 2 of 2 each.
  • The extension-point test packages pass on all three platforms: 10 tests each.

Behaviour change

Before After
nameKey="languageServer.presentableName" gets DevKit's capitalization warning No capitalization warning on nameKey or descriptionKey, which DevKit no longer checks

…nd descriptionKey of a server or debugAdapterServer extension

The nameKey and descriptionKey of ServerExtensionPointBean and
DebugAdapterServerExtensionPointBean were @nls(capitalization = Title)
and @nls(capitalization = Sentence), so DevKit asked for the key itself,
e.g. languageServer.presentableName, to have title capitalization.

What DevKit reads: its "Plugin.xml capitalization" inspection
(PluginXmlCapitalizationInspection) takes the capitalization of an
extension attribute from the NlsInfo of the bean field it binds to. When
the attribute's value has a reference to a property, it checks the text
of that property; otherwise it checks the attribute's own text. DevKit
gives that reference (I18nReferenceContributor) only to the key
attributes of a fixed list of platform beans, such as ConfigurableEP.key,
InspectionEP.key and InlayHintsProviderExtensionBean.nameKey, which are
@nls(capitalization = ...) like ours were. For any other bean, LSP4IJ's
included, it checks the key. NlsInfo reads @NonNls (and @propertykey,
which needs a fixed bundle) as not localized, so the inspection skips
the field; DevKit also stops spell-checking an attribute whose field is
@NonNls. A key isn't a text shown to the user, so both fields are now
@NonNls. Both annotations are kept in the class file, where DevKit reads
them for a plugin that depends on LSP4IJ, so a test reads them from there.

Fixes redhat-developer#450
@lagergren lagergren added this to the 0.30.2 milestone Nov 24, 2026
@lagergren lagergren added the enhancement New feature or request label Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4bddfed4-808b-44e2-8bb4-a84fd8b0aa86
Commits

Reviewing files that changed from the base of the PR and between d592c89 and c5f1427.

Files selected for processing: 3

  • src/main/java/com/redhat/devtools/lsp4ij/dap/definitions/extension/DebugAdapterServerExtensionPointBean.java
  • src/main/java/com/redhat/devtools/lsp4ij/server/definition/extension/ServerExtensionPointBean.java
  • src/test/java/com/redhat/devtools/lsp4ij/server/definition/extension/ExtensionPointBeanKeyAttributesTest.java

@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.65%. Comparing base (1b0b053) to head (c5f1427).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2209      +/-   ##
==========================================
+ Coverage   54.59%   54.65%   +0.05%     
==========================================
  Files         834      834              
  Lines       35385    35385              
  Branches     7300     5546    -1754     
==========================================
+ Hits        19320    19340      +20     
+ Misses      13223    13206      -17     
+ Partials     2842     2839       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lagergren

Copy link
Copy Markdown
Collaborator Author

Combined, unchanged, with the other small fixes into #2219, one commit each, so that they take one review instead of six.

@lagergren lagergren closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect capitalization warning

1 participant