question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Line comments should not be generated at the first column

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Reactions:21
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
alouckscommented, Jul 7, 2019

Is there any update on this? It’s really frustrating.

1reaction
p-avitalcommented, Oct 8, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found