|
| 1 | +diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java |
| 2 | +index 6fe9ece2c0cb..82f5346568d1 100644 |
| 3 | +--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java |
| 4 | ++++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/NbProtocolServer.java |
| 5 | +@@ -81,7 +81,9 @@ |
| 6 | + import org.netbeans.api.debugger.jpda.JPDADebugger; |
| 7 | + import org.netbeans.api.debugger.jpda.ObjectVariable; |
| 8 | + import org.netbeans.api.debugger.jpda.Variable; |
| 9 | ++import org.netbeans.api.project.Project; |
| 10 | + import org.netbeans.modules.debugger.jpda.truffle.vars.TruffleVariable; |
| 11 | ++import org.netbeans.modules.java.lsp.server.LspServerState; |
| 12 | + import org.netbeans.modules.java.lsp.server.LspSession; |
| 13 | + import org.netbeans.modules.java.lsp.server.URITranslator; |
| 14 | + import org.netbeans.modules.java.lsp.server.debugging.breakpoints.NbBreakpointsRequestHandler; |
| 15 | +@@ -165,6 +167,20 @@ public CompletableFuture<Capabilities> initialize(InitializeRequestArguments arg |
| 16 | + caught.setLabel("Caught Exceptions"); |
| 17 | + caps.setExceptionBreakpointFilters(new ExceptionBreakpointsFilter[]{uncaught, caught}); |
| 18 | + caps.setSupportsExceptionInfoRequest(true); |
| 19 | ++ |
| 20 | ++ LspServerState lspServerState = context.getLspSession().getLookup().lookup(LspServerState.class); |
| 21 | ++ if (lspServerState != null) { |
| 22 | ++ CompletableFuture<Project[]> initDone = lspServerState.openedProjects(); |
| 23 | ++ if (!initDone.isDone()) { |
| 24 | ++ LOGGER.log(Level.INFO, "Waiting on LS protocol server {0} to finish initialization", lspServerState); |
| 25 | ++ return lspServerState.openedProjects().thenApply(prjs -> { |
| 26 | ++ LOGGER.log(Level.FINE, "LS protocol server {0} initialized, DAP init complete", lspServerState); |
| 27 | ++ return caps; |
| 28 | ++ }); |
| 29 | ++ } else { |
| 30 | ++ LOGGER.log(Level.FINE, "LS protocol server {0} ready", lspServerState); |
| 31 | ++ } |
| 32 | ++ } |
| 33 | + return CompletableFuture.completedFuture(caps); |
| 34 | + } |
| 35 | + |
| 36 | +diff --git a/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java b/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java |
| 37 | +index 81a7feb329f2..c1d60f9c4b71 100644 |
| 38 | +--- a/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java |
| 39 | ++++ b/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java |
| 40 | +@@ -37,6 +37,7 @@ |
| 41 | + import java.util.Map; |
| 42 | + import java.util.UUID; |
| 43 | + import java.util.concurrent.ExecutionException; |
| 44 | ++import java.util.concurrent.atomic.AtomicInteger; |
| 45 | + import java.util.function.Consumer; |
| 46 | + import java.util.logging.Level; |
| 47 | + import java.util.logging.Logger; |
| 48 | +@@ -128,6 +129,12 @@ public class MavenCommandLineExecutor extends AbstractMavenExecutor { |
| 49 | + private String processUUID; |
| 50 | + private Process preProcess; |
| 51 | + private String preProcessUUID; |
| 52 | ++ |
| 53 | ++ /** |
| 54 | ++ * Diagnostics: stracktrace that shows what code requested the execution. |
| 55 | ++ */ |
| 56 | ++ private final Throwable trace; |
| 57 | ++ |
| 58 | + private static final SpecificationVersion VER18 = new SpecificationVersion("1.8"); //NOI18N |
| 59 | + private static final Logger LOGGER = Logger.getLogger(MavenCommandLineExecutor.class.getName()); |
| 60 | + |
| 61 | +@@ -191,6 +198,11 @@ public ExecutorTask execute(RunConfig config, InputOutput io, TabContext tc) { |
| 62 | + public MavenCommandLineExecutor(RunConfig conf, InputOutput io, TabContext tc) { |
| 63 | + super(conf, tc); |
| 64 | + this.io = io; |
| 65 | ++ if (LOGGER.isLoggable(Level.FINER)) { |
| 66 | ++ this.trace = new Throwable(); |
| 67 | ++ } else { |
| 68 | ++ this.trace = null; |
| 69 | ++ } |
| 70 | + } |
| 71 | + |
| 72 | + /** |
| 73 | +@@ -331,6 +343,8 @@ public void actionPerformed(ActionEvent e) { |
| 74 | + // ioput.getOut().println(key + ":" + env.get(key)); |
| 75 | + // } |
| 76 | + ProcessBuilder builder = constructBuilder(clonedConfig, ioput); |
| 77 | ++ LOGGER.log(Level.FINER, "Executing process {0} from {1}", new Object[] { builder.command(), this }); |
| 78 | ++ LOGGER.log(Level.FINER, "Origin:", this.trace); |
| 79 | + printCoSWarning(clonedConfig, ioput); |
| 80 | + processUUID = UUID.randomUUID().toString(); |
| 81 | + builder.environment().put(KEY_UUID, processUUID); |
| 82 | +@@ -348,6 +362,7 @@ public void actionPerformed(ActionEvent e) { |
| 83 | + throw death; |
| 84 | + } finally { |
| 85 | + BuildExecutionSupport.registerFinishedItem(item); |
| 86 | ++ LOGGER.log(Level.FINER, "Execution of {0} terminated", this ); |
| 87 | + |
| 88 | + try { //defend against badly written extensions.. |
| 89 | + out.buildFinished(); |
0 commit comments