-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reformatting code is left-aligning comments. #295
Comments
This also happens for me when I type "/**" then hit enter to auto generate a comment block. First line is always at column 0. (IntelliJ 14.1.3, plugin 0.9.4) Btw, same operation works fine for Java. |
The code that does reformatting is IDEA's DefaultCodeFormatter (IIRC). The PSI for comments is likely not what the formatter is expecting. I suspect, but I haven't yet confirmed, that the change for #209 is causing the issue. Incidentally, the unit tests do contain this scenario and are NOT failing. Therefore, I'm half-expecting some secondary processing step to be re-aligning incorrectly. Stepping (debugging) through unit test code did not reveal anything unusual. |
If I got it right, then I think that it works in a proper way, single line comments in IDEA added from line start, so no problem with that, but if it's added in some other IDE, then this may happen. |
@wiggin77 /** indeed works wierd, but /* works just fine |
I don't understand. Are you saying that single line comments should be aligned on the left-most column (column 1) when the code is reformatted? If so, then I disagree. Right now, this: class Test {
// a comment
public function new() {}
} is reformatted to this: class Test {
// a comment
public function new() {}
} If the comment started in the left-most column (column 1), then it should stay there. If the comment has any indentation, then it should be indented to match the code. |
+1 I had that problem. All my comments were moved to the left-most column and it was a bit annoying. |
@EBatTiVo Sorry, I was wrong Notice where it inserts comment (// part) Haxe: |
Fix is in #372. Awaiting review. |
Fixed with #372 and merged. |
Highlight and reformat (Code->Reformat Code) any code containing a comment will place the single-line comments against the left-most column (removes indenting) or will left-align the first line of a block comment. Copy and paste will left align comments in the pasted block as well.
TIR: STB-10533
The text was updated successfully, but these errors were encountered: