Settings

Theme

Show HN: Codesort sorts your code, in the CLI or in your IDE

github.com

7 points by dystroy 2 years ago · 2 comments

Reader

Tabular-Iceberg 2 years ago

Why alphabetical and not topological?

  • dystroyOP 2 years ago

    Imagine you have a big enum in Rust, for example an Error, with a dozen or more variants.

    When maintaining related code, for example a Display implementation, or routing to some behaviors, it's sometimes much easier when it's alpha sorted: you immediately see what's implemented or not.

    That's when you can hit the codesort shortcut to have this specific list (enum variants, match arms, etc.) sorted.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection