Line comments should not be generated at the first column
See original GitHub issueThe standard way that rustfmt
formats code places the //
of a comment at the same indentation level as the surrounding code. Intellij fights this behavior by placing the //
at the beginning of the line, causing weird formatting issues.
For Java, this is configurable under Settings -> Code Style -> Java -> Code Generation -> Line comment at first column
. It would be nice if Rust could be configured by default not to do this, and it would be nice to have at least the option to Add a space at comment start
, which the Java settings include.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:21
- Comments:7 (3 by maintainers)
Top Results From Across the Web
java - IntelliJ shortcut ctr + / adds a comment at the first column ...
1 Answer 1 · Settings (Preferences on macOS) | Editor | Code Style | Java | Code Generation | Comment Code | Line...
Read more >Line comment at first column doesn't do anything. : WI-28883
1. Check or Uncheck Code Style -> PHP -> Other -> Line comment at first column · 2. Comment a line via Ctrl...
Read more >Xcode adds comment characters in the first column?
Using the mentioned keyboard shortcut, the comment character // always appear in the first column irrespective of the indentation level.
Read more >5 SQL*Loader Control File Reference
Comments can appear anywhere in the command section of the file, but they should not appear ... The discard file is not created,...
Read more >extract first row from matrix - MATLAB Answers - MathWorks
Usually in MATLAB it makes a lot more sense to keep your data together in arrays, so it may not be necessary to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there any update on this? It’s really frustrating.
Same problem here. The other issues have been closed with PR #1972, but I don’t think this was the right approach, since I believe
rustfmt
standard should be upheld, if only because it is available regardless of platform and IDE. It’s quite frustrating when toggling a line comment to see its indentation get completely broken.