You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by ju...@apache.org on 2020/08/01 11:40:34 UTC

[netbeans] branch master updated: [NETBEANS-4604] PHP - instant rename of private constant

This is an automated email from the ASF dual-hosted git repository.

junichi11 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 24f5a52  [NETBEANS-4604] PHP - instant rename of private constant
     new d671f96  Merge pull request #2263 from KacerCZ/netbeans-4604-const-instant-rename
24f5a52 is described below

commit 24f5a5293d80a8ddd7991c66dcf2c4d0e7a83716
Author: Tomas Prochazka <ka...@razdva.cz>
AuthorDate: Sat Jul 18 12:54:32 2020 +0200

    [NETBEANS-4604] PHP - instant rename of private constant
    
    https://issues.apache.org/jira/browse/NETBEANS-4604
    
    Adds ability to rename private constant without displaying Rename dialog.
---
 .../org/netbeans/modules/php/editor/csl/InstantRenamerImpl.java    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/csl/InstantRenamerImpl.java b/php/php.editor/src/org/netbeans/modules/php/editor/csl/InstantRenamerImpl.java
index c118b8e..f0ee97a 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/csl/InstantRenamerImpl.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/csl/InstantRenamerImpl.java
@@ -31,6 +31,7 @@ import org.netbeans.modules.php.editor.api.PhpModifiers;
 import org.netbeans.modules.php.editor.api.elements.FieldElement;
 import org.netbeans.modules.php.editor.api.elements.MethodElement;
 import org.netbeans.modules.php.editor.api.elements.PhpElement;
+import org.netbeans.modules.php.editor.api.elements.TypeConstantElement;
 import org.netbeans.modules.php.editor.model.Model;
 import org.netbeans.modules.php.editor.model.Occurence;
 import org.netbeans.modules.php.editor.model.Occurence.Accuracy;
@@ -83,6 +84,12 @@ public class InstantRenamerImpl implements InstantRenamer {
                         if (phpModifiers.isPrivate()) {
                             return checkAll(caretOccurence);
                         }
+                    } else if (decl instanceof TypeConstantElement) {
+                        TypeConstantElement cnst = (TypeConstantElement) decl;
+                        PhpModifiers phpModifiers = cnst.getPhpModifiers();
+                        if (phpModifiers.isPrivate()) {
+                            return checkAll(caretOccurence);
+                        }
                     }
                 } else {
                     return checkAll(caretOccurence);


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

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