netbeans
netbeans copied to clipboard
#4447 - Fix missing code folding blocks in java editor for conditions, loops and try/catch
The motivation about this was to implement those missing folding blocks in java editor. This was just implemented for imports, classes, inner classes, methods but not for stuff inside methods like if/else if/else, try/catch and loops because all of them are treated like as code blocks.
Please bare with me and my knowledge of the stuff. Unfortunately I dunno why the if statement was implemented, that I removed from JavaElementFoldVisitor but this prevents it from adding folding rectangle to those blocks. This is the only line that I need to change in general but, now I changed the method code block to general code-blocks because now it is not only for methods anymore.
Before:
After:
It works for the mentioned blocks, but switch is still missing.
wanted to suggest to add a test case for it but the code folding tests don't work anyway and probably haven't been run for a long time, so I suppose its fine ;)
Ok, I see the failing build is related to my code changes. Will try to fix them first.
So everything is back green. Thx to @mbien. @sdedic can you please have a look again :)
lets wait for #4931 before merging this. Since this PR enables the tests of java.editor
Sure, thx for the info.
@Chris2011 would be good to rebase this PR so we get a fresh CI run on the new config.
Should we move this to NB18? what do you think?
@Chris2011 would be good to rebase this PR so we get a fresh CI run on the new config.
Should we move this to NB18? what do you think?
We can move this to NB18, but I'm still waiting for feedback what I should do now. I dunno whether I still should change smth or we need to have a discussion about this. I dunno unfortunately.
Hey @sdedic for now I hope that I understood what you mean so I changed the mapping in the deprecated Java Editor Lib to the method block and hope that this is what you requested.
To test the old implementation, if necessary, do anyone know an old Platform Application, using the old Java Editor Lib to test my stuff?