Skip to content

New Language Server dialog: the template instructions (README.md) can't be opened, and the template docs exist twice #1935

Done

Description

@muescha

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:

New Language Server dialog with the clojure-lsp template: a docs link, no help button

Analysis

Claude Code traced it in the code on main:

  • LanguageServerTemplateManager reads README.md of a template into its description.

  • NewLanguageServerDialog.getHelpAction() opens ShowInstructionDialog, 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()};
    }

    DialogWrapper adds the help button only through createActions(), so getHelpAction() is never used, and ShowInstructionDialog has no other caller.

  • Even before, the button wasn't tied to the README: the default DialogWrapper.createActions() adds the help action whenever getHelpAction() is overridden. The button was always visible and always enabled, and for a template without a README a click did nothing (actionPerformed only checks getDescription()).

History

  • 2024-05-21, eaea277 "Handle readme and instruction dialog": the help action and ShowInstructionDialog are 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>.md unless template.json sets url.

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 .sysml file 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.md and 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.md too.
  • The instructions sit next to the template.json they 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 processResources has 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, whose id is jdt-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

  1. added
    bug
    documentation
    on Nov 21, 2026
  2. lagergren commented on Nov 25, 2026

    @lagergren
    Collaborator

    Fixed on main for 0.30.2:

    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.

  3. added this to the 0.30.2 milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    UIbugdocumentationtemplate-ls

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions