microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.47k stars 28.97k forks source link

`showOutput` setting is not respected anymore if a build task is programmatically started when an extension is activated (appeared in 1.9) #19810

Closed rotemdan closed 7 years ago

rotemdan commented 7 years ago

Steps to Reproduce:

  1. Install the Blade Runner extension (an extension that starts a build task whenever a workspace is opened).
  2. Set up a build task for the workspace.
  3. Make sure showOutput is set to never in tasks.json.
  4. Open the workspace.

In 1.8 everything worked as expected, the output panel didn't show up when showOutput was set to never or silent (and the task had a matcher). In 1.9 this doesn't seem to work anymore. So the output panel now pops up every time the project is opened (which is a bit annoying).

The source code used by the extension is:

import * as vscode from 'vscode'; 

export function activate(context: vscode.ExtensionContext) {
    vscode.commands.executeCommand("workbench.action.tasks.build");
}

Is there a change in the API that needs to be addressed? or is this a bug?

dbaeumer commented 7 years ago

Is there anything in the output panel. A warning or error message? I added code that if the parsing of the tasks.json issues any error, warning or info message then I bring the output panel to front.

rotemdan commented 7 years ago

I looked at the output, typescript console, Git, extensions and developer tools, and couldn't see anything special.

The tasks output shows:

5:05:56 PM - Compilation complete. Watching for file changes.

TypeScript console shows:

[Info  - 17:07:06] Using tsserver from location: C:\Users\X\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js

These all look normal.

The panel seems to pop-up immediately, before these messages.

I've also disabled all custom settings and all extensions except "Blade Runner" and that didn't seem to make a difference.

I tried to run the task manually and the panel didn't pop-up.

rotemdan commented 7 years ago

Here's my tasks.json:

{
    "version": "0.1.0",
    "command": "node",
    "isShellCommand": true,
    "args": [
        "node_modules/typescript/lib/tsc.js",
        "-w",
        "-p",
        "."
    ],
    "showOutput": "never",
    "problemMatcher": "$tsc-watch",
    "isBackground": true
}
DeRoquefeuille commented 7 years ago

I experience the same problem. I tried setting the global and the task specific setting of showOutput to never or silent and the ouput window still opens everytime.

dbaeumer commented 7 years ago

OK. This only seems to happen when the task is run the first time. Thereafter the output window is kept in the background when a task runs.

dbaeumer commented 7 years ago

OK. I found the issue. Caused by a change I did for 1.9 to support running tasks in the terminal. Will fix.

dbaeumer commented 7 years ago

Fixed.