Skip to content

fix: show the help button of the New Language Server dialog for a template with instructions - #2046

Merged
lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/new-language-server-dialog-help-for-template-instructions
Nov 20, 2026
Merged

lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/new-language-server-dialog-help-for-template-instructions

Conversation

@lagergren

Copy link
Copy Markdown
Collaborator

Part of #1935.

A template can have a README.md, its instructions, which the help
button of the New Language Server dialog opens in
ShowInstructionDialog, as UserDefinedLanguageServer.md says. Since
fd5aed9 (#278), the dialog's createActions() returns OK and Cancel
only, so the dialog had no help button, and the instructions couldn't be
opened. Before that, the button showed for every template, and did
nothing for one without a README.

The dialog has the help button again, and shows it only while its
template has instructions. getHelpAction() returns one action, which
createActions() and DialogWrapper find again, and the dialog keeps
the button that DialogWrapper creates for it on its left. In an IDE
without context help, DialogWrapper removes help buttons, as for every
other dialog.

Not here: the choice of #1935 between the README of a template and its
docs page. Options B, C and D keep the README, at least for a custom
template, which has no docs page, and so this button; option A would
remove both.

Test: NewLanguageServerDialogInstructionsTest loads a template with a
README into the dialog, and one without, and checks that the help button
shows for the first only. It and NewLanguageServerDialogTransportTest
pass (17 tests).

…plate with instructions

Part of redhat-developer#1935.

A template can have a `README.md`, its instructions, which the help
button of the New Language Server dialog opens in
`ShowInstructionDialog`, as UserDefinedLanguageServer.md says. Since
fd5aed9 (redhat-developer#278), the dialog's `createActions()` returns OK and Cancel
only, so the dialog had no help button, and the instructions couldn't be
opened. Before that, the button showed for every template, and did
nothing for one without a README.

The dialog has the help button again, and shows it only while its
template has instructions. `getHelpAction()` returns one action, which
`createActions()` and `DialogWrapper` find again, and the dialog keeps
the button that `DialogWrapper` creates for it on its left. In an IDE
without context help, `DialogWrapper` removes help buttons, as for every
other dialog.

Not here: the choice of redhat-developer#1935 between the README of a template and its
docs page. Options B, C and D keep the README, at least for a custom
template, which has no docs page, and so this button; option A would
remove both.

Test: `NewLanguageServerDialogInstructionsTest` loads a template with a
README into the dialog, and one without, and checks that the help button
shows for the first only. It and `NewLanguageServerDialogTransportTest`
pass (17 tests).
@lagergren lagergren added this to the 0.30.2 milestone Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • The language server setup dialog now shows a help button when the selected template has instructions. Selecting it opens those instructions.
    • The help button stays hidden when no template is loaded or when the selected template has no instructions.
  • Bug Fixes
    • The button’s visibility now updates as templates are loaded, so it reflects whether instructions are available.

The dialog adds a help button that opens the current template’s instructions when its description is nonblank. The button is hidden when no instructions are available. A test checks its visibility before and after template selection.

Changes: Template Instructions Help Button

Layer / File(s) Summary
Help action and visibility
src/main/java/com/redhat/devtools/lsp4ij/launching/ui/NewLanguageServerDialog.java, src/test/java/com/redhat/devtools/lsp4ij/launching/ui/NewLanguageServerDialogInstructionsTest.java
The dialog adds a help action and updates its button visibility during initialization and after loading a template. The test checks visibility with no template, with instructions, and without instructions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: angelozerr, fbricon

Merge Risk: Minimal · up to 790a4

This restores the New Language Server dialog's help button for templates that have README instructions. The button stays hidden for templates without them. No actionable merge risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the New Language Server dialog's help button is shown again for a template that has instructions. The raw summary confirms the help action now appears only when the te…
Description check Passed The description explains the regression (fd5aed9 removed the help button), the fix (help action restored and shown only for templates with README instructions), the scope limit (#1935 decision not ad…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the New Language Server dialog's help button is shown again for a template that has instructions. The raw summary confirms the help action now appears only when the template description is nonblank, and the new test covers this behavior.

Full details: Description check

Explanation

The description explains the regression (fd5aed9 removed the help button), the fix (help action restored and shown only for templates with README instructions), the scope limit (#1935 decision not addressed), and the test coverage. It matches the changeset.

Recent review info

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: 3967e846-b07c-4b9f-8fb5-b859e4add065
Commits

Reviewing files that changed from the base of the PR and between 0af1afc and 790a468.

Files selected for processing: 2

  • src/main/java/com/redhat/devtools/lsp4ij/launching/ui/NewLanguageServerDialog.java
  • src/test/java/com/redhat/devtools/lsp4ij/launching/ui/NewLanguageServerDialogInstructionsTest.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@codecov

codecov Bot commented Nov 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.89474% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.43%. Comparing base (0af1afc) to head (790a468).

Files with missing lines Patch % Lines
...s/lsp4ij/launching/ui/NewLanguageServerDialog.java 57.89% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2046      +/-   ##
==========================================
- Coverage   49.44%   49.43%   -0.02%     
==========================================
  Files         813      813              
  Lines       33324    33337      +13     
  Branches     5191     5193       +2     
==========================================
+ Hits        16478    16480       +2     
- Misses      14272    14279       +7     
- Partials     2574     2578       +4     

☔ 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

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lagergren

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lagergren
lagergren merged commit e92baaa into redhat-developer:main Nov 20, 2026
9 checks passed
@lagergren lagergren added the bug Something isn't working label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant