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.
When doing PHP programming for certain situations (such as Drupal), there are multitudes of long arrays. It would be nice to be able to fold these and focus on the logic. Ideally this should work for both long (e.g. array(...) ) and short (e.g. [...] ) array formats.
Adding Junichi to CC, he could be interested. Thanks.
Created attachment 163985 [details] Large array
Created attachment 164013 [details] a screenshot of prototypes 1. Leave brackets. 2. Don't leave brackets.(A template contains them. But the same brackets([]) are used.) 3. New([]) and old(array()) syntaxes use the same display. Which do you prefer? I'm going to implement no.3. If features can be added yet, I'll do it.(Currently, it's being confirming.) Thanks!
From my point of view the second option would be better. If it possible, do not move second bracket to next line. $test2 = array(...22 lines);
(In reply to proger.su from comment #4) > From my point of view the second option would be better. > If it possible, do not move second bracket to next line. > > $test2 = array(...22 lines); Okey. I'll just leave "array". i.e. $test1 = [...n lines]; // short array syntax $test2 = array[...22 lines]; // old array syntax Unfortunately, only the same brackets can be used. If brackets are left, the closing bracket may not be on the same line with the opening bracket (e.g. In such a case: "]" is the beginning of a line. Perhaps, this is an API's problem). I'm not sure this can be added to the next version yet. Thanks.
It's perfect. Please write here when this will be add to release.
(In reply to proger.su from comment #6) > It's perfect. Please write here when this will be add to release. Sure.
Created attachment 164038 [details] gif If nested arrays are on the same line[1], we can collapse them using [Ctrl] key. [Ctrl] + click, [Ctrl] + [-], e.t.c. More information: View > Code Folds [1]e.g. <?php $test1 = ["test1" => ["test2" => ["test3" => "test4"]]];
Amazing
Fixed. http://hg.netbeans.org/web-main/rev/43a2086b8a5c Probably, it will be available in the development build tomorrow or later. (This means that it will also be available in the next stable version.) Thanks.
I am very happy. Thank you very much!
You are welcome :) Please try to test it if possible. Then if you find a problem, please report it as a new issue. Thanks.
Integrated into 'main-silver', will be available in build *201704100002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/43a2086b8a5c User: Junichi Yamamoto <junichi11@netbeans.org> Log: #262471 - Add code folding for arrays
*** Bug 224042 has been marked as a duplicate of this bug. ***
(In reply to junichi11 from comment #12) > You are welcome :) > > Please try to test it if possible. Then if you find a problem, please report > it as a new issue. > > Thanks. Thank you! I will definitely test.
I lack the same code folding for long arrays $a = array ( ... ); Should I use http://hg.netbeans.org/web-main/rev/43a2086b8a5c ? How ?
(In reply to petronel from comment #16) > I lack the same code folding for long arrays > > $a = array ( > ... > ); > > Should I use http://hg.netbeans.org/web-main/rev/43a2086b8a5c ? How ? Please use a nightly build[1]. [1] http://bits.netbeans.org/download/trunk/nightly/latest/
Created attachment 164861 [details] Arrays folding I'm sorry. Before, there was no time to check. Works great. Thanks a lot!!!
No problem :)