Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 160980 Details for
Bug 304705
[formatter] Unexpected indentation of wrapped line comments when 'Never indent line comment on first column' preference is checked
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 3.21 KB, created by
Frederic Fusier
on 2010-03-04 12:35:49 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2010-03-04 12:35:49 EST
Size:
3.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: formatter/org/eclipse/jdt/internal/formatter/Scribe.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java,v >retrieving revision 1.198 >diff -u -r1.198 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 3 Mar 2010 16:32:11 -0000 1.198 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 4 Mar 2010 17:33:05 -0000 >@@ -2692,7 +2692,9 @@ > if (newLineString == null) { > StringBuffer newLineBuffer = new StringBuffer(this.lineSeparator); > this.column = 1; >- printIndentationIfNecessary(newLineBuffer); >+ if (!this.formatter.preferences.never_indent_line_comments_on_first_column) { >+ printIndentationIfNecessary(newLineBuffer); >+ } > newLineBuffer.append(LINE_COMMENT_PREFIX); > this.column += LINE_COMMENT_PREFIX_LENGTH; > newLineString = newLineBuffer.toString(); >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java,v >retrieving revision 1.57 >diff -u -r1.57 FormatterCommentsBugsTest.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 3 Mar 2010 11:17:35 -0000 1.57 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 4 Mar 2010 17:33:08 -0000 >@@ -6203,4 +6203,40 @@ > "}\n"); > } > >+/** >+ * @bug 304705: [formatter] Unexpected indentation of wrapped line comments when 'Never indent line comment on first column' preference is checked >+ * @test Verify that wrapped line comments are also put at first column >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=304705" >+ */ >+public void testBug304705() { >+ this.formatterPrefs.never_indent_line_comments_on_first_column = true; >+ String source = >+ "public interface Example {\n" + >+ "// This is a long comment with whitespace that should be split in multiple line comments in case the line comment formatting is enabled\n" + >+ " int foo();\n" + >+ "}\n"; >+ formatSource(source, >+ "public interface Example {\n" + >+ "// This is a long comment with whitespace that should be split in multiple line\n" + >+ "// comments in case the line comment formatting is enabled\n" + >+ " int foo();\n" + >+ "}\n"); >+} >+public void testBug304705b() { >+ this.formatterPrefs.never_indent_block_comments_on_first_column = true; >+ String source = >+ "public interface Example {\n" + >+ "/* This is a long comment with whitespace that should be split in multiple line comments in case the line comment formatting is enabled */\n" + >+ " int foo();\n" + >+ "}\n"; >+ formatSource(source, >+ "public interface Example {\n" + >+ "/*\n" + >+ " * This is a long comment with whitespace that should be split in multiple line\n" + >+ " * comments in case the line comment formatting is enabled\n" + >+ " */\n" + >+ " int foo();\n" + >+ "}\n"); >+} >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 304705
: 160980