Skip to content
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

Extension should be able to contribute a task template and a user can pick a template #966

Closed
egamma opened this issue Dec 3, 2015 · 10 comments
Assignees
Labels
tasks Task system issues

Comments

@egamma
Copy link
Member

egamma commented Dec 3, 2015

Currently the Configure Task Runner action generates a large task.json file with many different task configurations, that the user has to clean-up eventually, that is, delete the configs that do not apply.

Instead of generating one large file we should allow the user to select what kind of task that should be configured and then to only generate this one. This is similar to how we generate the launch configurations.

@egamma egamma added feature-request Request for new features or functionality tasks Task system issues labels Dec 3, 2015
@stkb
Copy link
Contributor

stkb commented Dec 4, 2015

It would be great if extensions could hook into this too to provide configurations and a custom tasks.json. The same goes with the launch.json too.

@danielschmitz
Copy link

// Note: Related #981

1 similar comment
@usagi
Copy link

usagi commented Dec 6, 2015

// Note: Related #981

@egamma egamma modified the milestone: Backlog Dec 10, 2015
@egamma egamma changed the title Configure task runner should allow me to pick a particular task type Support that an extension can contribute a task template and a user can pick a template Feb 17, 2016
@egamma egamma changed the title Support that an extension can contribute a task template and a user can pick a template Extension should be able to contribute a task template and a user can pick a template Feb 17, 2016
@egamma
Copy link
Member Author

egamma commented Feb 17, 2016

Extracted comment from #2263

Yes, please! With the PowerShell extension we want to provide a default task to run Pester tests. It would be great if an extension could provide the initial tasks.json file you get with Tasks: Configure Task Runner. We would also like to provide a problemMatcher that could be referenced from the Pester (test) task. The problemMatcher is somewhat lengthy and it would be nice to reference it like so:

{
    "version": "0.1.0",

    // Start PowerShell
    "command": "${env.windir}\\sysnative\\windowspowershell\\v1.0\\PowerShell.exe",

    // The command is a shell script
    "isShellCommand": true,

    // Show the output window always
    "showOutput": "always",

    // Allow Pester to invoke scripts and run Pester
    "args": [
        "-NoProfile",
        "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process;",
        "Write-Host 'Invoking Pester...'; Invoke-Pester;",
        "Invoke-Command { Write-Host \"Completed all tasks in task runner: $($args[0])\" } -args"
        ],

    // Associate with test task runner
    "tasks": [
        {
            "taskName": "Pester",
            "isTestCommand": true,
            "problemMatcher": "$pester"
         }
    }
}

Seems like the package.json needs a contributes.Tasks where extension authors can contribute both problemWatchers and task initial configurations.

@dbaeumer
Copy link
Member

Here is what I did for the Februar milestone: the monolithic tasks.json example got removed in favor of using snippets. However due to a limitation we have right now we can't contribute a snippet for specific files from the outside. We will look into this in the next milestone.

capture

@dbaeumer
Copy link
Member

See #3125

@rkeithhill
Copy link

I like the direction but yeah, we need to be able to provide task snippets with our extension and have those show up when the user edits a tasks.json file.

How would you handle duplicates? Say another extension created a BetterTypeScriptTasks.json that contained the snippet tsc - watch? Allow both but show the origin (extension) of each snippet?

@fbricon
Copy link
Contributor

fbricon commented Nov 24, 2016

This feature would be interesting for the vscode-java extension, giving the ability to contribute gradle task templates, for instance.

@dbaeumer
Copy link
Member

[Addressed in new terminal runner]

In the terminal runner world extension can contribute tasks programmatically. So the Java extension can contribute a gradle task dynamically by checking if a gradle configuration is available without having the user to edit the tasks.json file.

@dbaeumer
Copy link
Member

Closing. Got addressed in task 2.0.0

@dbaeumer dbaeumer removed the feature-request Request for new features or functionality label Nov 10, 2017
@dbaeumer dbaeumer removed this from the Backlog milestone Nov 10, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tasks Task system issues
Projects
None yet
Development

No branches or pull requests

7 participants