Rename remaining mentions of "inline completion" to "edit prediction" (#35512)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-08-04 10:22:18 -06:00 committed by GitHub
parent 85885723a9
commit 65018c28c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 480 additions and 498 deletions

View file

@ -3,11 +3,11 @@ use crate::{
CodeActionSource, ColumnarMode, ConflictsOurs, ConflictsOursMarker, ConflictsOuter,
ConflictsTheirs, ConflictsTheirsMarker, ContextMenuPlacement, CursorShape, CustomBlockId,
DisplayDiffHunk, DisplayPoint, DisplayRow, DocumentHighlightRead, DocumentHighlightWrite,
EditDisplayMode, Editor, EditorMode, EditorSettings, EditorSnapshot, EditorStyle,
FILE_HEADER_HEIGHT, FocusedBlock, GutterDimensions, HalfPageDown, HalfPageUp, HandleInput,
HoveredCursor, InlayHintRefreshReason, InlineCompletion, JumpData, LineDown, LineHighlight,
LineUp, MAX_LINE_LEN, MINIMAP_FONT_SIZE, MULTI_BUFFER_EXCERPT_HEADER_HEIGHT, OpenExcerpts,
PageDown, PageUp, PhantomBreakpointIndicator, Point, RowExt, RowRangeExt, SelectPhase,
EditDisplayMode, EditPrediction, Editor, EditorMode, EditorSettings, EditorSnapshot,
EditorStyle, FILE_HEADER_HEIGHT, FocusedBlock, GutterDimensions, HalfPageDown, HalfPageUp,
HandleInput, HoveredCursor, InlayHintRefreshReason, JumpData, LineDown, LineHighlight, LineUp,
MAX_LINE_LEN, MINIMAP_FONT_SIZE, MULTI_BUFFER_EXCERPT_HEADER_HEIGHT, OpenExcerpts, PageDown,
PageUp, PhantomBreakpointIndicator, Point, RowExt, RowRangeExt, SelectPhase,
SelectedTextHighlight, Selection, SelectionDragState, SoftWrap, StickyHeaderExcerpt, ToPoint,
ToggleFold, ToggleFoldAll,
code_context_menus::{CodeActionsMenu, MENU_ASIDE_MAX_WIDTH, MENU_ASIDE_MIN_WIDTH, MENU_GAP},
@ -554,7 +554,7 @@ impl EditorElement {
register_action(editor, window, Editor::signature_help_next);
register_action(editor, window, Editor::next_edit_prediction);
register_action(editor, window, Editor::previous_edit_prediction);
register_action(editor, window, Editor::show_inline_completion);
register_action(editor, window, Editor::show_edit_prediction);
register_action(editor, window, Editor::context_menu_first);
register_action(editor, window, Editor::context_menu_prev);
register_action(editor, window, Editor::context_menu_next);
@ -562,7 +562,7 @@ impl EditorElement {
register_action(editor, window, Editor::display_cursor_names);
register_action(editor, window, Editor::unique_lines_case_insensitive);
register_action(editor, window, Editor::unique_lines_case_sensitive);
register_action(editor, window, Editor::accept_partial_inline_completion);
register_action(editor, window, Editor::accept_partial_edit_prediction);
register_action(editor, window, Editor::accept_edit_prediction);
register_action(editor, window, Editor::restore_file);
register_action(editor, window, Editor::git_restore);
@ -2093,7 +2093,7 @@ impl EditorElement {
row_block_types: &HashMap<DisplayRow, bool>,
content_origin: gpui::Point<Pixels>,
scroll_pixel_position: gpui::Point<Pixels>,
inline_completion_popover_origin: Option<gpui::Point<Pixels>>,
edit_prediction_popover_origin: Option<gpui::Point<Pixels>>,
start_row: DisplayRow,
end_row: DisplayRow,
line_height: Pixels,
@ -2210,12 +2210,13 @@ impl EditorElement {
cmp::max(padded_line, min_start)
};
let behind_inline_completion_popover = inline_completion_popover_origin
.as_ref()
.map_or(false, |inline_completion_popover_origin| {
(pos_y..pos_y + line_height).contains(&inline_completion_popover_origin.y)
});
let opacity = if behind_inline_completion_popover {
let behind_edit_prediction_popover = edit_prediction_popover_origin.as_ref().map_or(
false,
|edit_prediction_popover_origin| {
(pos_y..pos_y + line_height).contains(&edit_prediction_popover_origin.y)
},
);
let opacity = if behind_edit_prediction_popover {
0.5
} else {
1.0
@ -2427,9 +2428,9 @@ impl EditorElement {
let mut padding = INLINE_BLAME_PADDING_EM_WIDTHS;
if let Some(inline_completion) = editor.active_inline_completion.as_ref() {
match &inline_completion.completion {
InlineCompletion::Edit {
if let Some(edit_prediction) = editor.active_edit_prediction.as_ref() {
match &edit_prediction.completion {
EditPrediction::Edit {
display_mode: EditDisplayMode::TabAccept,
..
} => padding += INLINE_ACCEPT_SUGGESTION_EM_WIDTHS,
@ -4086,8 +4087,7 @@ impl EditorElement {
{
let editor = self.editor.read(cx);
if editor
.edit_prediction_visible_in_cursor_popover(editor.has_active_inline_completion())
if editor.edit_prediction_visible_in_cursor_popover(editor.has_active_edit_prediction())
{
height_above_menu +=
editor.edit_prediction_cursor_popover_height() + POPOVER_Y_PADDING;
@ -6676,14 +6676,14 @@ impl EditorElement {
}
}
fn paint_inline_completion_popover(
fn paint_edit_prediction_popover(
&mut self,
layout: &mut EditorLayout,
window: &mut Window,
cx: &mut App,
) {
if let Some(inline_completion_popover) = layout.inline_completion_popover.as_mut() {
inline_completion_popover.paint(window, cx);
if let Some(edit_prediction_popover) = layout.edit_prediction_popover.as_mut() {
edit_prediction_popover.paint(window, cx);
}
}
@ -8501,7 +8501,7 @@ impl Element for EditorElement {
)
});
let (inline_completion_popover, inline_completion_popover_origin) = self
let (edit_prediction_popover, edit_prediction_popover_origin) = self
.editor
.update(cx, |editor, cx| {
editor.render_edit_prediction_popover(
@ -8530,7 +8530,7 @@ impl Element for EditorElement {
&row_block_types,
content_origin,
scroll_pixel_position,
inline_completion_popover_origin,
edit_prediction_popover_origin,
start_row,
end_row,
line_height,
@ -8919,7 +8919,7 @@ impl Element for EditorElement {
cursors,
visible_cursors,
selections,
inline_completion_popover,
edit_prediction_popover,
diff_hunk_controls,
mouse_context_menu,
test_indicators,
@ -9001,7 +9001,7 @@ impl Element for EditorElement {
self.paint_minimap(layout, window, cx);
self.paint_scrollbars(layout, window, cx);
self.paint_inline_completion_popover(layout, window, cx);
self.paint_edit_prediction_popover(layout, window, cx);
self.paint_mouse_context_menu(layout, window, cx);
});
})
@ -9102,7 +9102,7 @@ pub struct EditorLayout {
expand_toggles: Vec<Option<(AnyElement, gpui::Point<Pixels>)>>,
diff_hunk_controls: Vec<AnyElement>,
crease_trailers: Vec<Option<CreaseTrailerLayout>>,
inline_completion_popover: Option<AnyElement>,
edit_prediction_popover: Option<AnyElement>,
mouse_context_menu: Option<AnyElement>,
tab_invisible: ShapedLine,
space_invisible: ShapedLine,