Repository navigation
Description
Problem
A language server template can have a README.md, which LSP4IJ shows as instructions in the New Language Server dialog. The docs say so: "If the template directory contains a README.md file, you can open the instructions by pressing the help icon" (UserDefinedLanguageServer.md). The dialog has no help icon, though, so the instructions can't be opened at all.
With the clojure-lsp template, which has a README.md, the dialog shows only OK and Cancel, and the link "Need help with install, config, or usage? Click here" opens docs/user-defined-ls/clojure-lsp.md, not the README:
Analysis
Claude Code traced it in the code on main:
-
LanguageServerTemplateManagerreadsREADME.mdof a template into its description. -
NewLanguageServerDialog.getHelpAction()opensShowInstructionDialog, which renders that description as Markdown:@Override protected @NotNull Action getHelpAction() { return new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { if (currentTemplate != null && StringUtils.isNotBlank(currentTemplate.getDescription())) { ShowInstructionDialog dialog = new ShowInstructionDialog(currentTemplate, project); dialog.show(); } } }; }
-
But
NewLanguageServerDialog.createActions()returns only OK and Cancel:@Override protected Action @NotNull [] createActions() { return new Action[]{getOKAction(), getCancelAction()}; }
DialogWrapperadds the help button only throughcreateActions(), sogetHelpAction()is never used, andShowInstructionDialoghas no other caller. -
Even before, the button wasn't tied to the README: the default
DialogWrapper.createActions()adds the help action whenevergetHelpAction()is overridden. The button was always visible and always enabled, and for a template without a README a click did nothing (actionPerformedonly checksgetDescription()).
History
- 2024-05-21, eaea277 "Handle readme and instruction dialog": the help action and
ShowInstructionDialogare added. - 2024-05-30, fd5aed9 "Explicitly declare actions that should have buttons at the bottom of new ls dialog" (part of feat: Export lsp servers #278):
createActions()is overridden with OK and Cancel only. Since then the help button is gone. Nothing in the discussion of feat: Export lsp servers #278 says it was meant to go, so it looks accidental. - 2025-06-02, 7a4962b "refactor: use commons class for DAP/LSP template": the dialog gets a link to the docs page of the template ("Need help with install, config, or usage? Click here"), to
docs/user-defined-ls/<id>.mdunlesstemplate.jsonsetsurl.
So for about two and a half years the README has been unreachable, and for one and a half years the dialog has had a second way to the same instructions.
The same instructions in two places
Of the 33 LSP templates, 13 have a README.md; the 9 DAP templates have none. Most of the 13 also have a page in docs/user-defined-ls/, with largely the same text:
| Template | README | Docs page | Link in the dialog |
|---|---|---|---|
| clojure-lsp, gopls, metals, rust-analyzer, sourcekit-lsp, sysml-lsp, typescript-language-server, vscode-css-language-server, vue-js-language-server | yes | yes | to the docs page |
| vscode-html-language-server | yes | yes | none ("url": null) |
| jdtls, lemminx | yes | no | none ("url": null) |
| candor-lsp | yes | no | to a docs page that doesn't exist |
| cpp_ls (#1926, open) | yes | yes | to the docs page |
The copies drift apart already:
- sysml-lsp: the README says to click Run Installation in the Installer tab; the docs page says to open a
.sysmlfile and click the install banner. - gopls, typescript-language-server: the README is the 2024 text; the docs page has grown (demo, steps, settings) and was last changed in 2026-10.
- vue-js-language-server: both copies are identical today, so every fix has to be made twice.
- jdtls and lemminx have their instructions only in the README, which nobody can open, and no link either.
The contribution guide (UserDefinedLanguageServerTemplate.md) asks for a docs page and doesn't mention a README, yet new templates still add both (candor-lsp, cpp_ls).
Options
A. Docs page only. Remove the READMEs of the built-in templates and the README support.
- One source; the dialog already links to it; the contribution checklist already asks for it; DAP templates already work like this.
- The docs pages can use images and relative links, which a README rendered in the IDE can't.
- But a custom template (imported from a folder or a zip, see Custom template structure) has no docs page, and its README is its only way to carry instructions.
B. README only. Remove the docs pages and show the README in the IDE.
- Works offline and inside the IDE.
- But the docs pages are the public documentation (linked from the template list in UserDefinedLanguageServer.md), have images and longer text, and every page would have to fit a small dialog.
C. Docs page for built-in templates, README for custom templates.
- Built-in templates: only the docs page; the dialog links to it. Move what only a README has (jdtls, lemminx, candor-lsp) into a docs page, then delete the READMEs.
- Custom templates: keep reading
README.mdand bring the help button back, shown only when the template has a description, so it doesn't appear for built-in templates. - One source per template, and no feature is lost.
D. The template README is the only page, also on GitHub.
Move each docs page into the README.md of its template folder, and its images into an images folder there. The link in the dialog opens that README on GitHub instead of docs/user-defined-ls/<id>.md:
https://github.com/redhat-developer/lsp4ij/blob/main/src/main/resources/templates/lsp/<folder>/README.md
In the IDE, the README could show in one of two ways:
- A TL;DR section in the README, shown in the help popup with a "Read more" link to the full README on GitHub. The popup stays short, and the long text and the images stay on GitHub.
- Only the link, as today with "Need help with install, config, or usage?", and no popup.
A custom template isn't on GitHub, so its popup would show the whole README, without a "Read more" link.
What speaks for it, and what to check:
- One file per template, and built-in and custom templates work the same way: a custom template carries its instructions as
README.mdtoo. - The instructions sit next to the
template.jsonthey describe, so a template PR changes one folder. - To check: the images (today 12.4 MB for the LSP docs, 11.0 MB for DAP) must not end up in the plugin jar, so
processResourceshas to exclude them. The popup then can't show them, which fits a TL;DR without images. - The link must be built from the template folder, not the
id(they differ for jdtls, whoseidisjdt-ls). - 43 links in UserDefinedLanguageServer.md point to
docs/user-defined-ls/; they would move, and the old pages could stay as short pointers so external links keep working.
Which way should the template instructions go? Once that is decided, the steps follow from it.
Related: #1926 adds cpp_ls with both a README and a docs page.
Activity
fix: show the help button of the New Language Server dialog for a tem…
lagergren commentedon Nov 25, 2026
Fixed on main for 0.30.2:
e92baaa9) brings back the help button of the New Language Server dialog, for a template that has instructions.01c7a2ac) adds the missing page that the dialog linked to, and makes the templates' instructions match their docs pages.Whether the help button should open the README or the docs page is a documentation choice, not a bug. It can have an issue of its own if wanted.