sdedic commented on code in PR #8000:
URL: https://github.com/apache/netbeans/pull/8000#discussion_r1863375743
##########
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractLspInputOutputProvider.java:
##########
@@ -186,6 +203,9 @@ public void write(char[] cbuf, int off, int len) throws
IOException {
} else {
ctx.stdErr(chunk);
}
+ if (len > 0) {
+ client.writeOutput(new OutputMessage(name, chunk));
Review Comment:
Would it be possible to pass the stdout/err flag into `OutputMessage`
structure ? If the impl later switch to a terminal, it could be possible to
colorize stderr contents.
##########
java/java.lsp.server/vscode/src/extension.ts:
##########
@@ -377,6 +379,15 @@ function getValueAfterPrefix(input: string | undefined,
prefix: string): string
return '';
}
+function getOrCreateOutputChannel(name: string): vscode.OutputChannel {
Review Comment:
I didn't thought about that before (my fault), but `LspIO`'s input is still
bound to IOContext and therefore to the debug terminal of vscode NBLS
extension. The I/O could be (in theory) better, if printed to a Pseudoterminal
(`vscode.window.createTerminal({ pty: pseudoterminalInstance})`) -- stderr
could be colorized and user input can be sent back to NBLS.
##########
java/java.lsp.server/vscode/src/extension.ts:
##########
@@ -1508,6 +1519,23 @@ function doActivateWithJDK(specifiedJDK: string | null,
context: ExtensionContex
decorations.set(decorationType.key, decorationType);
return decorationType.key;
});
+ c.onRequest(WriteOutputRequest.type, param => {
+ const outputChannel = getOrCreateOutputChannel(param.outputName);
+ outputChannel.append(param.message);
+ });
+ c.onRequest(ShowOutputRequest.type, param => {
+ const outputChannel = getOrCreateOutputChannel(param);
+ outputChannel.show();
Review Comment:
I guess this will not change focus to the output, just brings it visible,
rigth ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists