Closed idelfonsog2 closed 3 years ago
I did a quick check, and it turns out that sourcekit-lsp
isn't on the PATH on macOS. However, the following setting does work fine for me:
"sourcekit-lsp.serverPath": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp",
Did you verify this file exists? That is, I assume you have Xcode installed, as well as its command line tools?
Also, see the instructions for VS Code for a correct launch.json
configuration. I assume your program
setting is incorrect and that you're missing a preLaunchTask
setting?
I did a quick check, and it turns out that
sourcekit-lsp
isn't on the PATH on macOS. However, the following setting does work fine for me:"sourcekit-lsp.serverPath": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp",
Did you verify this file exists? That is, I assume you have Xcode installed, as well as its command line tools?
Thank you for the quick response @svanimpe !
I added to my $PATH: /Users/idelfonso/anaconda3/bin:/Users/idelfonso/anaconda3/condabin:/Users/idelfonso/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
Also I do have Xcode install and I found the path as the one mention abode with the following:
> xcrun --find sourcekit-lsp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp
I'll check the instructions on that file Thanks!
oh wait its actually not there!
So it's fixed now?
Apologize, I am still seeing that I might not have followed the instructions properly. For the LLDB library to specify in VSCode editor for macOS, would it be where it is?
xcrun --find lldb
/Applications/Xcode.app/Contents/Developer/usr/bin/lldb
This works for me: /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB
For launch.json and tasks.json I used the same values as on Linux.
Thank you @svanimpe that path worked for me and for the launch.json I used the following. In macOS, the executable has a different path and name.
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/.build/x86_64-apple-macosx/debug/Run",
"args": [],
"cwd": "${workspaceFolder}",
"preLaunchTask": "swift build",
}
]
}
In the instructions, the path is ${workspaceFolder}/.build/debug/\<program> where <program>
is the name of your executable target. In your case, the executable seems to Run, so ${workspaceFolder}/.build/debug/Run should work.
That .build/debug folder is just a symbolic link to a platform-dependent folder (such as .build/x86_64-apple-macosx/debug), which is why I prefer it.
editor: VSCode
I'm getting the above warning. In my project VsCode has requested me to create two files in order to debug my vapor application in it, which look like the following:
The SourceKitLSP settings look like the following:
Any suggestions?