Apache NetBeans
[PHP] Conditional breakpoints and new Twig features
Hi all. Today, we will show you some new features which will be available in the next NetBeans version, maybe (NetBeans 10? NOTE: we cannot promise anything about release contents at the moment).
First of all, if you would like to try new features, please build NetBeans yourself.
git clone git@github.com:apache/incubator-netbeans.git cd incubator-netbeans ant -Dcluster.config=full (or ant -Dcluster.config=php)
You can find the start-up files in the nbbuild/netbeans/bin directory if the build succeeds. So please run it.
Debugger: Conditional breakpoints
You can stop the debugger if the context matches your condition. i.e. If the condition is true, the debugger stops on the breakpoint, otherwise, it does not stop there.
I assume that you have already done the settings for debugging. (please see: HowToConfigureXDebug) If xdebug doesn't work, please ask someone via Apache NetBeans mailing lists. (Please don't ask here.)
Just in my case(Ubuntu 18.04):
sudo apt install php-xdebug sudo vim /etc/php/7.2/mods-available/xdebug.ini # Change to the following zend_extension=xdebug.so xdebug.remote_enable=1 xdebug.remote_autostart=1 xdebug.idekey="netbeans-xdebug"
Let's try running with a sample code(index.php):
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <?php $array = ["foo", "bar", "baz", "qux"]; foreach ($array as $value) { echo $value; } ?> </body> </html>
Step 1: Enable a breakpoint
You can enable it when you click a line number.
Step 2: Show the Breakpoint Properties dialog
To show it, please right-click the breakpoint, then please click Breakpoint > Properties.
Step 3: Input a condition
Please check "Condition" and input your condition to the combo box, then click the OK button.
Step 4: Run Debug Project
Please click Debug > Debug Project or the icon on the toolbar.
In this case, the debugger stops on the breakpont if $value is "baz".
Twig: Code completion for delimiters, brackets, and quotes
Twig editor supports code completion for delimeters({{ and {%), brackets([, (, and {), and quotes(" and '). This feature is enabled by default. If you would like to disable, please uncheck the options (Tools > Options > Editor > Code Completion > Language: Twig File).
Twig: Palette support
You can show the palette window. Please click Window > IDE Tools > Palette.
That's all for today. As always, please test it. If you find some issues or enhancements, please report them to JIRA (Components: php - Debugger, php - Twig). Thanks.
Posted at 11:26PM Aug 30, 2018
by Junichi in PHP |
Comments [4]
|
Audio of Virtual Apache NetBeans Meeting 2
The second of a series of informal virtual meetups took place today.
The audio of the meeting is available here and takes about 45 minutes:
https://www.youtube.com/watch?v=yQ72aZqwGec
Sign up to the next virtual meetups here:
https://doodle.com/poll/xueimbynzam7sri7
Posted at 11:43AM Aug 21, 2018
by Geertjan in General |
|
NetBeans Status at InfoQ
Today an article was published on InfoQ describing the current state and progress of Apache NetBeans.
Click to read the start of it here:
Go here to read it all:
https://www.infoq.com/news/2018/08/netbeans-apache-update-aug18
Posted at 12:00AM Aug 16, 2018
by Geertjan in General |
|
Audio of Virtual Apache NetBeans Meeting 1
The first of a series of informal virtual meetups took place today.
The audio of the meeting is available here and takes about an hour:
https://www.youtube.com/watch?v=tibK6A8CzYs
Posted at 12:00AM Aug 07, 2018
by Geertjan in General |
|