Skip to content

Move LSP installs to ~/.multilspy/lsp/, add server_binary and server_install_dir config#137

Merged
LakshyAAAgrawal merged 1 commit intomicrosoft:mainfrom
LakshyAAAgrawal:fix/install-dir-and-config-overrides
Apr 10, 2026
Merged

Move LSP installs to ~/.multilspy/lsp/, add server_binary and server_install_dir config#137
LakshyAAAgrawal merged 1 commit intomicrosoft:mainfrom
LakshyAAAgrawal:fix/install-dir-and-config-overrides

Conversation

@LakshyAAAgrawal
Copy link
Copy Markdown
Collaborator

Summary

Language servers were downloading binaries into the Python package's site-packages directory (os.path.dirname(__file__) + "/static/"). This is unconventional — site-packages isn't meant to be writable at runtime — and breaks with read-only package installations.

New config options

config = MultilspyConfig.from_dict({
    "code_language": "rust",
    # Point to a pre-installed binary — skips download entirely
    "server_binary": "/usr/local/bin/rust-analyzer",
    # Or override where multilspy downloads server artifacts
    "server_install_dir": "/my/custom/cache/dir",
})

Changes

  • Default install location is now ~/.multilspy/lsp/<server_name>/ instead of <package>/static/
  • config.server_binary: skip download entirely, use a pre-installed binary at the given path
  • config.server_install_dir: override the install location for server artifacts
  • Fix Interrupting the rust-analyzer download leads to AssertionError on next invocation #131: check executable existence instead of directory existence (handles interrupted downloads)
  • All 10 language servers updated consistently
Server server_binary server_install_dir
rust-analyzer returns binary path ~/.multilspy/lsp/RustAnalyzer/
dart returns binary + args ~/.multilspy/lsp/dart-language-server/
clangd returns binary path ~/.multilspy/lsp/clangd/
omnisharp returns binary, "" ~/.multilspy/lsp/OmniSharp/
typescript returns binary + --stdio ~/.multilspy/lsp/ts-lsp/
eclipse jdtls N/A (multi-binary) ~/.multilspy/lsp/EclipseJDTLS/
kotlin N/A (multi-binary) ~/.multilspy/lsp/KotlinLanguageServer/
jedi uses as cmd directly N/A (pip dependency)
gopls uses as cmd, skips checks N/A (system binary)
solargraph returns binary path N/A (gem dependency)

Fixes #136, fixes #131, fixes #109

…install_dir config

Language servers were downloading binaries into the Python package's
site-packages directory (os.path.dirname(__file__) + "/static/"). This
is unconventional, breaks with read-only package installations, and
causes issues when multiple environments share the same package.

Changes:
- Default install location is now ~/.multilspy/lsp/<server_name>/
  via MultilspySettings.get_server_install_directory()
- Add config.server_binary: skip download entirely and use a
  pre-installed binary at the given path
- Add config.server_install_dir: override the default install
  location for server artifacts
- Fix microsoft#131: check executable existence instead of directory existence
  to handle interrupted downloads gracefully

All 10 language servers updated consistently:
- Servers that download binaries (rust-analyzer, dart, clangd,
  omnisharp, typescript, jdtls, kotlin) use the new install dir
- Servers that use system tools (jedi, gopls, solargraph) respect
  server_binary to allow custom paths

Fixes microsoft#136, fixes microsoft#131, fixes microsoft#109
@LakshyAAAgrawal LakshyAAAgrawal force-pushed the fix/install-dir-and-config-overrides branch from c0a6dc4 to 604631a Compare April 10, 2026 01:44
@LakshyAAAgrawal
Copy link
Copy Markdown
Collaborator Author

Credit to @jsimonrichard who proposed the same custom_lsp_binary concept in #125. This PR implements the idea across all 10 language servers and also adds server_install_dir + the install directory migration (#136).

@jsimonrichard — thank you for the original idea and implementation! This PR supersedes #125 with a broader scope. Would you like to review the approach here?

@LakshyAAAgrawal LakshyAAAgrawal merged commit 0adbb14 into microsoft:main Apr 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants