Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Marc
@corpsmoderne@mamot.fr  ·  activity timestamp 4 weeks ago

To the people using #zed for #rust development: Rust (new) module system uses module_name.rs + module_name/ (directory) for organizing modules and sub-modules, so it would make sense to NOT sort directories first in the project panel, so the file and dir for one module are next to each other and not the dir on top and the file elsewhere bellow. How to you configure it to have the natural sorting for #rust project?

  • Copy link
  • Flag this post
  • Block
Michał Fita
@michalfita@mastodon.social replied  ·  activity timestamp 4 weeks ago
@corpsmoderne This has been added to avoid repeating `mod.rs` so many times in larger projects.
  • Copy link
  • Flag this comment
  • Block
Marc
@corpsmoderne@mamot.fr replied  ·  activity timestamp 4 weeks ago
@michalfita I know, it wasn't what I asked.
  • Copy link
  • Flag this comment
  • Block
Paul Hansen
@paul@mastodon.gamedev.place replied  ·  activity timestamp 4 weeks ago
@corpsmoderne This is why I don't use the new file with the same name as folder system. A project's file hierarchy shouldn't need special support in file viewers to be easy to follow.

Honestly I don't think I've noticed a popular Rust project that uses it. Zed, Leptos, Dioxus, Bevy, tokio all use mod.rs files.

  • Copy link
  • Flag this comment
  • Block
Marc
@corpsmoderne@mamot.fr replied  ·  activity timestamp 4 weeks ago
@paul yeah in the current state of affairs I prefer the other pattern too. Actually half of my projects use one pattern and the other half the other it's a mess 😅
  • Copy link
  • Flag this comment
  • Block
Paul Hansen
@paul@mastodon.gamedev.place replied  ·  activity timestamp 4 weeks ago
@corpsmoderne yeah it's unfortunate it got added imo, but I don't blame people for using it. The docs push it pretty hard.

It's important imo that there's only one way to do these kinds of things. Multiple ways to do it means third party tools have to support both, and can waste a lot of time with arguments over style in every project etc.

One of my favorite things about rust is rustfmt having one way things are formatted so people don't argue over formatting. Feels like a step away from that.

  • Copy link
  • Flag this comment
  • Block
Marc
@corpsmoderne@mamot.fr replied  ·  activity timestamp 4 weeks ago
@paul they should allow a third pattern: module_name/module_name.rs and call it a day 😬
  • Copy link
  • Flag this comment
  • Block
Paul Hansen
@paul@mastodon.gamedev.place replied  ·  activity timestamp 4 weeks ago
@corpsmoderne lol yeah I think that would have been slightly better than the new way, but also please don't add more lol.
  • Copy link
  • Flag this comment
  • Block
tuxmain
@tuxmain@toot.aquilenet.fr replied  ·  activity timestamp 4 weeks ago
@corpsmoderne I had never thought of it before but the same thing happens in VSCodium. There is a setting Explorer->Sort Order. But I don't use Zed.
  • Copy link
  • Flag this comment
  • Block
Marc
@corpsmoderne@mamot.fr replied  ·  activity timestamp 4 weeks ago
@tuxmain it's puzzling that it's not the default for Zed as it's iteself coded in Rsut, they should have noticed by now X)
  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.2.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login