Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

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

Marshall Bowerse0cd96db7b4e
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index e05b20c37f2..c197e02fe13 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();