mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-87087 Code formatting corrupts the code
Don't modify c-style comments white space
This commit is contained in:
@@ -78,7 +78,10 @@ public class JavaSpacePropertyProcessor extends JavaElementVisitor {
|
||||
}
|
||||
|
||||
if (myChild2 != null && StdTokenSets.COMMENT_BIT_SET.contains(myChild2.getElementType())) {
|
||||
if (mySettings.KEEP_FIRST_COLUMN_COMMENT) {
|
||||
if (myChild2.getElementType() == JavaTokenType.C_STYLE_COMMENT) {
|
||||
myResult = Spacing.getReadOnlySpacing();
|
||||
}
|
||||
else if (mySettings.KEEP_FIRST_COLUMN_COMMENT) {
|
||||
myResult = Spacing
|
||||
.createKeepingFirstColumnSpacing(0, Integer.MAX_VALUE, true, mySettings.KEEP_BLANK_LINES_IN_CODE);
|
||||
}
|
||||
|
||||
+14
@@ -489,4 +489,18 @@ public class JavaFormatterIndentationTest extends AbstractJavaFormatterTest {
|
||||
")"
|
||||
);
|
||||
}
|
||||
|
||||
public void testCStyleCommentIsNotMoved() throws Exception {
|
||||
// IDEA-87087
|
||||
doClassTest(
|
||||
" /*\n" +
|
||||
" this is a c-style comment\n" +
|
||||
" */\n" +
|
||||
" // This is a line comment",
|
||||
" /*\n" +
|
||||
" this is a c-style comment\n" +
|
||||
" */\n" +
|
||||
"// This is a line comment"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user