-
Notifications
You must be signed in to change notification settings - Fork 74
Unable to configure extension on NixOS #988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is the swift toolchain on NixOS structured differently from the standard toolchains? The extension is assuming the Swift executable is part of a toolchain, which includes lldb, swiftc, sourcekit-lsp and various other binaries. You can also set the path to the sourcekit-lsp executable in the settings. |
swiftc and sourcekit-lsp are in different packages, yes.
Which setting is that? I can only find one to set a path to the entire Swift SDK with swiftc etc. ( |
"swift.sourcekit-lsp.serverPath": "/path/to/sourcekit-lsp" See if this solves your issue 🙂
For context: This setting won't show up in the settings UI because its very easy to mess up the settings configuration since having mismatching sourcekit-lsp and swift can lead to unexpected behaviour . Its only encouraged to use this setting if you know very well that the swift and sourcekit-lsp toolchain matches (which should be the case for official releases) |
Thanks! That part seems to work. It is now complaining that it can't find certain packages and that the manifest is invalid 🙃 But at least it starts. |
@thomaseizinger out of interest where is the swift version of lldb stored in a NixOS install of Swift. |
They are in the same directory:
|
Actually, I need to retract that. It crashes with the following message:
|
That seems to be a known issue already tracked in swiftlang/swift#67975. |
Not sure this is something the VSCode extension can fix. It seems odd that NixOS have decided to release these as separate packages. The version of sourcekit-lsp is very closely linked to the Swift version. Is there any chance you have a different version of sourcekit-lsp from Swift? Also can you run sourcekit-lsp separately from VSCode? |
I opened an issue on nixpkgs too: NixOS/nixpkgs#331943
I'll raise it with the maintainers.
Both packages say version
Yes. I am getting:
|
Describe the bug
I am trying to configure this extension in NixOS. I am setting
swift.path
to a directory that has two symlinks:swift
to theswift
binarysourcekit-lsp
to thesourcekit-lsp
binaryDespite these things being in place, the extension tries to start the
sourcekit-lsp
binary from the wrong directory:If I remove the symlink, the extension correctly starts the LSP server but it then complains that it cannot find
swift
(understandably).To Reproduce
See above.
Expected behavior
To respect the configured symlinks.
Environment
Additional context
It is somewhat inconvenient that the configuration for sourcekit-lsp and swift is just one directory. Other LSPs that I use allow you to configure a direct path to the LSP binary. That seems to be more robust as I've not run into any issues with Rust and Kotlin for example.
The text was updated successfully, but these errors were encountered: