You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "troizet (via GitHub)" <gi...@apache.org> on 2023/08/21 15:40:03 UTC

[GitHub] [netbeans] troizet opened a new pull request, #6366: Added support for exception breakpoints.

troizet opened a new pull request, #6366:
URL: https://github.com/apache/netbeans/pull/6366

   What has been done in this PR:
   **1) Added support for exception breakpoints.** (Closes #5434)
   
   Debugging examples:
   
    - without using exception breakpoint
    
   
   https://github.com/apache/netbeans/assets/9607501/8eafe7b9-9a00-4998-a49c-ba447368d396
   
   - breakpoint on warning
   
   
   https://github.com/apache/netbeans/assets/9607501/fb59ab0e-bf72-4c42-83e8-f9b2ca7740b2
   
   - breakpoint on MyException class
   
   
   https://github.com/apache/netbeans/assets/9607501/e70a3cb9-b604-432d-bb20-b459a3ccf616
   
   
   
   
   
   
   
   **2) `Breakpoint_set` and `breakpoint_remove` commands are used instead of `breakpoint_update` to change breakpoint state during debugging.**
   
   In the current implementation, enabling/disabling a breakpoint during debugging is done by setting the `state` attribute with the [breakpoint_update](https://xdebug.org/docs/dbgp#id5) command.
   But for exception breakpoint the `state` attribute has no effect. I checked on versions of xdebug: v3.1.6, v3.2.0, v3.2.1. 
   I looked at how this functionality is implemented in `PhpStorm` and `VSCode` using the xdebug log file.
   There breakpoint enable/disable is implemented via `breakpoint_set`/`breakpoint_remove` commands.
   
   ```diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointRuntimeSetter.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointRuntimeSetter.java
   
   --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointRuntimeSetter.java
   +++ b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointRuntimeSetter.java
   @@ -66,7 +66,12 @@ public void propertyChange(PropertyChangeEvent event) {
                return;
            }
            Object source = event.getSource();
   -        performCommand((Breakpoint) source, Lazy.UPDATE_COMMAND);
   +
   +        if (((Breakpoint)source).isEnabled()) {
   +            performCommand((Breakpoint) source, Lazy.SET_COMMAND);
   +        } else {
   +            performCommand((Breakpoint) source, Lazy.REMOVE_COMMAND);
   +        }
        }
   ```
   
   For the same reason, I removed the `breakpoint_set` command for a disabled breakpoint when debugging starts.
   
   ```diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/packets/InitMessage.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/packets/InitMessage.java
   
   --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/packets/InitMessage.java
   +++ b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/packets/InitMessage.java
   @@ -122,7 +122,11 @@ private void setBreakpoints(DebugSession session) {
            SessionId id = session.getSessionId();
            Breakpoint[] breakpoints = DebuggerManager.getDebuggerManager().getBreakpoints();
            for (Breakpoint breakpoint : breakpoints) {
   -            if (!(breakpoint instanceof AbstractBreakpoint)) {
   +            if (!(breakpoint instanceof AbstractBreakpoint) ) {
   +                continue;
   +            }
   +            //do not set a breakpoint at debug start if it is not enabled
   +            if (!breakpoint.isEnabled()) {
                    continue;
                }
                AbstractBreakpoint brkpnt = (AbstractBreakpoint) breakpoint;
   ```
   
   **3) Fixed a bug where the previous breakpoint was displayed as the current breakpoint in the breakpoint list if the current breakpoint was not found.**
   
   ```diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java
   
   --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java
   +++ b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java
   
   @@ -119,15 +126,25 @@ public String getShortDescription(Object node) throws UnknownTypeException {
    
        public void setCurrentStack(Stack stack, DebugSession session) {
            if (stack == null) {
   -            synchronized (myCurrentBreakpoints) {
   -                AbstractBreakpoint breakpoint = myCurrentBreakpoints.remove(session);
   -                fireChangeEvent(new ModelEvent.NodeChanged(this, breakpoint));
   -            }
   +            removeCurrentBreakpoint(session);
                return;
            }
            String currentCommand = stack.getCurrentCommandName();
            if (!foundLineBreakpoint(stack.getFileName().replace("file:///", "file:/"), stack.getLine() - 1, session)) { //NOI18N
   -            foundFunctionBreakpoint(currentCommand, session);
   +            if (!foundFunctionBreakpoint(currentCommand, session)) {
   +                /**
   +                 * Clear myCurrentBreakpoints because if the current breakpoints is not found,
   +                 * the previous breakpoint will still be shown as current
   +                 */
   +                removeCurrentBreakpoint(session);
   +            }
   +        }
   +    }
   +
   +    private void removeCurrentBreakpoint(DebugSession session) {
   +        synchronized (myCurrentBreakpoints) {
   +            AbstractBreakpoint breakpoint = myCurrentBreakpoints.remove(session);
   +            fireChangeEvent(new ModelEvent.NodeChanged(this, breakpoint));
            }
        }
   
   ```
   
   
   
   
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1309617521


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/completion/ExceptionCompletionProvider.java:
##########
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui.completion;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.JTextComponent;
+import org.netbeans.api.editor.mimelookup.MimeRegistration;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ui.OpenProjects;
+import org.netbeans.modules.csl.spi.support.CancelSupport;
+import org.netbeans.modules.parsing.spi.indexing.support.QuerySupport.Kind;
+import org.netbeans.modules.php.api.phpmodule.PhpModule;
+import org.netbeans.modules.php.editor.api.ElementQuery;
+import org.netbeans.modules.php.editor.api.ElementQueryFactory;
+import org.netbeans.modules.php.editor.api.NameKind;
+import org.netbeans.modules.php.editor.api.QuerySupportFactory;
+import org.netbeans.modules.php.editor.api.elements.ClassElement;
+import org.netbeans.spi.editor.completion.CompletionProvider;
+import static org.netbeans.spi.editor.completion.CompletionProvider.COMPLETION_QUERY_TYPE;
+import org.netbeans.spi.editor.completion.CompletionResultSet;
+import org.netbeans.spi.editor.completion.CompletionTask;
+import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery;
+import org.netbeans.spi.editor.completion.support.AsyncCompletionTask;
+import org.openide.filesystems.FileObject;
+
+@MimeRegistration(mimeType = ExceptionClassNbDebugEditorKit.MIME_TYPE, service = CompletionProvider.class)
+public class ExceptionCompletionProvider implements CompletionProvider {
+
+    private static final Logger LOG = Logger.getLogger(ExceptionCompletionProvider.class.getName());
+
+    private final Set<String> builtinErrors = new HashSet<>(Arrays.asList("Deprecated","Notice", "Warning")); // NOI18N
+
+    @Override
+    public CompletionTask createTask(int queryType, JTextComponent component) {
+        if (queryType != CompletionProvider.COMPLETION_QUERY_TYPE) {
+            return null;
+        }
+
+        return new AsyncCompletionTask(new AsyncCompletionQuery() {
+            @Override
+            protected void query(CompletionResultSet resultSet, Document doc, int caretOffset) {
+                if (caretOffset < 0) {
+                    caretOffset = 0;
+                }
+                String text;
+                try {
+                    text = doc.getText(0, caretOffset);
+                } catch (BadLocationException ex) {
+                    LOG.log(Level.WARNING, "Invalid offset: {0}", ex.offsetRequested());

Review Comment:
   Tools > Internationalization > Internationalize... also matches a logger part. So, maybe, we should add `// NOI18N`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300929857


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointsReader.java:
##########
@@ -71,6 +73,14 @@ public Object read(String typeID, Properties properties) {
             }
             breakpoint.setGroupName(properties.getString(GROUP_NAME, ""));
             return breakpoint;
+        } else if (typeID.equals(ExceptionBreakpoint.class.getName())) {
+            String exception = properties.getString(EXCEPTION_NAME, null);
+            ExceptionBreakpoint breakpoint = new ExceptionBreakpoint(exception);
+            if (!properties.getBoolean(ENABED, true)) {
+                breakpoint.disable();
+            }
+            breakpoint.setGroupName(properties.getString(GROUP_NAME, ""));

Review Comment:
   `// NOI18N`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#issuecomment-1687460772

   @troizet Thank you for your work!
   Please add the issue number to the commit message.
   Please write an example code.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300940822


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+    private static final String EMPTY_EXCEPTION_NAME = "LBL_EmptyExceptionName"; // NOI18N
+
+    private final JEditorPane epClassName;
+    private final JScrollPane spClassName;
+
+    public DbgpExceptionBreakpointPanel() {
+        initComponents();
+        Pair<JScrollPane, JEditorPane> editorCC = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, jPanel2, "", "");

Review Comment:
   `editorCC`: What does `CC` mean? CodeCompletion?
   Please change `jPanel2` to the proper name. `// NOI18N`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on pull request #6366: PHP: Added support for exception breakpoints.

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#issuecomment-1689676573

   @troizet 
   
   Wow, very nice PR, thanks a lot for it! :+1: 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1308181281


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+    private static final String EMPTY_EXCEPTION_NAME = "LBL_EmptyExceptionName"; // NOI18N
+
+    private final JEditorPane epClassName;
+    private final JScrollPane spClassName;
+
+    public DbgpExceptionBreakpointPanel() {
+        initComponents();
+        Pair<JScrollPane, JEditorPane> editorCC = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, jPanel2, "", "");
+        spClassName = editorCC.first();
+        epClassName = editorCC.second();
+        epClassName.getAccessibleContext().setAccessibleName("pane");
+        epClassName.getAccessibleContext().setAccessibleDescription("pane");

Review Comment:
   Please, improve A11Y description of these elements (imagine, that you cannot see them - how would you describe them?), thanks.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1302774623


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/DbgpExceptionBreakpointType.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.breakpoints;
+
+import javax.swing.JComponent;
+import javax.swing.text.JTextComponent;
+import org.netbeans.api.editor.EditorRegistry;
+import org.netbeans.modules.editor.NbEditorUtilities;
+import org.netbeans.modules.php.api.util.FileUtils;
+
+import org.netbeans.modules.php.dbgp.ui.DbgpExceptionBreakpointPanel;
+import org.netbeans.spi.debugger.ui.BreakpointType;
+import org.openide.filesystems.FileObject;
+import org.openide.util.NbBundle;
+
+public class DbgpExceptionBreakpointType extends BreakpointType {
+    private static final String PHP_BREAKPOINT_TYPE = "LBL_PhpType"; // NOI18N
+    private static final String METHOD_TYPE = "LBL_ExceptionBreakpointType"; // NOI18N
+
+    @Override
+    public String getCategoryDisplayName() {
+        return NbBundle.getMessage(DbgpExceptionBreakpointType.class,
+                PHP_BREAKPOINT_TYPE);
+    }
+
+    @Override
+    public JComponent getCustomizer() {
+        return new DbgpExceptionBreakpointPanel();
+    }
+
+    @Override
+    public String getTypeDisplayName() {
+        return NbBundle.getMessage(DbgpExceptionBreakpointType.class,

Review Comment:
   Avoid using `NbBundle.getMessage()`, prefer `@NbBundle`.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on pull request #6366: PHP: Added support for exception breakpoints.

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#issuecomment-1696751172

   @troizet Please, resolve the remaining comments so we can merge this PR 👍  Thanks a lot for your work!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] troizet commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1306613978


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java:
##########
@@ -119,15 +126,25 @@ public String getShortDescription(Object node) throws UnknownTypeException {
 
     public void setCurrentStack(Stack stack, DebugSession session) {
         if (stack == null) {
-            synchronized (myCurrentBreakpoints) {
-                AbstractBreakpoint breakpoint = myCurrentBreakpoints.remove(session);
-                fireChangeEvent(new ModelEvent.NodeChanged(this, breakpoint));
-            }
+            removeCurrentBreakpoint(session);

Review Comment:
   Sorry, I'm not quite sure what you mean.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300940822


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+    private static final String EMPTY_EXCEPTION_NAME = "LBL_EmptyExceptionName"; // NOI18N
+
+    private final JEditorPane epClassName;
+    private final JScrollPane spClassName;
+
+    public DbgpExceptionBreakpointPanel() {
+        initComponents();
+        Pair<JScrollPane, JEditorPane> editorCC = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, jPanel2, "", "");

Review Comment:
   Please change `jPanel2` to the proper name. `// NOI18N`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300947819


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/completion/ExceptionCompletionItem.java:
##########
@@ -0,0 +1,205 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui.completion;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.event.KeyEvent;
+import javax.swing.ImageIcon;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.JTextComponent;
+import org.netbeans.api.editor.completion.Completion;
+import org.netbeans.modules.php.editor.api.elements.ClassElement;
+import org.netbeans.modules.php.editor.api.elements.PhpElement;
+import org.netbeans.spi.editor.completion.CompletionItem;
+import org.netbeans.spi.editor.completion.CompletionTask;
+import org.netbeans.spi.editor.completion.support.CompletionUtilities;
+import org.openide.util.Exceptions;
+import org.openide.util.ImageUtilities;
+
+public class ExceptionCompletionItem implements CompletionItem {
+
+    private static final String CLASS_ICON = "org/netbeans/modules/php/editor/resources/class.png"; // NOI18N

Review Comment:
   Please add `@StaticResource`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1301374362


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointsReader.java:
##########
@@ -34,14 +34,16 @@ public class BreakpointsReader implements Properties.Reader {
 
     private static final String ENABED = "enabled"; // NOI18N

Review Comment:
   Although it is not your change, I would change the name.
   ```suggestion
       private static final String ENABLED = "enabled"; // NOI18N
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1308182320


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java:
##########
@@ -119,15 +126,25 @@ public String getShortDescription(Object node) throws UnknownTypeException {
 
     public void setCurrentStack(Stack stack, DebugSession session) {
         if (stack == null) {
-            synchronized (myCurrentBreakpoints) {
-                AbstractBreakpoint breakpoint = myCurrentBreakpoints.remove(session);
-                fireChangeEvent(new ModelEvent.NodeChanged(this, breakpoint));
-            }
+            removeCurrentBreakpoint(session);

Review Comment:
   Sorry, my bad, the `synchronized` itself block was removed (and replaced by this call). I somehow missed it.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 merged pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 merged PR #6366:
URL: https://github.com/apache/netbeans/pull/6366


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] PHP: Added support for exception breakpoints. [netbeans]

Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#issuecomment-1857819733

   > Is this planned?
   
   Yes, that's in the plans. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] PHP: Added support for exception breakpoints. [netbeans]

Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#issuecomment-1857250356

   > how would I see the cause of (f.e) a warning, once the breakpoint is hit?
   
   Unfortunately, there is no such opportunity at the moment.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] troizet commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1310168453


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/completion/ExceptionCompletionProvider.java:
##########
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui.completion;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.JTextComponent;
+import org.netbeans.api.editor.mimelookup.MimeRegistration;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ui.OpenProjects;
+import org.netbeans.modules.csl.spi.support.CancelSupport;
+import org.netbeans.modules.parsing.spi.indexing.support.QuerySupport.Kind;
+import org.netbeans.modules.php.api.phpmodule.PhpModule;
+import org.netbeans.modules.php.editor.api.ElementQuery;
+import org.netbeans.modules.php.editor.api.ElementQueryFactory;
+import org.netbeans.modules.php.editor.api.NameKind;
+import org.netbeans.modules.php.editor.api.QuerySupportFactory;
+import org.netbeans.modules.php.editor.api.elements.ClassElement;
+import org.netbeans.spi.editor.completion.CompletionProvider;
+import static org.netbeans.spi.editor.completion.CompletionProvider.COMPLETION_QUERY_TYPE;
+import org.netbeans.spi.editor.completion.CompletionResultSet;
+import org.netbeans.spi.editor.completion.CompletionTask;
+import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery;
+import org.netbeans.spi.editor.completion.support.AsyncCompletionTask;
+import org.openide.filesystems.FileObject;
+
+@MimeRegistration(mimeType = ExceptionClassNbDebugEditorKit.MIME_TYPE, service = CompletionProvider.class)
+public class ExceptionCompletionProvider implements CompletionProvider {
+
+    private static final Logger LOG = Logger.getLogger(ExceptionCompletionProvider.class.getName());
+
+    private final Set<String> builtinErrors = new HashSet<>(Arrays.asList("Deprecated","Notice", "Warning")); // NOI18N
+
+    @Override
+    public CompletionTask createTask(int queryType, JTextComponent component) {
+        if (queryType != CompletionProvider.COMPLETION_QUERY_TYPE) {
+            return null;
+        }
+
+        return new AsyncCompletionTask(new AsyncCompletionQuery() {
+            @Override
+            protected void query(CompletionResultSet resultSet, Document doc, int caretOffset) {
+                if (caretOffset < 0) {
+                    caretOffset = 0;
+                }
+                String text;
+                try {
+                    text = doc.getText(0, caretOffset);
+                } catch (BadLocationException ex) {
+                    LOG.log(Level.WARNING, "Invalid offset: {0}", ex.offsetRequested());

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#issuecomment-1700319853

   Merging.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300941352


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+    private static final String EMPTY_EXCEPTION_NAME = "LBL_EmptyExceptionName"; // NOI18N
+
+    private final JEditorPane epClassName;
+    private final JScrollPane spClassName;
+
+    public DbgpExceptionBreakpointPanel() {
+        initComponents();
+        Pair<JScrollPane, JEditorPane> editorCC = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, jPanel2, "", "");
+        spClassName = editorCC.first();
+        epClassName = editorCC.second();
+        epClassName.getAccessibleContext().setAccessibleName("pane");
+        epClassName.getAccessibleContext().setAccessibleDescription("pane");

Review Comment:
   `// NOI18N`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300933734


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/DbgpExceptionBreakpointType.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.breakpoints;
+
+import javax.swing.JComponent;
+import javax.swing.text.JTextComponent;
+import org.netbeans.api.editor.EditorRegistry;
+import org.netbeans.modules.editor.NbEditorUtilities;
+import org.netbeans.modules.php.api.util.FileUtils;
+
+import org.netbeans.modules.php.dbgp.ui.DbgpExceptionBreakpointPanel;
+import org.netbeans.spi.debugger.ui.BreakpointType;
+import org.openide.filesystems.FileObject;
+import org.openide.util.NbBundle;
+
+public class DbgpExceptionBreakpointType extends BreakpointType {
+    private static final String PHP_BREAKPOINT_TYPE = "LBL_PhpType"; // NOI18N
+    private static final String METHOD_TYPE = "LBL_ExceptionBreakpointType"; // NOI18N
+
+    @Override
+    public String getCategoryDisplayName() {
+        return NbBundle.getMessage(DbgpExceptionBreakpointType.class,

Review Comment:
   Prefer `@NbBundle.Messages("")`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300918484


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java:
##########
@@ -74,6 +75,12 @@ public String getDisplayName(Object node) throws UnknownTypeException {
             builder.append(breakpoint.getFunction());
             builder.append(PARENS);
             return builder.toString();
+        } else if (node instanceof ExceptionBreakpoint) {
+            ExceptionBreakpoint breakpoint = (ExceptionBreakpoint) node;
+            StringBuilder builder = new StringBuilder(NbBundle.getMessage(BreakpointModel.class, EXCEPTION));
+            builder.append(" ");

Review Comment:
   `// NOI18N`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1301353033


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/completion/ExceptionCompletionProvider.java:
##########
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui.completion;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.JTextComponent;
+import org.netbeans.api.editor.mimelookup.MimeRegistration;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ui.OpenProjects;
+import org.netbeans.modules.csl.spi.support.CancelSupport;
+import org.netbeans.modules.parsing.spi.indexing.support.QuerySupport.Kind;
+import org.netbeans.modules.php.api.phpmodule.PhpModule;
+import org.netbeans.modules.php.editor.api.ElementQuery;
+import org.netbeans.modules.php.editor.api.ElementQueryFactory;
+import org.netbeans.modules.php.editor.api.NameKind;
+import org.netbeans.modules.php.editor.api.QuerySupportFactory;
+import org.netbeans.modules.php.editor.api.elements.ClassElement;
+import org.netbeans.spi.editor.completion.CompletionProvider;
+import static org.netbeans.spi.editor.completion.CompletionProvider.COMPLETION_QUERY_TYPE;
+import org.netbeans.spi.editor.completion.CompletionResultSet;
+import org.netbeans.spi.editor.completion.CompletionTask;
+import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery;
+import org.netbeans.spi.editor.completion.support.AsyncCompletionTask;
+import org.openide.filesystems.FileObject;
+import org.openide.util.Exceptions;
+
+@MimeRegistration(mimeType = ExceptionClassNbDebugEditorKit.MIME_TYPE, service = CompletionProvider.class)
+public class ExceptionCompletionProvider implements CompletionProvider {
+
+    private static final Logger LOG = Logger.getLogger(ExceptionCompletionProvider.class.getName());
+
+    private final Set<String> builtinErrors = new HashSet<>(Arrays.asList("Deprecated","Notice", "Warning")); // NOI18N
+
+    @Override
+    public CompletionTask createTask(int queryType, JTextComponent component) {
+        if (queryType != CompletionProvider.COMPLETION_QUERY_TYPE) {
+            return null;
+        }
+
+        return new AsyncCompletionTask(new AsyncCompletionQuery() {
+            @Override
+            protected void query(CompletionResultSet resultSet, Document doc, int caretOffset) {
+                if (caretOffset < 0) {
+                    caretOffset = 0;
+                }
+                String text;
+                try {
+                    text = doc.getText(0, caretOffset);
+                } catch (BadLocationException ex) {
+                    Exceptions.printStackTrace(ex);
+                    text = "";

Review Comment:
   `// NOI18N`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] troizet commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1306613924


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointsReader.java:
##########
@@ -34,14 +34,16 @@ public class BreakpointsReader implements Properties.Reader {
 
     private static final String ENABED = "enabled"; // NOI18N
     private static final String FUNC_NAME = "functionName"; // NOI18N
+    private static final String EXCEPTION_NAME = "exceptionName"; // NOI18N
     private static final String TYPE = "type"; // NOI18N
     private static final String GROUP_NAME = "groupName"; // NOI18N
 
     @Override
     public String[] getSupportedClassNames() {
         return new String[]{
             LineBreakpoint.class.getName(),
-            FunctionBreakpoint.class.getName()
+            FunctionBreakpoint.class.getName(),
+            ExceptionBreakpoint.class.getName()

Review Comment:
   I can't remove the `getSupportedClassNames` method as it is an implementation of the `org.netbeans.api.debugger.Properties.Reader` interface. Did as @junichi11  suggested.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300940822


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+    private static final String EMPTY_EXCEPTION_NAME = "LBL_EmptyExceptionName"; // NOI18N
+
+    private final JEditorPane epClassName;
+    private final JScrollPane spClassName;
+
+    public DbgpExceptionBreakpointPanel() {
+        initComponents();
+        Pair<JScrollPane, JEditorPane> editorCC = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, jPanel2, "", "");

Review Comment:
   `editorCC`: What does `CC` mean? CodeCompletion?
   ```suggestion
           Pair<JScrollPane, JEditorPane> codeCompletionEditor = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, jPanel2, "", "");
   ```
   Please change `jPanel2` to the proper name. `// NOI18N`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1301374362


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointsReader.java:
##########
@@ -34,14 +34,16 @@ public class BreakpointsReader implements Properties.Reader {
 
     private static final String ENABED = "enabled"; // NOI18N

Review Comment:
   Although it is not your change, I would change the name.
   ```suggestion
       private static final String ENABELED = "enabled"; // NOI18N
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300921481


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointRuntimeSetter.java:
##########
@@ -66,7 +66,12 @@ public void propertyChange(PropertyChangeEvent event) {
             return;
         }
         Object source = event.getSource();
-        performCommand((Breakpoint) source, Lazy.UPDATE_COMMAND);
+
+        if (((Breakpoint)source).isEnabled()) {

Review Comment:
   Formatting



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1308107545


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+@NbBundle.Messages({
+    "DbgpExceptionBreakpointPanel.EmptyExceptionName=Please enter non-empty exception name.",
+})
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+
+    private final JEditorPane classNameEditorPane;
+    private final JScrollPane classNameScrollPane;
+
+    public DbgpExceptionBreakpointPanel() {
+        initComponents();
+        Pair<JScrollPane, JEditorPane> codeCompletionEditor = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, classNameEditorPanel, "", ""); // NOI18N
+        classNameScrollPane = codeCompletionEditor.first();
+        classNameEditorPane = codeCompletionEditor.second();
+        classNameEditorPane.getAccessibleContext().setAccessibleName("class name editor pane"); // NOI18N
+        classNameEditorPane.getAccessibleContext().setAccessibleDescription("class name editor pane for exception name"); // NOI18N
+        exceptionLabel.setLabelFor(classNameScrollPane);
+    }
+
+    @Override
+    public boolean cancel() {
+        return true;
+    }
+
+    @Override
+    public boolean ok() {
+        String exceptionName = classNameEditorPane.getText();
+        if (exceptionName == null || exceptionName.trim().length() == 0) {
+            String msg = Bundle.DbgpExceptionBreakpointPanel_EmptyExceptionName();
+            NotifyDescriptor descr = new NotifyDescriptor.Message(msg);
+            DialogDisplayer.getDefault().notify(descr);
+            return false;
+        }
+        ExceptionBreakpoint breakpoint = new ExceptionBreakpoint(exceptionName);
+        DebuggerManager.getDebuggerManager().addBreakpoint(breakpoint);
+        return true;
+    }
+
+    static Pair<JScrollPane, JEditorPane> addClassNameEditorCC(String mimeType, JComponent comp, String className, String tooltipText) {
+        JComponent [] editorComponents = Utilities.createSingleLineEditor(mimeType);
+        JScrollPane scrollPane = (JScrollPane) editorComponents[0];
+        JEditorPane editorPane = (JEditorPane) editorComponents[1];
+        editorPane.setText(className);
+        if (comp != null) {
+            java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
+            gridBagConstraints.gridx = 1;
+            gridBagConstraints.gridy = 0;
+            gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
+            gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+            gridBagConstraints.anchor = java.awt.GridBagConstraints.BASELINE;
+            gridBagConstraints.weightx = 1.0;
+            gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
+            comp.add(scrollPane, gridBagConstraints);
+        }
+        scrollPane.setToolTipText(tooltipText);
+        editorPane.setToolTipText(tooltipText);
+        return Pair.<JScrollPane, JEditorPane>of(scrollPane, editorPane);
+    }

Review Comment:
   ```suggestion
       private Pair<JScrollPane, JEditorPane> createCodeCompletionEditor() {
           JComponent [] editorComponents = Utilities.createSingleLineEditor(ExceptionClassNbDebugEditorKit.MIME_TYPE);
           JScrollPane scrollPane = (JScrollPane) editorComponents[0];
           JEditorPane editorPane = (JEditorPane) editorComponents[1];
           initClassNameEditorPanel(scrollPane);
           editorPane.setText(""); // NOI18N
           scrollPane.setToolTipText(""); // NOI18N
           editorPane.setToolTipText(""); // NOI18N
           return Pair.<JScrollPane, JEditorPane>of(scrollPane, editorPane);
       }
       
       private void initClassNameEditorPanel(JScrollPane scrollPane) {
           java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
           gridBagConstraints.gridx = 1;
           gridBagConstraints.gridy = 0;
           gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
           gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
           gridBagConstraints.anchor = java.awt.GridBagConstraints.BASELINE;
           gridBagConstraints.weightx = 1.0;
           gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
           classNameEditorPanel.add(scrollPane, gridBagConstraints);    
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#issuecomment-1696646569

   Please add image files to the `licenseinfo.xml`. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1301355664


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/completion/ExceptionCompletionProvider.java:
##########
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui.completion;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.JTextComponent;
+import org.netbeans.api.editor.mimelookup.MimeRegistration;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ui.OpenProjects;
+import org.netbeans.modules.csl.spi.support.CancelSupport;
+import org.netbeans.modules.parsing.spi.indexing.support.QuerySupport.Kind;
+import org.netbeans.modules.php.api.phpmodule.PhpModule;
+import org.netbeans.modules.php.editor.api.ElementQuery;
+import org.netbeans.modules.php.editor.api.ElementQueryFactory;
+import org.netbeans.modules.php.editor.api.NameKind;
+import org.netbeans.modules.php.editor.api.QuerySupportFactory;
+import org.netbeans.modules.php.editor.api.elements.ClassElement;
+import org.netbeans.spi.editor.completion.CompletionProvider;
+import static org.netbeans.spi.editor.completion.CompletionProvider.COMPLETION_QUERY_TYPE;
+import org.netbeans.spi.editor.completion.CompletionResultSet;
+import org.netbeans.spi.editor.completion.CompletionTask;
+import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery;
+import org.netbeans.spi.editor.completion.support.AsyncCompletionTask;
+import org.openide.filesystems.FileObject;
+import org.openide.util.Exceptions;
+
+@MimeRegistration(mimeType = ExceptionClassNbDebugEditorKit.MIME_TYPE, service = CompletionProvider.class)
+public class ExceptionCompletionProvider implements CompletionProvider {
+
+    private static final Logger LOG = Logger.getLogger(ExceptionCompletionProvider.class.getName());
+
+    private final Set<String> builtinErrors = new HashSet<>(Arrays.asList("Deprecated","Notice", "Warning")); // NOI18N
+
+    @Override
+    public CompletionTask createTask(int queryType, JTextComponent component) {
+        if (queryType != CompletionProvider.COMPLETION_QUERY_TYPE) {
+            return null;
+        }
+
+        return new AsyncCompletionTask(new AsyncCompletionQuery() {
+            @Override
+            protected void query(CompletionResultSet resultSet, Document doc, int caretOffset) {
+                if (caretOffset < 0) {
+                    caretOffset = 0;
+                }
+                String text;
+                try {
+                    text = doc.getText(0, caretOffset);
+                } catch (BadLocationException ex) {
+                    Exceptions.printStackTrace(ex);

Review Comment:
   Instead, I would add a log.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1302730433


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+    private static final String EMPTY_EXCEPTION_NAME = "LBL_EmptyExceptionName"; // NOI18N
+
+    private final JEditorPane epClassName;
+    private final JScrollPane spClassName;
+
+    public DbgpExceptionBreakpointPanel() {
+        initComponents();
+        Pair<JScrollPane, JEditorPane> editorCC = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, jPanel2, "", "");
+        spClassName = editorCC.first();
+        epClassName = editorCC.second();
+        epClassName.getAccessibleContext().setAccessibleName("pane");
+        epClassName.getAccessibleContext().setAccessibleDescription("pane");

Review Comment:
   Well, these are not friendly accessible descriptions, right...?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1302729566


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+    private static final String EMPTY_EXCEPTION_NAME = "LBL_EmptyExceptionName"; // NOI18N
+
+    private final JEditorPane epClassName;
+    private final JScrollPane spClassName;
+
+    public DbgpExceptionBreakpointPanel() {
+        initComponents();
+        Pair<JScrollPane, JEditorPane> editorCC = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, jPanel2, "", "");

Review Comment:
   Yes, please, try to avoid any shortcut names for variables :) Thanks!
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] troizet commented on pull request #6366: PHP: Added support for exception breakpoints.

Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#issuecomment-1694592723

   @junichi11, @tmysik has corrected the shortcomings you pointed out. Thank you very much for the review!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300945836


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+    private static final String EMPTY_EXCEPTION_NAME = "LBL_EmptyExceptionName"; // NOI18N
+
+    private final JEditorPane epClassName;
+    private final JScrollPane spClassName;
+
+    public DbgpExceptionBreakpointPanel() {
+        initComponents();
+        Pair<JScrollPane, JEditorPane> editorCC = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, jPanel2, "", "");
+        spClassName = editorCC.first();
+        epClassName = editorCC.second();
+        epClassName.getAccessibleContext().setAccessibleName("pane");
+        epClassName.getAccessibleContext().setAccessibleDescription("pane");
+        ExceptionLbl.setLabelFor(spClassName);
+    }
+
+    @Override
+    public boolean cancel() {
+        return true;
+    }
+
+    @Override
+    public boolean ok() {
+        String exceptionName = epClassName.getText();
+        if (exceptionName == null || exceptionName.trim().length() == 0) {
+            String msg = NbBundle.getMessage(DbgpExceptionBreakpointPanel.class, EMPTY_EXCEPTION_NAME);
+            NotifyDescriptor descr = new NotifyDescriptor.Message(msg);
+            DialogDisplayer.getDefault().notify(descr);
+            return false;
+        }
+        ExceptionBreakpoint breakpoint = new ExceptionBreakpoint(exceptionName);
+        DebuggerManager.getDebuggerManager().addBreakpoint(breakpoint);
+        return true;
+    }
+
+    static Pair<JScrollPane, JEditorPane> addClassNameEditorCC(String mimeType, JComponent comp, String className, String tooltipText) {
+        JComponent [] editorComponents = Utilities.createSingleLineEditor(mimeType);
+        JScrollPane sle = (JScrollPane) editorComponents[0];

Review Comment:
   Please rename `sle` to proper name.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300944577


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+    private static final String EMPTY_EXCEPTION_NAME = "LBL_EmptyExceptionName"; // NOI18N
+
+    private final JEditorPane epClassName;
+    private final JScrollPane spClassName;
+
+    public DbgpExceptionBreakpointPanel() {
+        initComponents();
+        Pair<JScrollPane, JEditorPane> editorCC = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, jPanel2, "", "");
+        spClassName = editorCC.first();
+        epClassName = editorCC.second();
+        epClassName.getAccessibleContext().setAccessibleName("pane");
+        epClassName.getAccessibleContext().setAccessibleDescription("pane");
+        ExceptionLbl.setLabelFor(spClassName);
+    }
+
+    @Override
+    public boolean cancel() {
+        return true;
+    }
+
+    @Override
+    public boolean ok() {
+        String exceptionName = epClassName.getText();
+        if (exceptionName == null || exceptionName.trim().length() == 0) {
+            String msg = NbBundle.getMessage(DbgpExceptionBreakpointPanel.class, EMPTY_EXCEPTION_NAME);

Review Comment:
   Prefer @NbBundle.Messages("")



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300933734


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/DbgpExceptionBreakpointType.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.breakpoints;
+
+import javax.swing.JComponent;
+import javax.swing.text.JTextComponent;
+import org.netbeans.api.editor.EditorRegistry;
+import org.netbeans.modules.editor.NbEditorUtilities;
+import org.netbeans.modules.php.api.util.FileUtils;
+
+import org.netbeans.modules.php.dbgp.ui.DbgpExceptionBreakpointPanel;
+import org.netbeans.spi.debugger.ui.BreakpointType;
+import org.openide.filesystems.FileObject;
+import org.openide.util.NbBundle;
+
+public class DbgpExceptionBreakpointType extends BreakpointType {
+    private static final String PHP_BREAKPOINT_TYPE = "LBL_PhpType"; // NOI18N
+    private static final String METHOD_TYPE = "LBL_ExceptionBreakpointType"; // NOI18N
+
+    @Override
+    public String getCategoryDisplayName() {
+        return NbBundle.getMessage(DbgpExceptionBreakpointType.class,

Review Comment:
   Prefer `@NbBundle.Messages("")`
   
   `Bundle("...");`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1302770953


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java:
##########
@@ -119,15 +126,25 @@ public String getShortDescription(Object node) throws UnknownTypeException {
 
     public void setCurrentStack(Stack stack, DebugSession session) {
         if (stack == null) {
-            synchronized (myCurrentBreakpoints) {
-                AbstractBreakpoint breakpoint = myCurrentBreakpoints.remove(session);
-                fireChangeEvent(new ModelEvent.NodeChanged(this, breakpoint));
-            }
+            removeCurrentBreakpoint(session);

Review Comment:
   Nitpick: This line can be moved inside the `synchronized` block above (it uses the same lock, so it would avoid the situation where we get the lock, release the lock and get the lock again).
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300928928


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointsReader.java:
##########
@@ -34,14 +34,16 @@ public class BreakpointsReader implements Properties.Reader {
 
     private static final String ENABED = "enabled"; // NOI18N
     private static final String FUNC_NAME = "functionName"; // NOI18N
+    private static final String EXCEPTION_NAME = "exceptionName"; // NOI18N
     private static final String TYPE = "type"; // NOI18N
     private static final String GROUP_NAME = "groupName"; // NOI18N
 
     @Override
     public String[] getSupportedClassNames() {
         return new String[]{
             LineBreakpoint.class.getName(),
-            FunctionBreakpoint.class.getName()
+            FunctionBreakpoint.class.getName(),
+            ExceptionBreakpoint.class.getName()

Review Comment:
   Maybe, should move to a field?
   e.g. 
   ```java
   private static final String[] SUPPORTED_CLASS_NAMES = ...;
   
   public String[] getSupportedClassNames() {
           return SUPPORTED_CLASS_NAMES;
   }    
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300946355


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+    private static final String EMPTY_EXCEPTION_NAME = "LBL_EmptyExceptionName"; // NOI18N
+
+    private final JEditorPane epClassName;
+    private final JScrollPane spClassName;
+
+    public DbgpExceptionBreakpointPanel() {
+        initComponents();
+        Pair<JScrollPane, JEditorPane> editorCC = addClassNameEditorCC(ExceptionClassNbDebugEditorKit.MIME_TYPE, jPanel2, "", "");
+        spClassName = editorCC.first();
+        epClassName = editorCC.second();
+        epClassName.getAccessibleContext().setAccessibleName("pane");
+        epClassName.getAccessibleContext().setAccessibleDescription("pane");
+        ExceptionLbl.setLabelFor(spClassName);
+    }
+
+    @Override
+    public boolean cancel() {
+        return true;
+    }
+
+    @Override
+    public boolean ok() {
+        String exceptionName = epClassName.getText();
+        if (exceptionName == null || exceptionName.trim().length() == 0) {
+            String msg = NbBundle.getMessage(DbgpExceptionBreakpointPanel.class, EMPTY_EXCEPTION_NAME);
+            NotifyDescriptor descr = new NotifyDescriptor.Message(msg);
+            DialogDisplayer.getDefault().notify(descr);
+            return false;
+        }
+        ExceptionBreakpoint breakpoint = new ExceptionBreakpoint(exceptionName);
+        DebuggerManager.getDebuggerManager().addBreakpoint(breakpoint);
+        return true;
+    }
+
+    static Pair<JScrollPane, JEditorPane> addClassNameEditorCC(String mimeType, JComponent comp, String className, String tooltipText) {
+        JComponent [] editorComponents = Utilities.createSingleLineEditor(mimeType);
+        JScrollPane sle = (JScrollPane) editorComponents[0];
+        JEditorPane epClassName = (JEditorPane) editorComponents[1];
+        epClassName.setText(className);
+        if (comp != null) {
+            java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
+            gridBagConstraints.gridx = 1;
+            gridBagConstraints.gridy = 0;
+            gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
+            gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+            gridBagConstraints.anchor = java.awt.GridBagConstraints.BASELINE;
+            gridBagConstraints.weightx = 1.0;
+            gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
+            comp.add(sle, gridBagConstraints);
+        }
+        sle.setToolTipText(tooltipText);
+        epClassName.setToolTipText(tooltipText);
+        return Pair.<JScrollPane, JEditorPane>of(sle, epClassName);
+    }
+
+    /**
+     * This method is called from within the constructor to initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is always
+     * regenerated by the Form Editor.
+     */
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+    private void initComponents() {
+        java.awt.GridBagConstraints gridBagConstraints;
+
+        jPanel2 = new javax.swing.JPanel();
+        ExceptionLbl = new javax.swing.JLabel();
+
+        setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(DbgpExceptionBreakpointPanel.class, "LBL_Settings"))); // NOI18N
+
+        jPanel2.setLayout(new java.awt.GridBagLayout());
+
+        org.openide.awt.Mnemonics.setLocalizedText(ExceptionLbl, org.openide.util.NbBundle.getMessage(DbgpExceptionBreakpointPanel.class, "LBL_ExceptionName")); // NOI18N
+        ExceptionLbl.setVerticalAlignment(javax.swing.SwingConstants.TOP);
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
+        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
+        jPanel2.add(ExceptionLbl, gridBagConstraints);
+        ExceptionLbl.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(DbgpExceptionBreakpointPanel.class, "DbgpExceptionBreakpointPanel.ExceptionLbl.AccessibleContext.accessibleName")); // NOI18N
+        ExceptionLbl.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(DbgpExceptionBreakpointPanel.class, "DbgpExceptionBreakpointPanel.ExceptionLbl.AccessibleContext.accessibleDescription")); // NOI18N
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 361, Short.MAX_VALUE)
+                .addContainerGap())
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
+        );
+
+        jPanel2.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(DbgpExceptionBreakpointPanel.class, "A11_SettingsName")); // NOI18N
+
+        getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(DbgpExceptionBreakpointPanel.class, "A11_SettingsName")); // NOI18N
+    }// </editor-fold>//GEN-END:initComponents
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JLabel ExceptionLbl;

Review Comment:
   ```suggestion
       private javax.swing.JLabel exceptionLabel;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1306614393


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointsReader.java:
##########
@@ -34,14 +34,16 @@ public class BreakpointsReader implements Properties.Reader {
 
     private static final String ENABED = "enabled"; // NOI18N
     private static final String FUNC_NAME = "functionName"; // NOI18N
+    private static final String EXCEPTION_NAME = "exceptionName"; // NOI18N
     private static final String TYPE = "type"; // NOI18N
     private static final String GROUP_NAME = "groupName"; // NOI18N
 
     @Override
     public String[] getSupportedClassNames() {
         return new String[]{
             LineBreakpoint.class.getName(),
-            FunctionBreakpoint.class.getName()
+            FunctionBreakpoint.class.getName(),
+            ExceptionBreakpoint.class.getName()

Review Comment:
   I see. In such a case, please add `@Override` annotation. Thanks!
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300938985


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpExceptionBreakpointPanel.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.editor.Utilities;
+import org.netbeans.modules.php.dbgp.breakpoints.ExceptionBreakpoint;
+import org.netbeans.modules.php.dbgp.ui.completion.ExceptionClassNbDebugEditorKit;
+import org.netbeans.spi.debugger.ui.Controller;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.NbBundle;
+import org.openide.util.Pair;
+
+public class DbgpExceptionBreakpointPanel extends JPanel implements Controller {
+    private static final long serialVersionUID = 4967178020173186468L;
+    private static final String EMPTY_EXCEPTION_NAME = "LBL_EmptyExceptionName"; // NOI18N
+
+    private final JEditorPane epClassName;
+    private final JScrollPane spClassName;

Review Comment:
   ```suggestion
       private final JEditorPane classNameEditorPane;
       private final JScrollPane classNameScrollPane;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1300933734


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/DbgpExceptionBreakpointType.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.dbgp.breakpoints;
+
+import javax.swing.JComponent;
+import javax.swing.text.JTextComponent;
+import org.netbeans.api.editor.EditorRegistry;
+import org.netbeans.modules.editor.NbEditorUtilities;
+import org.netbeans.modules.php.api.util.FileUtils;
+
+import org.netbeans.modules.php.dbgp.ui.DbgpExceptionBreakpointPanel;
+import org.netbeans.spi.debugger.ui.BreakpointType;
+import org.openide.filesystems.FileObject;
+import org.openide.util.NbBundle;
+
+public class DbgpExceptionBreakpointType extends BreakpointType {
+    private static final String PHP_BREAKPOINT_TYPE = "LBL_PhpType"; // NOI18N
+    private static final String METHOD_TYPE = "LBL_ExceptionBreakpointType"; // NOI18N
+
+    @Override
+    public String getCategoryDisplayName() {
+        return NbBundle.getMessage(DbgpExceptionBreakpointType.class,

Review Comment:
   Prefer `@NbBundle.Messages("...")`
   
   `Bundle("...");`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1302727843


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointsReader.java:
##########
@@ -34,14 +34,16 @@ public class BreakpointsReader implements Properties.Reader {
 
     private static final String ENABED = "enabled"; // NOI18N
     private static final String FUNC_NAME = "functionName"; // NOI18N
+    private static final String EXCEPTION_NAME = "exceptionName"; // NOI18N
     private static final String TYPE = "type"; // NOI18N
     private static final String GROUP_NAME = "groupName"; // NOI18N
 
     @Override
     public String[] getSupportedClassNames() {
         return new String[]{
             LineBreakpoint.class.getName(),
-            FunctionBreakpoint.class.getName()
+            FunctionBreakpoint.class.getName(),
+            ExceptionBreakpoint.class.getName()

Review Comment:
   Or remove it and make `SUPPORTED_CLASS_NAMES` `public`?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a diff in pull request #6366: PHP: Added support for exception breakpoints.

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#discussion_r1302731847


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointsReader.java:
##########
@@ -34,14 +34,16 @@ public class BreakpointsReader implements Properties.Reader {
 
     private static final String ENABED = "enabled"; // NOI18N

Review Comment:
   Yes, please. Thanks.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] PHP: Added support for exception breakpoints. [netbeans]

Posted by "ErikKrause (via GitHub)" <gi...@apache.org>.
ErikKrause commented on PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#issuecomment-1856646702

   Many thanks for this useful addition! However, how would I see the cause of (f.e) a warning, once the breakpoint is hit?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] PHP: Added support for exception breakpoints. [netbeans]

Posted by "ErikKrause (via GitHub)" <gi...@apache.org>.
ErikKrause commented on PR #6366:
URL: https://github.com/apache/netbeans/pull/6366#issuecomment-1857788064

   That's a pity. Is this planned?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists