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.

Add small alloc and lookup optimizations (#49041)

dybucc815c6f5141bd
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index efc3cddcc85..28d96e72125 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -15365,7 +15365,7 @@ impl Editor {
pub fn select_all(&mut self, _: &SelectAll, window: &mut Window, cx: &mut Context<Self>) {
self.hide_mouse_cursor(HideMouseCursorOrigin::MovementAction, cx);
self.change_selections(SelectionEffects::no_scroll(), window, cx, |s| {
- s.select_ranges(vec![Anchor::min()..Anchor::max()]);
+ s.select_ranges([Anchor::min()..Anchor::max()]);
});
}
diff --git a/crates/project/src/lsp_command.rs b/crates/project/src/lsp_command.rs
index bd94378433d..67edd6c13ca 100644
--- a/crates/project/src/lsp_command.rs
+++ b/crates/project/src/lsp_command.rs
@@ -533,7 +533,7 @@ impl LspCommand for PerformRename {
.rename_provider
.is_some_and(|capability| match capability {
OneOf::Left(enabled) => enabled,
- OneOf::Right(_options) => true,
+ OneOf::Right(_) => true,
})
}
diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs
index 45111adf9eb..75f9702e12c 100644
--- a/crates/project/src/lsp_store.rs
+++ b/crates/project/src/lsp_store.rs
@@ -3158,7 +3158,7 @@ impl LocalLspStore {
.map(|edit| (range_from_lsp(edit.range), edit.new_text))
.collect::<Vec<_>>();
- lsp_edits.sort_by_key(|(range, _)| (range.start, range.end));
+ lsp_edits.sort_unstable_by_key(|(range, _)| (range.start, range.end));
let mut lsp_edits = lsp_edits.into_iter().peekable();
let mut edits = Vec::new();
@@ -5001,10 +5001,6 @@ impl LspStore {
};
let status = request.status();
- if !request.check_capabilities(language_server.adapter_server_capabilities()) {
- return Task::ready(Ok(Default::default()));
- }
-
let request_timeout = ProjectSettings::get_global(cx)
.global_lsp_settings
.get_request_timeout();