vscode-tasks

Create tasks in Visual Studio Code per user

隐身守侯 提交于 2020-02-24 05:27:07
问题 When I created a Node task for Visual Studio Code it created a tasks.json file inside the .settings folder for the folder that you have open (node-app in this case as shown in the image below). ie: it creates a task per folder. { "version": "0.1.0", "command": "node", "isShellCommand": true, "args": ["${file}"] } My question is how do you create a task per user rather than a project based task so that I can execute the node code from any folder rather that having to create the same task for

Is it possible to pass arguments to a task in Visual Studio Code

你离开我真会死。 提交于 2019-12-31 17:57:41
问题 Here's an example of my tasks.json : { "version": "0.1.0", "tasks": [ { "taskName": "test", "suppressTaskName": true, "command": "python", "args": [ "tests/brewer_tests.py" ], "isTestCommand": true } ] } I can run this with shift+cmd+alt+b . I can also run it with alt+t , and choose it from the menu. Is it possible to pass additional arguments in that menu? e.g. And you could build it into your task like so: { "version": "0.1.0", "tasks": [ { "taskName": "test", "suppressTaskName": true,

Is it possible to pass arguments to a task in Visual Studio Code

冷暖自知 提交于 2019-12-31 17:56:11
问题 Here's an example of my tasks.json : { "version": "0.1.0", "tasks": [ { "taskName": "test", "suppressTaskName": true, "command": "python", "args": [ "tests/brewer_tests.py" ], "isTestCommand": true } ] } I can run this with shift+cmd+alt+b . I can also run it with alt+t , and choose it from the menu. Is it possible to pass additional arguments in that menu? e.g. And you could build it into your task like so: { "version": "0.1.0", "tasks": [ { "taskName": "test", "suppressTaskName": true,

What does “on folder open” mean in VSCode's “run on folder open” tasks?

别来无恙 提交于 2019-12-25 01:37:27
问题 VSCode added a feature last year that will auto-run a task "on folder open". But what does "on folder open" mean when using workspaces? Specifically, if you open a workspace, will "runOn": "folderOpen" tasks run? If so, how? I'm asking because I configured a task to be auto-run, but it's not running when I open the workspace. (The task runs correctly when triggered manually.) 回答1: "On folder open" tasks will run when you open a workspace, just like when you use the "Open Folder..." link when

Extension API - Task Provider - Build Task example

喜夏-厌秋 提交于 2019-12-23 15:20:58
问题 I've built an extension for a programming language that I use and I've created hotkey shortcuts for calling the compiler executable with the currently open document's URI. I want to convert that to a build task in my extension. I have made a tasks.json file with a build task that works and catches errors and such, but it only works if I put it in the current workspace. There are absolutely no examples of adding a build task anywhere and the API documentation for task providers is specifically

How to create VS Code extension that provides custom problemMatcher?

隐身守侯 提交于 2019-12-22 08:57:10
问题 I have project that uses custom problemMatcher . But I would like to extract it into an extension making it configurable. So eventually it could be used in tasks.json like { "problemMatcher": "$myCustomProblemMatcher" } How to do that? 回答1: As of VSCode 1.11.0 (March 2017), extensions can contribute problem matchers via package.json: { "contributes": { "problemMatchers": [ { "name": "gcc", "owner": "cpp", "fileLocation": [ "relative", "${workspaceRoot}" ], "pattern": { "regexp": "^(.*):(\\d+)

Visual Studio Code: Could not find the preLaunchTask 'build'?

人走茶凉 提交于 2019-12-22 01:35:04
问题 I have created a new .NET Core application with the command: dotnet new console -o test When I try to run it in the Visual Studio Code debugger, I get: Could not find the preLaunchTask 'build'? Visual Studio Code generated these files for me: tasks.json: { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "0.1.0", "command": "dotnet", "isShellCommand": true, "args": [], "tasks": [ { "taskName": "build", "args": [ ],

How to run Cmake in Visual Studio Code using tasks

心已入冬 提交于 2019-12-21 06:23:23
问题 I'm trying to run cmake with ctrl+shift+B like so: { "version": "2.0.0", "tasks": [ { "label": "cmake", "type": "shell", "options": { "cwd": "${workspaceRoot}/build" }, "command": "cmake ${workspaceRoot} -G \"MinGW Makefiles\"", (...) }, { "label": "make", "type": "shell", "command": "mingw32-make.exe", "options": { "cwd": "${workspaceRoot}/build" }, (...), "dependsOn":["cmake"] }, { "label": "build", "type": "shell", "options": { "cwd": "${workspaceRoot}/build" }, "group": { "kind": "build",

How to run Cmake in Visual Studio Code using tasks

本小妞迷上赌 提交于 2019-12-21 06:23:07
问题 I'm trying to run cmake with ctrl+shift+B like so: { "version": "2.0.0", "tasks": [ { "label": "cmake", "type": "shell", "options": { "cwd": "${workspaceRoot}/build" }, "command": "cmake ${workspaceRoot} -G \"MinGW Makefiles\"", (...) }, { "label": "make", "type": "shell", "command": "mingw32-make.exe", "options": { "cwd": "${workspaceRoot}/build" }, (...), "dependsOn":["cmake"] }, { "label": "build", "type": "shell", "options": { "cwd": "${workspaceRoot}/build" }, "group": { "kind": "build",

How to run multiple tasks in VS Code on build?

好久不见. 提交于 2019-12-20 10:44:58
问题 Using tasks.json version 2.0.0, I have not been able to make it so that, when I build my application, multiple tasks are run at the same time. I'm using gulp for my SCSS compilation, and running my Compile/minify cms.scss task on its own works fine, so it's not a problem with the task itself, just VS Code's task runner. When I Run Build Task in VS Code, my gulp task is not being run, even though it has "group": "build" — only the dotnet one is. tasks.json { "version": "2.0.0", "tasks": [ {