This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The editor should be capable of joining lines easily and having this action bound to a key stroke such as ctrl-j. In addition, it should be intelligent about white-space and programming language constructs. Taking from IntelliJ IDEA, if you have a piece of code like this: Foo foo; foo = bar.getSomeFoo(); Joining these lines should produce this result: Foo foo = bar.getSomeFoo();
FYI: This request is the opposite hint of the currently existing hint "split declaration and assignment".
Custom hint may help in this case. How to setup custom hint: 1) open Refactor -> Insect&Transform dialog 2) click on Browse 3) click on New 4) click on Edit script 5) click on Open In editor 6) copy this code into the editor: $1 $2; $2 = $3; => $1 $2 = $3; ;; 7) save file -> now this hint can be run at several sources by Inspect&Transform or the hint is now provided in editor for each occurrences of give pattern
(In reply to Jiri Prox from comment #2) > Custom hint may help in this case. > > How to setup custom hint: > 1) open Refactor -> Insect&Transform dialog > 2) click on Browse > 3) click on New > 4) click on Edit script > 5) click on Open In editor > 6) copy this code into the editor: > > $1 $2; > $2 = $3; > => > $1 $2 = $3; > ;; > > 7) save file > > -> now this hint can be run at several sources by Inspect&Transform > or > the hint is now provided in editor for each occurrences of give pattern I like to create a Java Hint for that, but unfortunately there is an issue in JavaFixUtilities.rewriteFix - see https://netbeans.org/bugzilla/show_bug.cgi?id=244487