-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add VSCode launch configuration for attaching to executable. #745
Conversation
Useful for attaching to already running sourcekit-lsp executable.
@@ -7,7 +7,8 @@ | |||
"program": "${workspaceFolder:sourcekit-lsp}/.build/debug/sourcekit-lsp", | |||
"args": [], | |||
"cwd": "${workspaceFolder:sourcekit-lsp}", | |||
"preLaunchTask": "swift: Build Debug sourcekit-lsp" | |||
"preLaunchTask": "swift: Build Debug sourcekit-lsp", | |||
"sourceLanguages": ["swift"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also set the sourceLanguage to swift so the CodeLLDB on swift throw breakpoint is available.
"type": "lldb", | ||
"request": "attach", | ||
"name": "Attach sourcekit-lsp", | ||
"program": "${workspaceFolder:sourcekit-lsp}/.build/debug/sourcekit-lsp", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought: Since you are hard-coding the debug configuration, should the name of this action be “Attach sourcekit-lsp (debug)” or “Attach to debug build of sourcekit-lsp”. Just so nobody gets confused if it’s not attaching properly because you’re running a release build of sourcekit-lsp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point. I'll add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@swift-ci Please test |
Useful for attaching to already running sourcekit-lsp executable.
Example of usage.
Sourcekit-lsp: server path
to the path to your debug version of sourcekit-lsp:<Fullpath>/sourcekit-lsp/.build/debug/sourcekit-lsp
.Attach sourcekit-lsp
.You are now debugging the sourcekit-lsp server running in the "target" VSCode.