Repository navigation
fix(lsp): start npm-installed language servers on Windows - #517
Merged
Merged
Conversation
npm writes a POSIX sh script next to each .cmd shim (pyright-langserver and pyright-langserver.cmd). The lookup tried the bare name first, and off Unix every regular file counts as executable, so it returned the script. Starting it failed with os error 193, so no npm-installed server (TypeScript, Pyright, bash, JSON, YAML) ever ran on Windows. PATHEXT candidates are now tried before the bare name. Unix has no PATHEXT, so nothing changes there. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows the
lsptool found npm-installed servers onPATHand then failed to start them with%1 is not a valid Win32 application(os error 193).npm writes a POSIX
shscript next to each.cmdshim (pyright-langserverandpyright-langserver.cmd).lookup_in_dir_with_extstried the bare name first, and off Unix every regular file counts as executable, so it returned the script. That covers every npm-installed server: TypeScript, Pyright, bash, JSON, YAML.Reproduced on a Windows 11 machine with the real
npxpair: startingnpxfails with error 193,npx.cmdruns.Fix
PATHEXTcandidates are tried before the bare name. Unix has noPATHEXT, so the lookup is unchanged there.Verification
lookup_prefers_a_pathext_shim_over_the_extensionless_scriptfails onmain(returnstool, nottool.CMD) and passes here.cargo test -p whycodes-lsp: 128 passed. Clippy, fmt, budget scripts: green.detect.rsmeasured locally aftercargo llvm-cov clean, no uncovered lines. The fullscripts/coverage.shworkspace run was not done locally.lsptool; none is installed on this machine.docs/knowhow.mdhas the entry.🤖 Generated with Claude Code