diff --git a/.rules b/.rules index 2f2b9cd705d95775bedf092bc4e6254136da6117..82d15eb9e88299ee7c7fe6c717b2da2646e676a7 100644 --- a/.rules +++ b/.rules @@ -59,7 +59,7 @@ Trying to update an entity while it's already being updated must be avoided as t When `read_with`, `update`, or `update_in` are used with an async context, the closure's return value is wrapped in an `anyhow::Result`. -`WeakEntity` is a weak handle. It has `read_with`, `update`, and `update_in` methods that work the same, but always return an `anyhow::Result` so that they can fail if the entity no longer exists. This can be useful to avoid memory leaks - if entities have mutually recursive handles to eachother they will never be dropped. +`WeakEntity` is a weak handle. It has `read_with`, `update`, and `update_in` methods that work the same, but always return an `anyhow::Result` so that they can fail if the entity no longer exists. This can be useful to avoid memory leaks - if entities have mutually recursive handles to each other they will never be dropped. ## Concurrency diff --git a/crates/audio/src/audio.rs b/crates/audio/src/audio.rs index ab8d85cdaa6bab7ed1be3fdab8a66b42f883533b..f60ddb87b9615d2da9c2be248ab397c19a463616 100644 --- a/crates/audio/src/audio.rs +++ b/crates/audio/src/audio.rs @@ -211,7 +211,7 @@ impl Audio { agc_source.set_enabled(LIVE_SETTINGS.control_input_volume.load(Ordering::Relaxed)); }) .replayable(REPLAY_DURATION) - .expect("REPLAY_DURATION is longer then 100ms"); + .expect("REPLAY_DURATION is longer than 100ms"); cx.update_default_global(|this: &mut Self, _cx| { let output_mixer = this diff --git a/crates/audio/src/rodio_ext.rs b/crates/audio/src/rodio_ext.rs index ba4e4ff0554dd3c9bc2a7e2691de270c0d00908b..e80b00e15a8fdbd3fc438b78a9ca45d0902dcef1 100644 --- a/crates/audio/src/rodio_ext.rs +++ b/crates/audio/src/rodio_ext.rs @@ -57,7 +57,7 @@ impl RodioExt for S { /// replay is being read /// /// # Errors - /// If duration is smaller then 100ms + /// If duration is smaller than 100ms fn replayable( self, duration: Duration, @@ -151,7 +151,7 @@ impl Source for TakeSamples { struct ReplayQueue { inner: ArrayQueue>, normal_chunk_len: usize, - /// The last chunk in the queue may be smaller then + /// The last chunk in the queue may be smaller than /// the normal chunk size. This is always equal to the /// size of the last element in the queue. /// (so normally chunk_size) @@ -535,7 +535,7 @@ mod tests { let (mut replay, mut source) = input .replayable(Duration::from_secs(3)) - .expect("longer then 100ms"); + .expect("longer than 100ms"); source.by_ref().take(3).count(); let yielded: Vec = replay.by_ref().take(3).collect(); @@ -552,7 +552,7 @@ mod tests { let (mut replay, mut source) = input .replayable(Duration::from_secs(2)) - .expect("longer then 100ms"); + .expect("longer than 100ms"); source.by_ref().take(5).count(); // get all items but do not end the source let yielded: Vec = replay.by_ref().take(2).collect(); @@ -567,7 +567,7 @@ mod tests { let (replay, mut source) = input .replayable(Duration::from_secs(2)) - .expect("longer then 100ms"); + .expect("longer than 100ms"); // exhaust but do not yet end source source.by_ref().take(40_000).count(); @@ -586,7 +586,7 @@ mod tests { let input = StaticSamplesBuffer::new(nz!(1), nz!(16_000), &[0.0; 40_000]); let (mut replay, source) = input .replayable(Duration::from_secs(2)) - .expect("longer then 100ms"); + .expect("longer than 100ms"); assert_eq!(replay.by_ref().samples_ready(), 0); source.take(8000).count(); // half a second diff --git a/crates/cloud_llm_client/src/cloud_llm_client.rs b/crates/cloud_llm_client/src/cloud_llm_client.rs index 16267d86d806387140016dc0a25021ad92607ff2..12ea6be1f332960f4db7e9a7d67b7b3b926d905f 100644 --- a/crates/cloud_llm_client/src/cloud_llm_client.rs +++ b/crates/cloud_llm_client/src/cloud_llm_client.rs @@ -39,7 +39,7 @@ pub const EDIT_PREDICTIONS_RESOURCE_HEADER_VALUE: &str = "edit_predictions"; /// The name of the header used to indicate that the maximum number of consecutive tool uses has been reached. pub const TOOL_USE_LIMIT_REACHED_HEADER_NAME: &str = "x-zed-tool-use-limit-reached"; -/// The name of the header used to indicate the the minimum required Zed version. +/// The name of the header used to indicate the minimum required Zed version. /// /// This can be used to force a Zed upgrade in order to continue communicating /// with the LLM service. diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rs index 131b03c61b9a36ca73bf91fbc3bdf35b0000e3ee..a8be7e020c01671d6ed1eeb9e3968cba1252f6df 100644 --- a/crates/editor/src/editor_tests.rs +++ b/crates/editor/src/editor_tests.rs @@ -19265,7 +19265,7 @@ async fn test_expand_diff_hunk_at_excerpt_boundary(cx: &mut TestAppContext) { cx.executor().run_until_parked(); // When the start of a hunk coincides with the start of its excerpt, - // the hunk is expanded. When the start of a a hunk is earlier than + // the hunk is expanded. When the start of a hunk is earlier than // the start of its excerpt, the hunk is not expanded. cx.assert_state_with_diff( " diff --git a/crates/gpui/src/platform/windows/platform.rs b/crates/gpui/src/platform/windows/platform.rs index 4d0e6ea56f7d90f303f6634de1239a6a4542429a..b1e2c123e881cecadcdcb6582056c0e5fba64c14 100644 --- a/crates/gpui/src/platform/windows/platform.rs +++ b/crates/gpui/src/platform/windows/platform.rs @@ -1016,7 +1016,7 @@ fn handle_gpu_device_lost( all_windows: &std::sync::Weak>>, text_system: &std::sync::Weak, ) { - // Here we wait a bit to ensure the the system has time to recover from the device lost state. + // Here we wait a bit to ensure the system has time to recover from the device lost state. // If we don't wait, the final drawing result will be blank. std::thread::sleep(std::time::Duration::from_millis(350)); diff --git a/docs/src/development/glossary.md b/docs/src/development/glossary.md index d0ae12fe03a9955667a69eeb6e270981421b6c02..b3ff24464c12d9c00adb1e509c41f123dba3cb8c 100644 --- a/docs/src/development/glossary.md +++ b/docs/src/development/glossary.md @@ -23,7 +23,7 @@ here. An example would be `AnyElement` and `LspStore`. ## GPUI -### State menagement +### State management - `App`: A singleton which holds the full application state including all the entities. Crucially: `App` is not `Send`, which means that `App` only exists on the thread that created it (which is the main/UI thread, usually). Thus, if you see a `&mut App`, know that you're on UI thread. - `Context`: A wrapper around the `App` struct with specialized behavior for a specific `Entity`. Think of it as `(&mut App, Entity)`. The specialized behavior is surfaced in the API surface of `Context`. E.g., `App::spawn` takes an `AsyncFnOnce(AsyncApp) -> Ret`, whereas `Context::spawn` takes an `AsyncFnOnce(WeakEntity, AsyncApp) -> Ret`. @@ -67,7 +67,7 @@ h_flex() - `Component`: A builder which can be rendered turning it into an `Element`. - `Dispatch tree`: TODO - `Focus`: The place where keystrokes are handled first -- `Focus tree`: Path from the place thats the current focus to the UI Root. Example TODO +- `Focus tree`: Path from the place that has the current focus to the UI Root. Example TODO ## Zed UI