Skip to content

Fix interrupted download recovery: check executable, not directory - #135

Merged
LakshyAAAgrawalP merged 1 commit into
microsoft:mainfrom
LakshyAAAgrawal:fix/check-executable-not-directory
Apr 10, 2026
Merged

LakshyAAAgrawalP merged 1 commit into
microsoft:mainfrom
LakshyAAAgrawal:fix/check-executable-not-directory

Conversation

@LakshyAAAgrawal

Copy link
Copy Markdown
Collaborator

Summary

If a language server binary download is interrupted (crash, kill, network timeout), the target directory exists but the executable does not. On next invocation, the directory-existence check passes, the download is skipped, and an AssertionError is raised because the executable is missing.

Fix: check for the executable instead of the directory, and use exist_ok=True on makedirs so a leftover directory from a previous attempt doesn't cause errors.

Affected servers:

  • rust-analyzer — rustanalyzer_ls_dir → rustanalyzer_executable_path
  • dart — dart_ls_dir → dart_executable_path
  • clangd — clangd_ls_dir → clangd_executable_path
  • omnisharp — omnisharp_ls_dir → omnisharp_executable_path, razor_omnisharp_ls_dir → razor_omnisharp_dll_path
  • typescript — tsserver_ls_dir → tsserver_executable_path

Not affected (already correct): kotlin, solargraph, jedi.

Fixes #131

If a language server binary download is interrupted, the target
directory exists but the executable does not. On next invocation the
directory check passes, the download is skipped, and the assertion
on the executable fails.

Fix by checking for the executable/binary instead of the directory.
Also use exist_ok=True on makedirs so a partial directory from a
previous attempt doesn't cause an error.

Affected servers: rust-analyzer, dart, clangd, omnisharp, typescript.
Kotlin and solargraph already checked correctly.

Fixes microsoft#131
@LakshyAAAgrawalP
LakshyAAAgrawalP merged commit 0d9615b into microsoft:main Apr 10, 2026
8 of 9 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

Development

Successfully merging this pull request may close these issues.

Interrupting the rust-analyzer download leads to AssertionError on next invocation

3 participants