Skip to content

languages: Validate pylsp binary before returning from check_if_user_installed#51034

Merged
Veykril merged 1 commit intozed-industries:mainfrom
rgbkrk:pylsp-validate-user-installed-binary
Mar 11, 2026
Merged

languages: Validate pylsp binary before returning from check_if_user_installed#51034
Veykril merged 1 commit intozed-industries:mainfrom
rgbkrk:pylsp-validate-user-installed-binary

Conversation

@rgbkrk
Copy link
Copy Markdown
Collaborator

@rgbkrk rgbkrk commented Mar 8, 2026

Run pylsp --version via delegate.try_exec() in both branches of PyLspAdapter::check_if_user_installed before returning the binary. If execution fails (broken shebang, missing interpreter, etc.), log a warning and return None so the system falls through gracefully instead of surfacing an error dialog.

This matches the existing validation pattern used by TyLspAdapter and RuffLspAdapter in their fetch_server_binary implementations.

No idea if this closes an issue but it sure was annoying on a system where I deleted the pylsp environment I had. It surprised me too since I had pylsp disabled in settings.

Release Notes:

  • Fixed detection of when pylsp is not installed properly on a user's system so that it doesn't get launched as an LSP when it doesn't exist.

Run `pylsp --version` via `delegate.try_exec()` in both branches of
`PyLspAdapter::check_if_user_installed` before returning the binary.
If execution fails (broken shebang, missing interpreter, etc.), log a
warning and return None so the system falls through gracefully instead
of surfacing an error dialog.

This matches the existing validation pattern used by TyLspAdapter and
RuffLspAdapter in their `fetch_server_binary` implementations.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 8, 2026
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Mar 8, 2026
@JosephTLyons JosephTLyons assigned osiewicz and Veykril and unassigned osiewicz Mar 10, 2026
@JosephTLyons JosephTLyons requested a review from Veykril March 10, 2026 19:33
@Veykril
Copy link
Copy Markdown
Member

Veykril commented Mar 11, 2026

Thanks!

@Veykril Veykril changed the title Validate pylsp binary before returning from check_if_user_installed languages: Validate pylsp binary before returning from check_if_user_installed Mar 11, 2026
@Veykril Veykril merged commit c08fd43 into zed-industries:main Mar 11, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants