Debugger UI: Dynamic session contents (#28033)
Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ... --------- Co-authored-by: Anthony Eid <hello@anthonyeid.me> Co-authored-by: Anthony <anthony@zed.dev>
This commit is contained in:
co-authored by
Anthony Eid
Anthony
parent
fdaf2a27bf
commit
22b937f27f
@@ -687,6 +687,7 @@ impl VariableList {
|
||||
.child(
|
||||
ListItem::new(SharedString::from(format!("scope-{}", var_ref)))
|
||||
.selectable(false)
|
||||
.disabled(self.disabled)
|
||||
.indent_level(state.depth + 1)
|
||||
.indent_step_size(px(20.))
|
||||
.always_show_disclosure_icon(true)
|
||||
@@ -695,7 +696,15 @@ impl VariableList {
|
||||
let var_path = entry.path.clone();
|
||||
cx.listener(move |this, _, _, cx| this.toggle_entry(&var_path, cx))
|
||||
})
|
||||
.child(div().text_ui(cx).w_full().child(scope.name.clone())),
|
||||
.child(
|
||||
div()
|
||||
.text_ui(cx)
|
||||
.w_full()
|
||||
.when(self.disabled, |this| {
|
||||
this.text_color(Color::Disabled.color(cx))
|
||||
})
|
||||
.child(scope.name.clone()),
|
||||
),
|
||||
)
|
||||
.into_any()
|
||||
}
|
||||
@@ -716,20 +725,27 @@ impl VariableList {
|
||||
};
|
||||
|
||||
let syntax_color_for = |name| cx.theme().syntax().get(name).color;
|
||||
let variable_name_color = match &dap
|
||||
.presentation_hint
|
||||
.as_ref()
|
||||
.and_then(|hint| hint.kind.as_ref())
|
||||
.unwrap_or(&VariablePresentationHintKind::Unknown)
|
||||
{
|
||||
VariablePresentationHintKind::Class
|
||||
| VariablePresentationHintKind::BaseClass
|
||||
| VariablePresentationHintKind::InnerClass
|
||||
| VariablePresentationHintKind::MostDerivedClass => syntax_color_for("type"),
|
||||
VariablePresentationHintKind::Data => syntax_color_for("variable"),
|
||||
VariablePresentationHintKind::Unknown | _ => syntax_color_for("variable"),
|
||||
let variable_name_color = if self.disabled {
|
||||
Some(Color::Disabled.color(cx))
|
||||
} else {
|
||||
match &dap
|
||||
.presentation_hint
|
||||
.as_ref()
|
||||
.and_then(|hint| hint.kind.as_ref())
|
||||
.unwrap_or(&VariablePresentationHintKind::Unknown)
|
||||
{
|
||||
VariablePresentationHintKind::Class
|
||||
| VariablePresentationHintKind::BaseClass
|
||||
| VariablePresentationHintKind::InnerClass
|
||||
| VariablePresentationHintKind::MostDerivedClass => syntax_color_for("type"),
|
||||
VariablePresentationHintKind::Data => syntax_color_for("variable"),
|
||||
VariablePresentationHintKind::Unknown | _ => syntax_color_for("variable"),
|
||||
}
|
||||
};
|
||||
let variable_color = syntax_color_for("variable.special");
|
||||
let variable_color = self
|
||||
.disabled
|
||||
.then(|| Color::Disabled.color(cx))
|
||||
.or_else(|| syntax_color_for("variable.special"));
|
||||
|
||||
let var_ref = dap.variables_reference;
|
||||
let colors = get_entry_color(cx);
|
||||
|
||||
Reference in New Issue
Block a user