Closed TeamPuzel closed 2 months ago
Hi @TeamPuzel!
We have added support for explicit path specification for other extensions/language servers (rust, zig, golang, clang) and you're looking for this to be implemented for swift as well. Gotcha.
For reference the swift extension lives here: zed-extensions/swift.
See also:
Thanks for reporting!
For reference the swift extension lives here: zed-extensions/swift.
Thanks, I was able to get it to check the path first 👍
Wonderful, so this is ok to close?
For future reference / searchability can you paste any settings that got it working as expected?
For future reference / searchability can you paste any settings that got it working as expected?
Ah, I didn't find any settings that worked, I instead added this to the source code
if let Some(path) = worktree.which("sourcekit-lsp") {
return Ok(zed::Command {
command: path,
args: Default::default(),
env: worktree.shell_env(),
});
}
This was done in https://github.com/zed-extensions/swift/pull/11 and is available in v0.3.0 of the Swift extension.
Check for existing issues
Describe the bug / provide steps to reproduce it
The Swift extension appears to be getting the lsp binary from Xcode, so when I'm using the latest Swift toolchain rather than the one from Xcode there's a mismatch as Zed uses an outdated language server.
This results in missing types, attributes and keywords:
It would be an improvement if Zed respected which binary is actually in the path and only used Apple tools to get their binary as a fallback.
It also seems to ignore adding the path manually in my Zed configuration file
Environment
Zed: v0.141.0 (Zed Preview) OS: macOS 15.0.0 Memory: 32 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
N/A
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.N/A