From e0cd96db7b4ecf0f1a385531052a70f19f96777b Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 1 Apr 2024 19:47:48 -0400 Subject: [PATCH] Fix up comments and remove some commented-out code (#10059) Release Notes: - N/A --- crates/editor/src/editor.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index e05b20c37f..c197e02fe1 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -1085,7 +1085,7 @@ impl CompletionsMenu { }; if width_of_variable_name < max_width_of_variable_name { - // truncate second part only + // Only truncate the second part. if let Some(documentation_truncation_index) = documentation_layout_line.index_for_x( (max_completion_len * 0.65).min( @@ -1103,7 +1103,7 @@ impl CompletionsMenu { + "…"; } } else { - // truncate first part (and optionally second part too) + // Truncate the first part (and optionally the second part). if let Some(variable_name_truncation_index) = completion_layout_line .index_for_x(max_width_of_variable_name - ellipsis_width.width) { @@ -1167,13 +1167,12 @@ impl CompletionsMenu { }; if width_of_variable_name < max_width_of_variable_name { - // truncate second part only + // Only truncate the second part. if let Some(type_annotation_truncation_index) = completion_layout_line .index_for_x(max_completion_len - ellipsis_width.width) { - // variable_name_end = type_annotation_truncation_index + 2; completion_label_text = completion .label .text @@ -1183,7 +1182,7 @@ impl CompletionsMenu { + "…"; } } else { - // truncate first part (and optionally second part too) + // Truncate the first part (and optionally the second part). if let Some(variable_name_truncation_index) = completion_layout_line .index_for_x(max_width_of_variable_name - ellipsis_width.width) { @@ -1237,7 +1236,7 @@ impl CompletionsMenu { } }; - //recompute syntax highlighting + // Recompute syntax highlighting. completion.label.text = completion_label_text.clone(); if inline_documentation_exists { completion.label.filter_range.end = completion_label_text.len();