Skip to content

Separate use_small_heuristics into distinct options #3710

@mooman219

Description

@mooman219

Feature request

Small heuristics has a mix of formatting cases that I like and dislike. Unfortunately, I can't have the mix of formatting options I want since it's an all or nothing sort of situation with use_small_heuristics. This issue is a feature request to separate out those formatting options into distinct options.

For backwards compatibility, I imagine it would be reasonable to annotate them as "overridden if use_small_heuristics is not 'off'"

Example situation

It's a small heuristic feature to format structural enums on the same line:

 match message {
     InputMessage::CloseRequested => is_active = false,
     InputMessage::KeyPressed(key) => match key {
         KeyboardButton::Escape => is_active = false,
         _ => {}
     },
+    InputMessage::CursorPressed { .. } => {
-    InputMessage::CursorPressed {
-        ..
-    } => {
         // Code
     }
+    InputMessage::CursorMoved { pos, .. } => {
-    InputMessage::CursorMoved {
-        pos,
-        ..
-    } => {
         // Code
     }
     _ => {}
 }

But if I disagree with some of the other small heuristics, I can't have this formatting option at all if I chose to set the configuration option to "off".

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions