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

geertjan 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 6d33c20  Removing delay after launch Project action terminates.
     new e076145  Merge pull request #2754 from 
sdedic/lsp/bugfix/after-run-delay
6d33c20 is described below

commit 6d33c2069e4e4f77e2ea08ec4a8f4982e7963f35
Author: Svata Dedic <svatopluk.de...@oracle.com>
AuthorDate: Wed Feb 10 15:24:11 2021 +0100

    Removing delay after launch Project action terminates.
---
 .../debugging/launch/NbLaunchRequestHandler.java     | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchRequestHandler.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchRequestHandler.java
index bebc49f..66ab8d9 100644
--- 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchRequestHandler.java
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchRequestHandler.java
@@ -27,9 +27,6 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
 import java.util.function.Consumer;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -54,7 +51,6 @@ import org.openide.util.Utilities;
 public final class NbLaunchRequestHandler {
 
     private NbLaunchDelegate activeLaunchHandler;
-    private final CompletableFuture<Boolean> waitForDebuggeeConsole = new 
CompletableFuture<>();
 
     public CompletableFuture<Void> launch(Map<String, Object> launchArguments, 
DebugAdapterContext context) {
         CompletableFuture<Void> resultFuture = new CompletableFuture<>();
@@ -174,14 +170,9 @@ public final class NbLaunchRequestHandler {
     }
 
     protected void handleTerminatedEvent(DebugAdapterContext context) {
-        CompletableFuture.runAsync(() -> {
-            try {
-                waitForDebuggeeConsole.get(1, TimeUnit.SECONDS);
-            } catch (InterruptedException | ExecutionException | 
TimeoutException e) {
-                // do nothing.
-            }
-            context.getClient().terminated(new TerminatedEventArguments());
-        });
+        // Project Action has already closed the I/O streams, and even in 
NetBeans IDE, the output area
+        // is already inactive at this point.
+        context.getClient().terminated(new TerminatedEventArguments());
     }
 
     private final class OutputListener implements 
Consumer<NbProcessConsole.ConsoleMessage> {
@@ -194,10 +185,7 @@ public final class NbLaunchRequestHandler {
 
         @Override
         public void accept(NbProcessConsole.ConsoleMessage message) {
-            if (message == null) {
-                // EOF
-                waitForDebuggeeConsole.complete(true);
-            } else {
+            if (message != null) {
                 OutputEventArguments outputEvent = 
convertToOutputEventArguments(message.output, message.category, context);
                 context.getClient().output(outputEvent);
             }


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