-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: add debug code lens #3561
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
Conversation
Great! Yet there's an error that happens for me when I click on the same
as if we forget to clean some |
I like this but I've never been able to get vscode-lldb to work under my windows install and have to use nativedebug instead to get msvc support. I'm not convinced that making rust-analyzer depend on vscode-lldb is the right thing to do. |
Neat! But I agreed with @kjeremy , depends on vscode-lldb directly may not be the best option here. (I am in Windows too) I was skimming the PR and found that we actually didn't use any vscode-lldb function directly. So , I wonder what happen whether it is possible if we remove:
And let vscode itself to resolve what Debugger to use ? |
cc @vadimcn for general awareness :) |
r=me with nits addressed |
I really think the dependency on vscode-lldb is worth a discussion before
merging.
…On Thu, Mar 12, 2020, 11:42 AM Aleksey Kladov ***@***.***> wrote:
r=me with nits addressed
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3561 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBACRFSVSRFAAHX66XNQFDRHD7FXANCNFSM4LF6QOTQ>
.
|
I am def on-board with adding vs-code lldb as a dependency. Like, if you use Rust, you probably need to have a way to debug it anyway. I don't immediately see any costs here (are there some?), but I do see benefits. |
@matklad right but we need to use a different debugger extension on windows. |
Ah, that's a bummer. But code-lldb works with mingw toolchain on windows, right? i guess we can start with code-lldb and than add windows support... |
Good question. I don't have mingw installed on my windows box. I was talking about msvc above. |
Is there a way to only show the code lens when code-lldb is installed instead of requiring code-lldb? |
Is there something bin the debugger api we could use to make it debugger
agnostic?
…On Thu, Mar 12, 2020, 2:30 PM bjorn3 ***@***.***> wrote:
Is there a way to only show the code lens when code-lldb is installed
instead of requiring code-lldb?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3561 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBACRB7HTWLQZXMIJ65JBTRHES3LANCNFSM4LF6QOTQ>
.
|
There do is a way to find out whether const enableDebugTestCodeLens = vscode.extensions.getExtension("vadimcn.vscode-lldb") != null; |
use `Vec::new` instead of `Vec::with_capacity(0)` Co-Authored-By: Veetaha <[email protected]>
@kjeremy: Debugging with PDB is supposed to work (though not as well as with DWARF debug info). But I don't see any bug reports from you in my tracker, so can't comment on your troubles. :) In general, I can concur with the reluctance to hardcode a dependency on a specific extension. After all, the bus factor of CodeLLDB is currently equal to one. Unfortunately, it is not so easy to be debugger-agnostic, because VSCode did not standartize launch configuration schemas. There isn't a general agreement on how the executable, its arguments and environment variables should be specified. The best thing I can propose is to allow users to specify the entire launch config with placeholders for things like executable path, test name, etc. VSCode does not provide tools to expanding placeholders out of the box, but it doesn't take too much code to do it yourself. Another thing you might want to consider would be a configurable "cargo runner". This would allow users to start tests in CLI debuggers. CodeLLDB supports this mode as well. |
avoid repetition of `--no-run`
I did struggle with installing {
"lldb.libpython": "/usr/lib/x86_64-linux-gnu/libpython3.6m.so",
} Since I am not into python stuff at all, I didn't try to elaborate on this much. |
Solved by moving the logic to the LSP. |
Any idea how this could be passed on from the vscode extension to the function |
@hdevalke On the server side And then it gets mapped to |
@Veetaha thanks for the tips. I'll have a look. |
autodetect vscode-lldb
@Veetaha auto detection works, but the documentation probably has to be updated to inform users how to debug with rust-analyzer in combination with vscode-lldb. |
Regrading the docs we might add some words about the debug code lens in |
Co-Authored-By: Veetaha <[email protected]>
Maybe it is also worth to mention |
bors r+ |
Build succeeded |
Having CodeLLDB or C++ tools Windows debugger installed in vscode should be enough. |
Refs #3539