mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
debugger: Fix evaluate selection running two evaluations & failing for Python and go (#44205)
Evaluate selection now acts as if the text was typed verbatim into the console. Closes ##33526 Release Notes: - debugger: Fixed "evaluate selection" not behaving as if the highlighted text was not typed verbatim into the console.
This commit is contained in:
parent
d6241b17d3
commit
35da6d000a
3 changed files with 14 additions and 3 deletions
|
|
@ -387,7 +387,7 @@ pub fn init(cx: &mut App) {
|
|||
window.on_action(
|
||||
TypeId::of::<editor::actions::EvaluateSelectedText>(),
|
||||
move |_, _, window, cx| {
|
||||
maybe!({
|
||||
let status = maybe!({
|
||||
let text = editor
|
||||
.update(cx, |editor, cx| {
|
||||
let range = editor
|
||||
|
|
@ -411,7 +411,13 @@ pub fn init(cx: &mut App) {
|
|||
|
||||
state.session().update(cx, |session, cx| {
|
||||
session
|
||||
.evaluate(text, None, stack_id, None, cx)
|
||||
.evaluate(
|
||||
text,
|
||||
Some(dap::EvaluateArgumentsContext::Repl),
|
||||
stack_id,
|
||||
None,
|
||||
cx,
|
||||
)
|
||||
.detach();
|
||||
});
|
||||
});
|
||||
|
|
@ -419,6 +425,9 @@ pub fn init(cx: &mut App) {
|
|||
|
||||
Some(())
|
||||
});
|
||||
if status.is_some() {
|
||||
cx.stop_propagation();
|
||||
}
|
||||
},
|
||||
);
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1023,7 +1023,7 @@ impl DebugDelegate {
|
|||
Some(TaskSourceKind::Lsp { language_name, .. }) => {
|
||||
Some(format!("LSP: {language_name}"))
|
||||
}
|
||||
Some(TaskSourceKind::Language { name }) => Some(format!("Lang: {name}")),
|
||||
Some(TaskSourceKind::Language { name }) => Some(format!("Language: {name}")),
|
||||
_ => context.clone().and_then(|ctx| {
|
||||
ctx.task_context
|
||||
.task_variables
|
||||
|
|
|
|||
|
|
@ -2656,6 +2656,8 @@ impl Session {
|
|||
this.update(cx, |this, cx| {
|
||||
this.memory.clear(cx.background_executor());
|
||||
this.invalidate_command_type::<ReadMemory>();
|
||||
this.invalidate_command_type::<VariablesCommand>();
|
||||
cx.emit(SessionEvent::Variables);
|
||||
match response {
|
||||
Ok(response) => {
|
||||
let event = dap::OutputEvent {
|
||||
|
|
|
|||
Loading…
Reference in a new issue