Skip to content

A downloaded archive whose root entry is ./ gives its language server a command with /./ #2139

Done

Description

@lagergren

What happens

A downloaded archive whose root entry is ./ gives ${output.dir}, and so the command of its language server, a /./. The bundled cpp_ls installer, with cpp_ls-darwin-x64.tar.gz and its other assets, sets the command

"$USER_HOME$/.lsp4ij/lsp/cpp_ls/./cpp_ls"

and its installer console shows ${output.dir}=$USER_HOME$/.lsp4ij/lsp/cpp_ls/.. The server starts, so this is cosmetic, but the command shows in the settings and the LSP console, and a command compared as written, as replaceTemplateCommand compares the template's command, would not match the same path without the ./.

Cause

When an extracted archive is a single directory and stripRootFolder isn't set, DownloadTask appends that directory's name to the output dir:

var decompressFolderName = decompressedDir.getName(decompressedDir.getNameCount() - 1);
dir = dir + "/" + decompressFolderName;
outputDir = outputDir.resolve(decompressFolderName);

For an archive whose root entry is ./, decompressedDir is <output dir>/., so the name is ..

Expected

A root entry of . adds nothing to ${output.dir}: $USER_HOME$/.lsp4ij/lsp/cpp_ls/cpp_ls. For instance, skip a root folder named ., or normalize decompressedDir before taking its name.

Found by a live run of the bundled installers for 0.30.2, on macOS (arm64 and x86_64).

Activity

  1. added
    bug
    on Nov 23, 2026
  2. added this to the 0.30.2 milestone on Nov 24, 2026
  3. added a commit that references this issue on Nov 25, 2026
    84b4ec3
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

    buginstall

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions