diff --git a/crates/db/src/db.rs b/crates/db/src/db.rs index 8f20c95a5d3c2811d75d0fa1cbfe1b20d055d7a6..de55212cbadfdd3c66ede66b706a3d120dd765c5 100644 --- a/crates/db/src/db.rs +++ b/crates/db/src/db.rs @@ -74,7 +74,7 @@ pub async fn open_db(db_dir: &Path, scope: &str) -> Threa } async fn open_main_db(db_path: &Path) -> Option { - log::info!("Opening main db"); + log::info!("Opening database {}", db_path.display()); ThreadSafeConnection::builder::(db_path.to_string_lossy().as_ref(), true) .with_db_initialization_query(DB_INITIALIZE_QUERY) .with_connection_initialize_query(CONNECTION_INITIALIZE_QUERY) @@ -84,7 +84,7 @@ async fn open_main_db(db_path: &Path) -> Option() -> ThreadSafeConnection { - log::info!("Opening fallback db"); + log::warn!("Opening fallback in-memory database"); ThreadSafeConnection::builder::(FALLBACK_DB_NAME, false) .with_db_initialization_query(DB_INITIALIZE_QUERY) .with_connection_initialize_query(CONNECTION_INITIALIZE_QUERY) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index dea78cd0111d11c546e3b10d38755f23ee0802aa..5d6abab4f2611b4c055a957ad8fad25f4c45559d 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -2870,7 +2870,8 @@ impl Editor { buffer.char_kind_before(start_offset, true) == Some(CharKind::Word) } else { // Snippet choices can be shown even when the cursor is in whitespace. - // Dismissing the menu when actions like backspace + // Dismissing the menu with actions like backspace is handled by + // invalidation regions. true } } else { @@ -2936,22 +2937,22 @@ impl Editor { let background_executor = cx.background_executor().clone(); let editor_id = cx.entity().entity_id().as_u64() as ItemId; self.serialize_selections = cx.background_spawn(async move { - background_executor.timer(SERIALIZATION_THROTTLE_TIME).await; - let db_selections = selections - .iter() - .map(|selection| { - ( - selection.start.to_offset(&snapshot), - selection.end.to_offset(&snapshot), - ) - }) - .collect(); + background_executor.timer(SERIALIZATION_THROTTLE_TIME).await; + let db_selections = selections + .iter() + .map(|selection| { + ( + selection.start.to_offset(&snapshot), + selection.end.to_offset(&snapshot), + ) + }) + .collect(); - DB.save_editor_selections(editor_id, workspace_id, db_selections) - .await - .with_context(|| format!("persisting editor selections for editor {editor_id}, workspace {workspace_id:?}")) - .log_err(); - }); + DB.save_editor_selections(editor_id, workspace_id, db_selections) + .await + .with_context(|| format!("persisting editor selections for editor {editor_id}, workspace {workspace_id:?}")) + .log_err(); + }); } } } diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 44f3728c9b6bd669fd5dc1ad618a7b5f1536c376..9486a81e32818a3d205c7819c5c02688ac4f1b7b 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -7630,7 +7630,7 @@ impl Element for EditorElement { fn request_layout( &mut self, _: Option<&GlobalElementId>, - __inspector_id: Option<&gpui::InspectorElementId>, + _inspector_id: Option<&gpui::InspectorElementId>, window: &mut Window, cx: &mut App, ) -> (gpui::LayoutId, ()) { @@ -8817,7 +8817,7 @@ impl Element for EditorElement { fn paint( &mut self, _: Option<&GlobalElementId>, - __inspector_id: Option<&gpui::InspectorElementId>, + _inspector_id: Option<&gpui::InspectorElementId>, bounds: Bounds, _: &mut Self::RequestLayoutState, layout: &mut Self::PrepaintState, diff --git a/crates/editor/src/selections_collection.rs b/crates/editor/src/selections_collection.rs index da5fbe41ef8f8415e141d8617482fbfd2aad92c3..6b5203caf2383f1528d70f078d761cef97758f9e 100644 --- a/crates/editor/src/selections_collection.rs +++ b/crates/editor/src/selections_collection.rs @@ -659,6 +659,7 @@ impl<'a> MutableSelectionsCollection<'a> { .collect(); self.select(selections); } + pub fn reverse_selections(&mut self) { let map = &self.display_map(); let mut new_selections: Vec> = Vec::new(); diff --git a/crates/extension_host/src/wasm_host.rs b/crates/extension_host/src/wasm_host.rs index 5d2c2f9b95fd671f86af29651d21607efe57351f..d788cdc5b6e7c90da4f95a41f0932541a4e5800b 100644 --- a/crates/extension_host/src/wasm_host.rs +++ b/crates/extension_host/src/wasm_host.rs @@ -377,6 +377,7 @@ impl extension::Extension for WasmExtension { }) .await } + async fn get_dap_binary( &self, dap_name: Arc, diff --git a/crates/gpui/src/gpui.rs b/crates/gpui/src/gpui.rs index 496406c5a0e42cfc261eb5b26340f22bda102607..91461a4d2c8f1bbf1504a36429064a038bedec21 100644 --- a/crates/gpui/src/gpui.rs +++ b/crates/gpui/src/gpui.rs @@ -255,7 +255,7 @@ pub trait VisualContext: AppContext { update: impl FnOnce(&mut T, &mut Window, &mut Context) -> R, ) -> Self::Result; - /// Update a view with the given callback + /// Create a new entity, with access to `Window`. fn new_window_entity( &mut self, build_entity: impl FnOnce(&mut Window, &mut Context) -> T, diff --git a/crates/util/src/util.rs b/crates/util/src/util.rs index 791bc58840fabc4f4dfb3e538331e80ff366605f..79137208eacfc7a697d282f04f70447486c1058e 100644 --- a/crates/util/src/util.rs +++ b/crates/util/src/util.rs @@ -863,6 +863,7 @@ mod rng { } #[cfg(any(test, feature = "test-support"))] pub use rng::RandomCharIter; + /// Get an embedded file as a string. pub fn asset_str(path: &str) -> Cow<'static, str> { match A::get(path).expect(path).data { diff --git a/crates/zeta/src/zeta.rs b/crates/zeta/src/zeta.rs index 7b2c49c51282274373ace8b8c0066cfc7b78abf9..23ce320ee9a77f42856cba5ca32723cb7ea18eaa 100644 --- a/crates/zeta/src/zeta.rs +++ b/crates/zeta/src/zeta.rs @@ -335,6 +335,7 @@ impl Zeta { self.events.push_back(event); if self.events.len() >= MAX_EVENT_COUNT { + // These are halved instead of popping to improve prompt caching. self.events.drain(..MAX_EVENT_COUNT / 2); } }