Misc nitpicks, changes too small / unrelated to be in other PRs (#32768)
Release Notes: - N/A
This commit is contained in:
parent
02da4669f3
commit
3810227759
8 changed files with 26 additions and 21 deletions
|
@ -74,7 +74,7 @@ pub async fn open_db<M: Migrator + 'static>(db_dir: &Path, scope: &str) -> Threa
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn open_main_db<M: Migrator>(db_path: &Path) -> Option<ThreadSafeConnection> {
|
async fn open_main_db<M: Migrator>(db_path: &Path) -> Option<ThreadSafeConnection> {
|
||||||
log::info!("Opening main db");
|
log::info!("Opening database {}", db_path.display());
|
||||||
ThreadSafeConnection::builder::<M>(db_path.to_string_lossy().as_ref(), true)
|
ThreadSafeConnection::builder::<M>(db_path.to_string_lossy().as_ref(), true)
|
||||||
.with_db_initialization_query(DB_INITIALIZE_QUERY)
|
.with_db_initialization_query(DB_INITIALIZE_QUERY)
|
||||||
.with_connection_initialize_query(CONNECTION_INITIALIZE_QUERY)
|
.with_connection_initialize_query(CONNECTION_INITIALIZE_QUERY)
|
||||||
|
@ -84,7 +84,7 @@ async fn open_main_db<M: Migrator>(db_path: &Path) -> Option<ThreadSafeConnectio
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn open_fallback_db<M: Migrator>() -> ThreadSafeConnection {
|
async fn open_fallback_db<M: Migrator>() -> ThreadSafeConnection {
|
||||||
log::info!("Opening fallback db");
|
log::warn!("Opening fallback in-memory database");
|
||||||
ThreadSafeConnection::builder::<M>(FALLBACK_DB_NAME, false)
|
ThreadSafeConnection::builder::<M>(FALLBACK_DB_NAME, false)
|
||||||
.with_db_initialization_query(DB_INITIALIZE_QUERY)
|
.with_db_initialization_query(DB_INITIALIZE_QUERY)
|
||||||
.with_connection_initialize_query(CONNECTION_INITIALIZE_QUERY)
|
.with_connection_initialize_query(CONNECTION_INITIALIZE_QUERY)
|
||||||
|
|
|
@ -2870,7 +2870,8 @@ impl Editor {
|
||||||
buffer.char_kind_before(start_offset, true) == Some(CharKind::Word)
|
buffer.char_kind_before(start_offset, true) == Some(CharKind::Word)
|
||||||
} else {
|
} else {
|
||||||
// Snippet choices can be shown even when the cursor is in whitespace.
|
// 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
|
true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -7630,7 +7630,7 @@ impl Element for EditorElement {
|
||||||
fn request_layout(
|
fn request_layout(
|
||||||
&mut self,
|
&mut self,
|
||||||
_: Option<&GlobalElementId>,
|
_: Option<&GlobalElementId>,
|
||||||
__inspector_id: Option<&gpui::InspectorElementId>,
|
_inspector_id: Option<&gpui::InspectorElementId>,
|
||||||
window: &mut Window,
|
window: &mut Window,
|
||||||
cx: &mut App,
|
cx: &mut App,
|
||||||
) -> (gpui::LayoutId, ()) {
|
) -> (gpui::LayoutId, ()) {
|
||||||
|
@ -8817,7 +8817,7 @@ impl Element for EditorElement {
|
||||||
fn paint(
|
fn paint(
|
||||||
&mut self,
|
&mut self,
|
||||||
_: Option<&GlobalElementId>,
|
_: Option<&GlobalElementId>,
|
||||||
__inspector_id: Option<&gpui::InspectorElementId>,
|
_inspector_id: Option<&gpui::InspectorElementId>,
|
||||||
bounds: Bounds<gpui::Pixels>,
|
bounds: Bounds<gpui::Pixels>,
|
||||||
_: &mut Self::RequestLayoutState,
|
_: &mut Self::RequestLayoutState,
|
||||||
layout: &mut Self::PrepaintState,
|
layout: &mut Self::PrepaintState,
|
||||||
|
|
|
@ -659,6 +659,7 @@ impl<'a> MutableSelectionsCollection<'a> {
|
||||||
.collect();
|
.collect();
|
||||||
self.select(selections);
|
self.select(selections);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn reverse_selections(&mut self) {
|
pub fn reverse_selections(&mut self) {
|
||||||
let map = &self.display_map();
|
let map = &self.display_map();
|
||||||
let mut new_selections: Vec<Selection<Point>> = Vec::new();
|
let mut new_selections: Vec<Selection<Point>> = Vec::new();
|
||||||
|
|
|
@ -377,6 +377,7 @@ impl extension::Extension for WasmExtension {
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn get_dap_binary(
|
async fn get_dap_binary(
|
||||||
&self,
|
&self,
|
||||||
dap_name: Arc<str>,
|
dap_name: Arc<str>,
|
||||||
|
|
|
@ -255,7 +255,7 @@ pub trait VisualContext: AppContext {
|
||||||
update: impl FnOnce(&mut T, &mut Window, &mut Context<T>) -> R,
|
update: impl FnOnce(&mut T, &mut Window, &mut Context<T>) -> R,
|
||||||
) -> Self::Result<R>;
|
) -> Self::Result<R>;
|
||||||
|
|
||||||
/// Update a view with the given callback
|
/// Create a new entity, with access to `Window`.
|
||||||
fn new_window_entity<T: 'static>(
|
fn new_window_entity<T: 'static>(
|
||||||
&mut self,
|
&mut self,
|
||||||
build_entity: impl FnOnce(&mut Window, &mut Context<T>) -> T,
|
build_entity: impl FnOnce(&mut Window, &mut Context<T>) -> T,
|
||||||
|
|
|
@ -863,6 +863,7 @@ mod rng {
|
||||||
}
|
}
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
pub use rng::RandomCharIter;
|
pub use rng::RandomCharIter;
|
||||||
|
|
||||||
/// Get an embedded file as a string.
|
/// Get an embedded file as a string.
|
||||||
pub fn asset_str<A: rust_embed::RustEmbed>(path: &str) -> Cow<'static, str> {
|
pub fn asset_str<A: rust_embed::RustEmbed>(path: &str) -> Cow<'static, str> {
|
||||||
match A::get(path).expect(path).data {
|
match A::get(path).expect(path).data {
|
||||||
|
|
|
@ -335,6 +335,7 @@ impl Zeta {
|
||||||
|
|
||||||
self.events.push_back(event);
|
self.events.push_back(event);
|
||||||
if self.events.len() >= MAX_EVENT_COUNT {
|
if self.events.len() >= MAX_EVENT_COUNT {
|
||||||
|
// These are halved instead of popping to improve prompt caching.
|
||||||
self.events.drain(..MAX_EVENT_COUNT / 2);
|
self.events.drain(..MAX_EVENT_COUNT / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue