Community
Participate
Working Groups
I find it esthetically pleasing to have an extra space in front of my remarks, except the first line. Remark templates were changed for that for all types, in the form /** remark * remark */ This will fail (i.e. be ignored) for getters, setters, constructors, types, fields, methods and overriding methods (all possible remark prefs) and be showed as: /** remark * remark */ Also pressing enter after typing /** will add a * below the first * in stead of the second *. It's minor, but the remark template configuration exists so it should be expected that it works.
Move to JDT/Text
can be reproduced using I200408041200.
*** Bug 112965 has been marked as a duplicate of this bug. ***
(In reply to comment #3) > *** Bug 112965 has been marked as a duplicate of this bug. *** I'm not entirely sure why 112965 was marked as a duplicate. In that bug, I have a template of the form: /* * line 1 * line 2 */ When that template is inserted, it's formatted as: /* * line 1 * line 2 */ This is without the code formatter enabled for that template. This is a regression from 3.1. It worked fine in 3.1 and is no longer working in 3.1.1. This is why I'm confused about it being a duplicate of this bug, since this bug was reported against 3.0.
If you format the file you loose your style again right? This can either be support by offering to disable the formatter when using code templates (similar to normal templates) or add an option to the formatter.
> If you format the file you loose your style again right? /** When I press enter after this line * the indentation is wrong on the second line. * so I have to add a space before each line, * except the first. */ /** When I added spaces and the remark looks as * configured in the template, after I format * the file again, the state of all remarks * are back to the original state from the * previous paragraph. */ > This can either be support by offering to disable the formatter > when using code templates (similar to normal templates) or add > an option to the formatter. That is not support, that is a workaround, i.e. not using the formatter for remarks. This bug report was created in the hope that the bug in the remark templates would be fixed. Therefore I don't understand why you see this bug as an enhancement request. Trivial perhaps (though annoying because I'm confronted with it everytime I write remarks in my code), but not an enhancement because this feature does not work as advertised.
I have no idea if anything is done on this issue, but I have another problem that is a consequence of using the changed code templates. When I copy /** The text here tells something about the use and * implementation of this method. */ public void someMethod() { // empty } and paste again, all lines except the first (the /** line) will be indented one less. Paste again and one less, etc. This happens when the 'spaces for tabs' option is set and is not formatter related (as far as I can tell) I can work around the code template bug using a java code beautifier that supports my silly remark fetish but the copy and paste is not very handy, especially if I decide to copy a somewhat larger method I have to add a space in front of each line. If I have to add this issue as a new bug, please let me know. I realise that this is a bug that has very low priority, but if the indentation problem can be easily fixed that would be much appreciated.
Re. comment 7: you can disable auto-indent-on-paste on the Java > Editor > Typing preference page.
That's a two edged sword, because copy/paste to move parts of code around now doesn't indent automatically anymore too, but it helps with my problem and this way is easier than before. I'll use alt-cursor to move code around instead (fortunately that still indents correctly). Thank you for mentioning this, that helps me a lot.