Enforce style lints which do not have violations (#36580)

Release Notes:

- N/A
This commit is contained in:
tidely 2025-08-20 15:07:37 +03:00 committed by GitHub
parent 4ee565cd39
commit 6ed29fbc34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 146 additions and 89 deletions

View file

@ -1854,8 +1854,8 @@ impl Editor {
blink_manager
});
let soft_wrap_mode_override = matches!(mode, EditorMode::SingleLine { .. })
.then(|| language_settings::SoftWrap::None);
let soft_wrap_mode_override =
matches!(mode, EditorMode::SingleLine).then(|| language_settings::SoftWrap::None);
let mut project_subscriptions = Vec::new();
if full_mode && let Some(project) = project.as_ref() {
@ -1980,14 +1980,12 @@ impl Editor {
.detach();
}
let show_indent_guides = if matches!(
mode,
EditorMode::SingleLine { .. } | EditorMode::Minimap { .. }
) {
Some(false)
} else {
None
};
let show_indent_guides =
if matches!(mode, EditorMode::SingleLine | EditorMode::Minimap { .. }) {
Some(false)
} else {
None
};
let breakpoint_store = match (&mode, project.as_ref()) {
(EditorMode::Full { .. }, Some(project)) => Some(project.read(cx).breakpoint_store()),
@ -2047,7 +2045,7 @@ impl Editor {
vertical: full_mode,
},
minimap_visibility: MinimapVisibility::for_mode(&mode, cx),
offset_content: !matches!(mode, EditorMode::SingleLine { .. }),
offset_content: !matches!(mode, EditorMode::SingleLine),
show_breadcrumbs: EditorSettings::get_global(cx).toolbar.breadcrumbs,
show_gutter: full_mode,
show_line_numbers: (!full_mode).then_some(false),
@ -2401,7 +2399,7 @@ impl Editor {
let mut key_context = KeyContext::new_with_defaults();
key_context.add("Editor");
let mode = match self.mode {
EditorMode::SingleLine { .. } => "single_line",
EditorMode::SingleLine => "single_line",
EditorMode::AutoHeight { .. } => "auto_height",
EditorMode::Minimap { .. } => "minimap",
EditorMode::Full { .. } => "full",
@ -6772,7 +6770,7 @@ impl Editor {
&mut self,
cx: &mut Context<Editor>,
) -> Option<(String, Range<Anchor>)> {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
return None;
}
if !EditorSettings::get_global(cx).selection_highlight {
@ -12601,7 +12599,7 @@ impl Editor {
return;
}
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -12725,7 +12723,7 @@ impl Editor {
return;
}
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13209,7 +13207,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13230,7 +13228,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13251,7 +13249,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13272,7 +13270,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13293,7 +13291,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13318,7 +13316,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13343,7 +13341,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13368,7 +13366,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13393,7 +13391,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13414,7 +13412,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13435,7 +13433,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13456,7 +13454,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13477,7 +13475,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -13502,7 +13500,7 @@ impl Editor {
}
pub fn move_to_end(&mut self, _: &MoveToEnd, window: &mut Window, cx: &mut Context<Self>) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}
@ -14551,7 +14549,7 @@ impl Editor {
let advance_downwards = action.advance_downwards
&& selections_on_single_row
&& !selections_selecting
&& !matches!(this.mode, EditorMode::SingleLine { .. });
&& !matches!(this.mode, EditorMode::SingleLine);
if advance_downwards {
let snapshot = this.buffer.read(cx).snapshot(cx);
@ -22867,7 +22865,7 @@ impl Render for Editor {
let settings = ThemeSettings::get_global(cx);
let mut text_style = match self.mode {
EditorMode::SingleLine { .. } | EditorMode::AutoHeight { .. } => TextStyle {
EditorMode::SingleLine | EditorMode::AutoHeight { .. } => TextStyle {
color: cx.theme().colors().editor_foreground,
font_family: settings.ui_font.family.clone(),
font_features: settings.ui_font.features.clone(),
@ -22893,7 +22891,7 @@ impl Render for Editor {
}
let background = match self.mode {
EditorMode::SingleLine { .. } => cx.theme().system().transparent,
EditorMode::SingleLine => cx.theme().system().transparent,
EditorMode::AutoHeight { .. } => cx.theme().system().transparent,
EditorMode::Full { .. } => cx.theme().colors().editor_background,
EditorMode::Minimap { .. } => cx.theme().colors().editor_background.opacity(0.7),

View file

@ -8105,7 +8105,7 @@ impl Element for EditorElement {
// The max scroll position for the top of the window
let max_scroll_top = if matches!(
snapshot.mode,
EditorMode::SingleLine { .. }
EditorMode::SingleLine
| EditorMode::AutoHeight { .. }
| EditorMode::Full {
sized_by_content: true,

View file

@ -675,7 +675,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}

View file

@ -16,7 +16,7 @@ impl Editor {
return;
}
if matches!(self.mode, EditorMode::SingleLine { .. }) {
if matches!(self.mode, EditorMode::SingleLine) {
cx.propagate();
return;
}