lints: A bunch of extra style lint fixes (#36568)

- **lints: Fix 'doc_lazy_continuation'**
- **lints: Fix 'doc_overindented_list_items'**
- **inherent_to_string and io_other_error**
- **Some more lint fixes**
- **lints: enable bool_assert_comparison, match_like_matches_macro and
wrong_self_convention**


Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-20 12:05:58 +02:00 committed by GitHub
parent a32a264508
commit cf7c64d77f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
92 changed files with 277 additions and 345 deletions

View file

@ -816,10 +816,7 @@ impl Motion {
}
fn skip_exclusive_special_case(&self) -> bool {
match self {
Motion::WrappingLeft | Motion::WrappingRight => true,
_ => false,
}
matches!(self, Motion::WrappingLeft | Motion::WrappingRight)
}
pub(crate) fn push_to_jump_list(&self) -> bool {
@ -4099,7 +4096,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
ˇhe quick brown fox
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
the quick bˇrown fox
@ -4109,7 +4106,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
ˇown fox
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
the quick brown foˇx
@ -4119,7 +4116,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
ˇ
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
}
#[gpui::test]
@ -4134,7 +4131,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
ˇbrown fox
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
the quick bˇrown fox
@ -4144,7 +4141,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
the quickˇown fox
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
the quick brown foˇx
@ -4154,7 +4151,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
the quicˇk
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
ˇthe quick brown fox
@ -4164,7 +4161,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
ˇ fox
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
ˇthe quick brown fox
@ -4174,7 +4171,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
ˇuick brown fox
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
}
#[gpui::test]
@ -4189,7 +4186,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
the quick brown foˇx
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
ˇthe quick brown fox
@ -4199,7 +4196,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
ˇx
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
}
#[gpui::test]
@ -4215,7 +4212,7 @@ mod test {
the quick brown fox
ˇthe quick brown fox
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
the quick bˇrown fox
@ -4226,7 +4223,7 @@ mod test {
the quick brˇrown fox
jumped overown fox
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
the quick brown foˇx
@ -4237,7 +4234,7 @@ mod test {
the quick brown foxˇx
jumped over the la
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
the quick brown fox
@ -4248,7 +4245,7 @@ mod test {
thˇhe quick brown fox
je quick brown fox
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
}
#[gpui::test]
@ -4263,7 +4260,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
ˇe quick brown fox
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
the quick bˇrown fox
@ -4273,7 +4270,7 @@ mod test {
cx.shared_state().await.assert_eq(indoc! {"
the quick bˇn fox
jumped over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
cx.set_shared_state(indoc! {"
the quick brown foˇx
@ -4282,6 +4279,6 @@ mod test {
cx.simulate_shared_keystrokes("d v e").await;
cx.shared_state().await.assert_eq(indoc! {"
the quick brown foˇd over the lazy dog"});
assert_eq!(cx.cx.forced_motion(), false);
assert!(!cx.cx.forced_motion());
}
}

View file

@ -1734,10 +1734,7 @@ impl Vim {
editor.set_autoindent(vim.should_autoindent());
editor.selections.line_mode = matches!(vim.mode, Mode::VisualLine);
let hide_edit_predictions = match vim.mode {
Mode::Insert | Mode::Replace => false,
_ => true,
};
let hide_edit_predictions = !matches!(vim.mode, Mode::Insert | Mode::Replace);
editor.set_edit_predictions_hidden_for_vim_mode(hide_edit_predictions, window, cx);
});
cx.notify()