debugger: Add support for inline value hints (#28656)
This PR uses Tree Sitter to show inline values while a user is in a debug session. We went with Tree Sitter over the LSP Inline Values request because the LSP request isn't widely supported. Tree Sitter is easy for languages/extensions to add support to. Tree Sitter can compute the inline values locally, so there's no need to add extra RPC messages for Collab. Tree Sitter also gives Zed more control over how we want to show variables. There's still more work to be done after this PR, namely differentiating between global/local scoped variables, but it's a great starting point to start iteratively improving it. Release Notes: - N/A --------- Co-authored-by: Piotr Osiewicz <peterosiewicz@gmail.com> Co-authored-by: Anthony Eid <hello@anthonyeid.me> Co-authored-by: Cole Miller <m@cole-miller.net> Co-authored-by: Anthony <anthony@zed.dev> Co-authored-by: Kirill <kirill@zed.dev>
This commit is contained in:
parent
d095bab8ad
commit
218496744c
30 changed files with 709 additions and 54 deletions
|
@ -90,6 +90,7 @@ impl Render for QuickActionBar {
|
|||
let editor_value = editor.read(cx);
|
||||
let selection_menu_enabled = editor_value.selection_menu_enabled(cx);
|
||||
let inlay_hints_enabled = editor_value.inlay_hints_enabled();
|
||||
let inline_values_enabled = editor_value.inline_values_enabled();
|
||||
let inline_diagnostics_enabled = editor_value.show_inline_diagnostics();
|
||||
let supports_inline_diagnostics = editor_value.inline_diagnostics_enabled();
|
||||
let git_blame_inline_enabled = editor_value.git_blame_inline_enabled();
|
||||
|
@ -224,6 +225,28 @@ impl Render for QuickActionBar {
|
|||
}
|
||||
},
|
||||
);
|
||||
|
||||
menu = menu.toggleable_entry(
|
||||
"Inline Values",
|
||||
inline_values_enabled,
|
||||
IconPosition::Start,
|
||||
Some(editor::actions::ToggleInlineValues.boxed_clone()),
|
||||
{
|
||||
let editor = editor.clone();
|
||||
move |window, cx| {
|
||||
editor
|
||||
.update(cx, |editor, cx| {
|
||||
editor.toggle_inline_values(
|
||||
&editor::actions::ToggleInlineValues,
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
})
|
||||
.ok();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
if supports_inline_diagnostics {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue