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

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


The following commit(s) were added to refs/heads/delivery by this push:
     new 46b0623  [NETBEANS-6114] Restore automatic constructor completion 
functionality.
     new ca388d6  Merge pull request #3290 from mbien/constructor_completion
46b0623 is described below

commit 46b06239fe97fae107ce88b688e38b3141c7b22e
Author: Michael Bien <mbie...@gmail.com>
AuthorDate: Sun Oct 31 10:36:41 2021 +0100

    [NETBEANS-6114] Restore automatic constructor completion functionality.
    
    After successful classtype completion, a new auto-completion should
    appear for constructor selection, without having to press ctrl+space again.
    
    Regression since 12.3
---
 .../lib/editor/codetemplates/CodeTemplateInsertHandler.java       | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/ide/editor.codetemplates/src/org/netbeans/lib/editor/codetemplates/CodeTemplateInsertHandler.java
 
b/ide/editor.codetemplates/src/org/netbeans/lib/editor/codetemplates/CodeTemplateInsertHandler.java
index 87f794a..d902a87 100644
--- 
a/ide/editor.codetemplates/src/org/netbeans/lib/editor/codetemplates/CodeTemplateInsertHandler.java
+++ 
b/ide/editor.codetemplates/src/org/netbeans/lib/editor/codetemplates/CodeTemplateInsertHandler.java
@@ -226,6 +226,10 @@ public final class CodeTemplateInsertHandler implements 
TextRegionManagerListene
         }
         // Insert the template into document
         insertTemplate();
+
+        if (masterParameters.stream().noneMatch(param -> param.isEditable())) {
+            SwingUtilities.invokeLater(Completion.get()::showCompletion);
+        }
     }
 
     void checkInsertTextBuilt() {
@@ -320,7 +324,7 @@ public final class CodeTemplateInsertHandler implements 
TextRegionManagerListene
                 CodeTemplateParameterImpl masterImpl = 
CodeTemplateParameterImpl.get(master);
                 if 
(CodeTemplateParameter.CURSOR_PARAMETER_NAME.equals(master.getName())) {
                     // Add explicit ${cursor} as last into text sync group to 
jump to it by TAB as last param
-                    caretTextRegion = masterImpl.textRegion(); 
+                    caretTextRegion = masterImpl.textRegion();
                 } else {
                     
textSyncGroup.addTextSync(masterImpl.textRegion().textSync());
                 }
@@ -503,7 +507,7 @@ public final class CodeTemplateInsertHandler implements 
TextRegionManagerListene
             }
         }
     }
-    
+
     void release() {
         synchronized (this) {
             if (released) {

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

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

Reply via email to