-
Notifications
You must be signed in to change notification settings - Fork 33
Should editor settings (tabLength/softTabs/preferredLineLength) be set? #93
Comments
I don't like recommended editor settings, I prefer 2, 4 is a lot... |
I use 4-column wide hard tabs and hate it when grammars change that. If it isn't a syntactic requirement that a tab or a space be used to indent, it shouldn't be shoved onto the end user. (To be bluntly honest, I don't give a crap about "Rust standard style", and I doubt I'm alone either.) |
I'm mostly on the fence about this, but tilting slightly in favor of removing the custom line length, since:
I don't really think "standard style" is good enough reason to give language-rust different/surprising behavior compared to Atom's other language packages. It's a shame that Rust decided to deviate from the 80-column convention, which has been in wide use for a long time in a number of different contexts. That said, I'm more of a casual user of Rust -- it's not my primary language (or a language I use professionally), and people who use it on a regular basis may have a different opinion. |
If there was a way to set a default for this package while still allowing configuration, then I'd be all for it, but as it stands now, it isn't possible for me to customize the package to match my global settings (and frustratingly, it LOOKS possible--my changes just seem to be ignored). Until Atom provides a way to set per-package defaults that doesn't have this problem, I'd really appreciate it if language-rust would stop overriding these settings. |
@rjbailey Do as I did and add this (or whatever you want to change) to your ".rust.source":
editor:
softTabs: false Problem solved! |
Thanks for the workaround! |
Atom also does have a settings page for it. It's just a bit hard to find. Go to Settings -> Packages -> language-rust -> Settings (gear icon next to the uninstall button). There are the Rust-specific editor defaults. Works for other language packages too. |
@zargony Unfortunately this actually does not work. The defaults that show up for line length and tab length are |
Right, I experienced the same thing. That's why I said it looks possible, but actually isn't--I found the settings page, but couldn't use it to configure the package to use my global defaults. It's not a very good experience. |
You're right and I've come across this as well some time ago. Atom's settings page seems to ignore package-based defaults and always look at global defaults. This sounds like an Atom bug to me. |
Forcing a code style, even if it is kind of a language standard. is annoying and limited. No problem it defaults to the style guide, but having no configuration option that allows the user to explicitly tell his identation styles is frustrating. It would be better, IMHO, to default to the style guide and to have an option for the user to be free and choose whatever style he wants to. |
I agree that forced coding style is annoying. The intended behavior is to provide defaults accordingly to the style guide, but (of course) allow anyone to override these defaults. It's because of Atom bug #939 that you currently can't override them back to the global defaults. |
Coming from a fresh Atom install with every other file type formatted at an 80 character width, installing Rust lints package, and then having the width indicator 19 characters off from the default is very annoying. If I could go over to the settings window for this package I would, but as mentioned before this does not work. I was only able to fix this because I'd fixed this in on another computer - by grepping for "width" and "9" in my I get that this is an Atom bug. As an end user, though, it really pissed me off - I'm just trying to show how frustrating it is. Imagine being new to Atom and seeing that a setting is off but all the settings menu and |
Looks like it got fixed in Atom (atom/settings-view#967) and with next Atom Release we shouldn't have this issue anymore. |
Just an anecdote that I just wasted 30 minutes troubleshooting why my wrap guide was at 100 even though the core package wrap-guide's setting was 80. Changed to other values, no luck. I think the wrap guide should be handled entirely by the I'll also note that wrapping at 100 causes stackoverflow code snippets to scroll horizontally, which makes it harder to get help with a rust issue. |
I think it makes complete sense that the wrap guide package respects language settings; in fact, I would consider it a bug if it didn't. It would be weird for the soft wrap length to be different to the visual indicator of the wrap-guide. It's not a "magic override", it's just doing it's job. And this sort of setting is well within the expected scope of this package; each programming language comes with it's own "expected style". It's not enforceable, but package defaults should align with these values (because, presumably, these expectations were set for a reason). If a user makes a (one time) conscious decision to change it, power to them. Note I haven't actually tested what happens when you change the defaults set by this package. I know Atom can behave strangely when default settings are involved. However, at a conceptual level, this is the right behaviour (for the wrap guide, and for providing default settings). |
Currently, this package sets the tabLength/softTabs/preferredLineLength editor settings (in settings/rust.cson) of Rust files to values recommended by the Rust style guide. This means that Atom automatically uses 4 spaces for indentation and a line length of 99 when editing .rs files, even if the user has different (global) settings. This was meant to encourage people to use these settings accordingly to the style guide (which is used by almost every public Rust code). There's still the possibility to override these settings in the package settings. However, this seems to confuse people and more and more issues and pull requests pop up that try to remove these recommended defaults.
I personally think it's a good idea to provide these editor settings to encourage the public Rust style. However, if people are confused about this, it might be better to remove them? I don't think I should decide this on my own. What do you think about it?
Keep recommended editor settings (👍)
Don't keep recommended editor settings (👎)
The text was updated successfully, but these errors were encountered: