refactor(xcresult): find a language server without requiring xcrun - #1179
Draft
dfrankland wants to merge 1 commit into
Draft
refactor(xcresult): find a language server without requiring xcrun#1179dfrankland wants to merge 1 commit into
dfrankland wants to merge 1 commit into
Conversation
`xcrun --find` is the only way to locate a tool inside an Xcode toolchain, so it is right on macOS and useless anywhere else — it returned `None` off macOS by construction. That was fine while the only consumer read `.xcresult` bundles, which cannot exist without Xcode. The Swift toolchain on Linux ships `sourcekit-lsp` on `PATH` and has no `xcrun` at all, so discovery now tries `xcrun` on macOS and falls back to a `PATH` scan. Nothing else in `test_locations.rs` or `lsp.rs` is platform-specific, which makes this the only thing standing between the declaration index and a non-Apple host. The scan also checks the executable bit rather than just for a file of the right name, so a stray non-executable `sourcekit-lsp` reports "not found" instead of failing later at spawn time with something less obvious. Both new tests run on any platform, which is the point. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 31, 2026
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.
Stacked on #1178. Review that first; this is one commit on top.
xcrun --findis the only way to locate a tool inside an Xcode toolchain, so it is right on macOS and useless anywhere else — it returnedNoneoff macOS by construction. That was fine while the only consumer read.xcresultbundles, which cannot exist without Xcode.The Swift toolchain on Linux ships
sourcekit-lsponPATHand has noxcrunat all. Discovery now triesxcrunon macOS and falls back to aPATHscan. Nothing else intest_locations.rsorlsp.rsis platform-specific, so this is the only thing standing between the declaration index and a non-Apple host.The scan also checks the executable bit rather than just for a file of the right name, so a stray non-executable
sourcekit-lspreports "not found" instead of failing later at spawn time with something less obvious.Both new tests run on any platform, which is the point — they inject
PATHrather than mutating it, so they are not racy under parallel test execution.🤖 Generated with Claude Code