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

[GitHub] [netbeans] tmysik commented on a diff in pull request #5900: [PHP] FixUsesPerformer and AddUseImportSuggestion improvement

tmysik commented on code in PR #5900:
URL: https://github.com/apache/netbeans/pull/5900#discussion_r1184688675


##########
php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java:
##########
@@ -105,36 +110,56 @@ public FixUsesPerformer(
         this.options = options;
     }
 
-    public void perform() {
+    private void perform(boolean append) {
         final Document document = parserResult.getSnapshot().getSource().getDocument(false);
         if (document instanceof BaseDocument) {
             baseDocument = (BaseDocument) document;
             editList = new EditList(baseDocument);
             namespaceScope = ModelUtils.getNamespaceScope(parserResult.getModel().getFileScope(), importData.caretPosition);
             assert namespaceScope != null;
-            processSelections();
+            processSelections(append);
             editList.apply();
         }
     }
 
+    public void perform()
+    {
+        perform(false);
+    }
+
+    public void performAppend()
+    {
+        assert this.selections.size() == 1;

Review Comment:
   ```suggestion
           assert selections.size() == 1 : "Expected size == 1 but got: " + selections.size();
   ```
   



-- 
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