Infer Xcode's SDK path dynamically #96
Merged
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.
Currently, the argument passed to
swiftcis hardcoded as-sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/. This causes SourceKit-LSP to fail if Xcode is installed in a different path (e.g., beta versions of Xcode). Instead of hardcoding the path, infer it dynamically usingxcode-select -p.The only potential issue this change could introduce is if the user has the Command Line Developer Tools (CLDT) set as the default rather than Xcode. However, I don't think that's problematic because:
MacOSX.platform.xcode-selectto its own path when it gets updated.xcode-selectreverting to CLDT, except perhaps if the user installs Homebrew using the installer script after installing Xcode.