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