-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Output tab for Task - Gradle Server #536
Comments
Hi, thanks for the feature request. It looks like you are mentioning two things here:
In both cases, yes they are run in the terminal. For the first case, I make the terminal visible so that users can see exceptions and stacktraces thrown by the server if there are any errors. I could potentially improve this, and hide the server terminal, and instead log everything to disk or to the output panel. This is something i'm willing to consider. For the second case, the design of the extension is that Gradle tasks are run as vscode tasks. This is kinda the selling point of the extension: it creates VS Code tasks from the Gradle tasks (so you can, for example, use the "Run Task" command to run gradle tasks). VS Code tasks are run in an integrated terminal. The output panel is meant for displaying simple text (like logs or errors), it cannot for example render color text as it does not support ANSI control characters. So you have to look at it as: extension output vs process output. If I were to redirect output to the output panel, i'm not sure how I would manage the output channels. Does each task have it's own output channel? If so, the user cannot close/remove the channels, so you'll end up with a long list of output channels. Do you want all tasks to output to the same output channel? I think this might get confusing. |
That makes sense, I guess it would make sense for Gradle Tasks to run in a terminal since they would run once I launch the corresponding VSCode task created by the extension. I thought about it and my only real issue was with having the initial Gradle Server output show up as a Terminal instead of in Output because it creates a Terminal as soon as I launch VSCode. Like you said, I think separating the two separate parts here and moving (or offering the option to move) the Gradle Server output to the Output tab while keeping Gradle Task output in the Terminal tab (creating a Terminal when a task is launched) makes the most sense. |
Cool, I'll make it so the "Task - Gradle Server" terminal is hidden by default, but users can show it via a setting 👍 (Somewhat related to #512, where the server shows the wrapper download status.) |
dev notes: i spent a bit of time exploring the API. you can set |
Would using the node APIs and piping output to an Output Channel interfere with how the Gradle Tasks are run? I'm not sure how this would work, I don't have much experience developing VSCode extensions but somewhere near GradleServer.ts:60 would have something like this I'm assuming? let _channel: vscode.OutputChannel;
function getOutputChannel(): vscode.OutputChannel {
if (!_channel) {
_channel = vscode.window.createOutputChannel('Gradle Server');
}
return _channel;
}
const { stdout, stderr } = await exec(getGradleServerCommand(), { cwd });
if(stdout && stdout.length > 0) {
getOutputChannel().appendLine(stdout);
}
if (stderr && stderr.length > 0) {
getOutputChannel().appendLine(stderr);
getOutputChannel().show(true);
}
// INSTEAD OF (DEPENDING ON USER SETTING)
// this.taskExecution = await vscode.tasks.executeTask(task); |
Nop! The output streams of the server are only related to the server itself (like logging or errors). Output streams of the Gradle Tasks are streamed to the client client via gRPC and rendered in the custom integrated terminal: So your example is on the right path, but as the server process is long running, we'd need to use
I'll probably adjust the Java log format to exclude redundant log levels ( |
I've added some initial code with #540 |
I'm happy with #540 now, but this change could "break" things for users who have been relying on setting Gradle/Java ENV vars via |
Sorry for the delay! Released with 3.4.0. Can you update the extension and test this change? Thanks! |
Is your feature request related to a problem? Please describe.
Having the Gradle Server for this extension show up in the Terminal section of the bottom pane is somewhat annoying because I expect that space to be for terminals that I launch and use. Most extensions show their output under the Output tab of the same bottom pane. I believe that supports input too for use cases where the Gradle Task might need console input.
Describe the solution you'd like
It would be nice if the Gradle Server output could be shown in the output tab. If this isn't possible because the Output tab lacks a feature of the Terminal tab, at least have an option where users can toggle where it shows up. None of my Gradle tasks require user input so showing their output under Output if this was a restriction wouldn't be an issue.
Describe alternatives you've considered
None.
Additional context
The text was updated successfully, but these errors were encountered: