Skip to content

Installers: a server created when its binary is already installed keeps the template's command (and three test gaps from CodeRabbit) #2011

Closed

Description

@lagergren

Two leftovers from CodeRabbit's reviews of PRs merged for 0.30.0, collected so they aren't lost. Neither is new in 0.30.0, and neither blocks it.

A server created when its binary is already installed keeps the template's command

CodeRabbit noted this on #1926 (cpp_ls), but every installer works this way. The 38 installers under src/main/resources/templates set the server's command (configureServer) only in the steps that run after a download, and none in their check. So when the check finds the server already installed (for example, when a language server is created again from its template, or a second one from the same template), the download is skipped, and the new language server keeps the template's command, such as cpp_ls. That works only if the binary is on the PATH.

Suggestion: also set the command when the check finds the server installed, without overwriting a command the user has changed.

Test gaps (no change in behavior)

Activity

  1. modified the milestones: 0.31.0, 0.30.2 on Nov 17, 2026
  2. lagergren commented on Nov 20, 2026

    @lagergren
    CollaboratorAuthor

    The three test gaps are covered by #2033, merged into 0.30.2 as 13916a2. What is left here is the first part: a server created when its binary is already installed keeps the template's command.

  3. lagergren commented on Nov 20, 2026

    @lagergren
    CollaboratorAuthor

    @angelozerr a proposal for the rest of the first part, which needs your OK since it extends the installer.json format.

    When the check of an installer finds the language server installed, the download doesn't run, and only the download gives the language server its command. So a language server created from the template once its binary is installed keeps the template's command. That concerns the templates whose check is fileExists and whose command isn't the installed path:

    • harper-ls, perl-lsp, clojure-lsp and jdtls started ${BASE_DIR}/..., a placeholder: fix: start harper-ls, perl-lsp, clojure-lsp and jdtls where their installers put them #2041 points them at the installed path, as luau-lsp and lemminx do;
    • cpp_ls, docker-language-server and terraform-ls start a command on the PATH, which a user who hasn't run the installer can rely on (their installers don't run on start), so the template should keep it;
    • clangd (a folder named after its version), camel-lsp-server (a jar named after its version), ada_language_server, rust-analyzer and wgsl-analyzer (paths by architecture), and the debug adapters codelldb, perl-dap and vscode-js-debug have no fixed path for the template.

    A check can already have an onSuccess, as every installer task can, so for a fixed path, a passing check can give the command today. What's missing is:

    1. the file that fileExists found, for a check with a wildcard such as clangd's ${serverDist}/clangd*/bin/clangd, as a property, say ${check.file};
    2. a configureServer that changes the command only while it is still the template's, so that a passing check, which also runs from Check installation in the settings, doesn't replace a command that the user changed.

    clangd's check would then be:

    "check": {
      "fileExists": {
        "name": "Check if clangd is installed",
        "file": {
          "windows": "${serverDist}/clangd*/bin/clangd.exe",
          "default": "${serverDist}/clangd*/bin/clangd"
        },
        "onSuccess": {
          "configureServer": {
            "name": "Configure clangd server command",
            "command": "\"${check.file}\"",
            "update": true
          }
        }
      }
    }

    and the same for the other templates above, with the schema and the docs of installer.json updated. Would that be OK?

  4. added
    bug
    on Nov 21, 2026
  5. added a commit that references this issue on Nov 23, 2026
    7d43779
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

    buginstalltemplate-ls

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions