Fix up comments and remove some commented-out code (#10059)

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-04-01 19:47:48 -04:00 committed by GitHub
parent f19e84dc22
commit e0cd96db7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();