Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
NetBeans
Apache NetBeans
Commits
e076145d
Unverified
Commit
e076145d
authored
Feb 11, 2021
by
Geertjan Wielenga
Committed by
GitHub
Feb 11, 2021
Browse files
Merge pull request #2754 from sdedic/lsp/bugfix/after-run-delay
Removing delay after launch Project action terminates.
parents
6dd33b46
6d33c206
Changes
1
Hide whitespace changes
Inline
Side-by-side
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchRequestHandler.java
View file @
e076145d
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment