vscode-tasks

Visual Studio Code problem matcher not working with custom output

拥有回忆 提交于 2019-12-09 04:34:26
I'm trying to get VS Code working with custom output. I've created a batch file which prints out: warning:main.asm(5):Something is wrong ERROR:main.asm(2):Something else is wrong But when I run the following task: "tasks": [ { "label": "build", "type": "shell", "command": "${workspaceFolder}\\build.bat", "group": { "kind": "build", "isDefault": true }, "problemMatcher":{ "pattern":[ { "regexp": "^.*:(.*)\\(\\d+\\):(.+)$", "file": 1, "line": 2, "message": 3, "location": 0 }] } } ] I get the output that I'm expecting but I don't get any errors in the problems window. Any ideas? Your regex isn't

VSCode Task to run ant buildfile located anywhere

若如初见. 提交于 2019-12-08 09:03:17
问题 I have a huge project spread across multiple source directories which was developed the last 15 years using eclipse with custom external tools configurations to launch ant tasks from build.xml files anywhere inside the source directories (a big mess, I know!). As the everyday work is mostly xml and JavaScript based, I thought of VSCode as a lightweight alternative (as eclipse is e.g. unable to deal with large xml files without exceeding HeepSpace). Task Runners look to me like a great way to

Visual Studio Code problem matcher not working with custom output

梦想的初衷 提交于 2019-12-08 04:05:12
问题 I'm trying to get VS Code working with custom output. I've created a batch file which prints out: warning:main.asm(5):Something is wrong ERROR:main.asm(2):Something else is wrong But when I run the following task: "tasks": [ { "label": "build", "type": "shell", "command": "${workspaceFolder}\\build.bat", "group": { "kind": "build", "isDefault": true }, "problemMatcher":{ "pattern":[ { "regexp": "^.*:(.*)\\(\\d+\\):(.+)$", "file": 1, "line": 2, "message": 3, "location": 0 }] } } ] I get the

VSCode: How to run a command after each terminal open?

落爺英雄遲暮 提交于 2019-12-07 06:43:09
问题 On Windows I have to run the command start-ssh-agent.cmd on each new terminal session I open. My development environment is VSCode, and I open a dozen new terminals each day. After each terminal open, I have to manually run this command. Is there is a way to run this command on the terminal each time I open one ? This may take the form of a VSCode extension, VSCode configuration (settings) or a Windows environment configuration. Any idea? 回答1: You can do the following: "terminal.integrated

How to Set a Keyboard Shortcut to “Terminate Running Task” in VSCode?

China☆狼群 提交于 2019-12-05 02:56:34
I have my build run my application until I kill it. This works fine, but it would be nice to bind "Terminate Running Tasks" to a keyboard shortcut. Is this possible? All the commands are listed when you go to change a key binding, so you can add something like this to the user settings: [ { "key": "shift+cmd+s", "command": "workbench.action.tasks.terminate" } ] You could also just write exit in the terminal and that would kill it. Just keep in mind that this might not work on everything but it's worth a try ;) 来源: https://stackoverflow.com/questions/33885264/how-to-set-a-keyboard-shortcut-to

Get relative path of the file for tasks in vscode

 ̄綄美尐妖づ 提交于 2019-12-04 09:17:17
I have a task defined in vscode's tasks.json file as following { "version": "0.1.0", "tasks": [ { "command": "gulp", "taskName": "eslint_task", "args": [ "eslint", "--file", "${file}" ], "echoCommand": true } ] } The ${file} is providing me the absolute path (starting from /Volumes in macOS) of the file on which I run this command. Is there any way I can get the relative path (Path starting from the workspace folder) of the same file instead? I already checked the official documentation for tasks , but couldn't find any list of arguments there. Found the answer. I just need to use $

How to run Cmake in Visual Studio Code using tasks

岁酱吖の 提交于 2019-12-03 21:22:17
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", "isDefault": true }, "dependsOn": ["make"] } ] } But no matter what I do It runs on ${workspaceRoot}

vscode import error for python module

主宰稳场 提交于 2019-12-03 16:31:52
问题 I am trying to do an import in python from one directory level up. import sys sys.path.append('..') from cn_modules import exception I get an Error from VSCode when I try to do Run Build Task as: ImportError: No module named cn_modules The same code works without any error from terminal (python) . I face the problem when I try to run it from VSCode Run Build task . Any clue on what is wrong here? Have spent quiet some time but not able to resolve this, Any help is appreciated. NOTE: this

How to make vscode not wait for finishing a preLaunchTask?

不羁岁月 提交于 2019-12-03 15:33:27
问题 I have a debug setup in Visual Studio code where I run an external binary which can execute my JS files (using duktape). The debug adapter currently only supports attach requests (not launch) so I have to run the binary before I can debug the JS scripts. In order to avoid having to start the application manually I created a task for it and set that in my launch.json file: { "version": "0.2.0", "configurations": [{ "name": "Attach MGA", "type": "duk", "preLaunchTask": "debug mga", "request":

code . is not recognized as an internal or external command

怎甘沉沦 提交于 2019-12-03 11:50:47
问题 I want to open directory using cmd in visual studio code but its give me error in cmd. So, What setting is require for that? I have performed below command D:\RND>code . 回答1: It needs to be setup so that Code is found in your PATH . If you're on a mac system, do the following (for windows systems, read below): Launch VS Code Open up command palette (press F1 ) and type shell command to find Shell Command: Install 'code' command in PATH command . Restart terminal If you're on Windows, you can