mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-09 21:26:14 +03:00
Fix up comments and remove some commented-out code (#10059)
Release Notes: - N/A
This commit is contained in:
parent
f19e84dc22
commit
e0cd96db7b
@ -1085,7 +1085,7 @@ impl CompletionsMenu {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if width_of_variable_name < max_width_of_variable_name {
|
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) =
|
if let Some(documentation_truncation_index) =
|
||||||
documentation_layout_line.index_for_x(
|
documentation_layout_line.index_for_x(
|
||||||
(max_completion_len * 0.65).min(
|
(max_completion_len * 0.65).min(
|
||||||
@ -1103,7 +1103,7 @@ impl CompletionsMenu {
|
|||||||
+ "…";
|
+ "…";
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
if let Some(variable_name_truncation_index) = completion_layout_line
|
||||||
.index_for_x(max_width_of_variable_name - ellipsis_width.width)
|
.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 {
|
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) =
|
if let Some(type_annotation_truncation_index) =
|
||||||
completion_layout_line
|
completion_layout_line
|
||||||
.index_for_x(max_completion_len - ellipsis_width.width)
|
.index_for_x(max_completion_len - ellipsis_width.width)
|
||||||
{
|
{
|
||||||
// variable_name_end = type_annotation_truncation_index + 2;
|
|
||||||
completion_label_text = completion
|
completion_label_text = completion
|
||||||
.label
|
.label
|
||||||
.text
|
.text
|
||||||
@ -1183,7 +1182,7 @@ impl CompletionsMenu {
|
|||||||
+ "…";
|
+ "…";
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
if let Some(variable_name_truncation_index) = completion_layout_line
|
||||||
.index_for_x(max_width_of_variable_name - ellipsis_width.width)
|
.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();
|
completion.label.text = completion_label_text.clone();
|
||||||
if inline_documentation_exists {
|
if inline_documentation_exists {
|
||||||
completion.label.filter_range.end = completion_label_text.len();
|
completion.label.filter_range.end = completion_label_text.len();
|
||||||
|
Loading…
Reference in New Issue
Block a user