Delete code actions indicator (#30140)

This conflicts for space with breakpoints, and seems borderline in terms
of utility.

We could consider bringing it back in a way that is closer to the
cursor, or be content with our right-click menu discovery.

Release Notes:

- Remove the code actions indicator from the gutter. It is still
available from the right click menu, or with the keyboard shortcut.
This commit is contained in:
Conrad Irwin 2025-05-07 17:33:42 +01:00 committed by GitHub
parent 625e45bac0
commit 1b3140d4ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1 additions and 176 deletions

View file

@ -2409,52 +2409,6 @@ impl EditorElement {
elements
}
fn layout_code_actions_indicator(
&self,
line_height: Pixels,
newest_selection_head: DisplayPoint,
scroll_pixel_position: gpui::Point<Pixels>,
gutter_dimensions: &GutterDimensions,
gutter_hitbox: &Hitbox,
breakpoint_points: &mut HashMap<DisplayRow, (Anchor, Breakpoint)>,
display_hunks: &[(DisplayDiffHunk, Option<Hitbox>)],
window: &mut Window,
cx: &mut App,
) -> Option<AnyElement> {
let mut active = false;
let mut button = None;
let row = newest_selection_head.row();
self.editor.update(cx, |editor, cx| {
if let Some(crate::CodeContextMenu::CodeActions(CodeActionsMenu {
deployed_from_indicator,
..
})) = editor.context_menu.borrow().as_ref()
{
active = deployed_from_indicator.map_or(true, |indicator_row| indicator_row == row);
};
let breakpoint = breakpoint_points.get(&row);
button = editor.render_code_actions_indicator(&self.style, row, active, breakpoint, cx);
});
let button = button?;
breakpoint_points.remove(&row);
let button = prepaint_gutter_button(
button,
row,
line_height,
gutter_dimensions,
scroll_pixel_position,
gutter_hitbox,
display_hunks,
window,
cx,
);
Some(button)
}
fn calculate_relative_line_numbers(
&self,
snapshot: &EditorSnapshot,
@ -4857,10 +4811,6 @@ impl EditorElement {
for test_indicator in layout.test_indicators.iter_mut() {
test_indicator.paint(window, cx);
}
if let Some(indicator) = layout.code_actions_indicator.as_mut() {
indicator.paint(window, cx);
}
});
}
@ -7545,7 +7495,6 @@ impl Element for EditorElement {
let gutter_settings = EditorSettings::get_global(cx).gutter;
let mut code_actions_indicator = None;
if let Some(newest_selection_head) = newest_selection_head {
let newest_selection_point =
newest_selection_head.to_point(&snapshot.display_snapshot);
@ -7564,52 +7513,6 @@ impl Element for EditorElement {
window,
cx,
);
let show_code_actions = snapshot
.show_code_actions
.unwrap_or(gutter_settings.code_actions);
if show_code_actions {
let newest_selection_point =
newest_selection_head.to_point(&snapshot.display_snapshot);
if !snapshot
.is_line_folded(MultiBufferRow(newest_selection_point.row))
{
let buffer = snapshot.buffer_snapshot.buffer_line_for_row(
MultiBufferRow(newest_selection_point.row),
);
if let Some((buffer, range)) = buffer {
let buffer_id = buffer.remote_id();
let row = range.start.row;
let has_test_indicator = self
.editor
.read(cx)
.tasks
.contains_key(&(buffer_id, row));
let has_expand_indicator = row_infos
.get(
(newest_selection_head.row() - start_row).0
as usize,
)
.is_some_and(|row_info| row_info.expand_info.is_some());
if !has_test_indicator && !has_expand_indicator {
code_actions_indicator = self
.layout_code_actions_indicator(
line_height,
newest_selection_head,
scroll_pixel_position,
&gutter_dimensions,
&gutter_hitbox,
&mut breakpoint_rows,
&display_hunks,
window,
cx,
);
}
}
}
}
}
}
@ -7818,7 +7721,6 @@ impl Element for EditorElement {
mouse_context_menu,
test_indicators,
breakpoints,
code_actions_indicator,
crease_toggles,
crease_trailers,
tab_invisible,
@ -7989,7 +7891,6 @@ pub struct EditorLayout {
cursors: Vec<(DisplayPoint, Hsla)>,
visible_cursors: Vec<CursorLayout>,
selections: Vec<(PlayerColor, Vec<SelectionLayout>)>,
code_actions_indicator: Option<AnyElement>,
test_indicators: Vec<AnyElement>,
breakpoints: Vec<AnyElement>,
crease_toggles: Vec<Option<AnyElement>>,