vscode-tasks

VSCode: Code Runner extension is unable to execute the code on git bash terminal?

天涯浪子 提交于 2021-02-19 05:55:11
问题 I am trying to run a simple program "primeRange.cpp" using Code Runner extension available for VSCode. I have selected my default terminal as git bash in VSCode , but when I hit Run on top right corner, it sends the command to bash to run the program using g++ compiler, but I am getting error as no such file or directory , when there exists a directory with the given name. How can I fix this? How can I customize which command to hit on bash when I press run on code runner? I want to set the

How to pass comma-separated options to the g++ linker with VSCode?

喜夏-厌秋 提交于 2021-02-05 07:49:07
问题 I need to pass the arg -Wl,-Bstatic,--whole-archive to g++. "version": "2.0.0", "tasks": [ { "type": "shell", "label": "shell: g++.exe build active file", "command": "C:\\MinGW\\x86\\bin\\g++.exe", "args": [ "-g", "${file}", "-Wl,-Bstatic,--whole-archive", "-Xlinker", "-Map=${fileDirname}\\${fileBasenameNoExtension}.map", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "options": { "cwd": "C:\\MinGW\\x86\\bin" }, "problemMatcher": [ "$gcc" ], "group": "build" } ] } It gives me in

Task output encoding in VSCode

好久不见. 提交于 2021-02-04 21:01:33
问题 I'm learning BeautifullSoup with Visual Studio Code and when I run this script: import requests from bs4 import BeautifulSoup from fake_useragent import UserAgent ua = UserAgent() header = {'user-agent':ua.chrome} google_page = requests.get('https://www.google.com',headers=header) soup = BeautifulSoup(google_page.content,'lxml') # html.parser print(soup.prettify()) And I'm getting the following error: Traceback (most recent call last): File "c:\ ... \intro-to-soup-2.py", line 13, in print

Task output encoding in VSCode

£可爱£侵袭症+ 提交于 2021-02-04 21:01:32
问题 I'm learning BeautifullSoup with Visual Studio Code and when I run this script: import requests from bs4 import BeautifulSoup from fake_useragent import UserAgent ua = UserAgent() header = {'user-agent':ua.chrome} google_page = requests.get('https://www.google.com',headers=header) soup = BeautifulSoup(google_page.content,'lxml') # html.parser print(soup.prettify()) And I'm getting the following error: Traceback (most recent call last): File "c:\ ... \intro-to-soup-2.py", line 13, in print

Using a shell command as VSCode task variable value

∥☆過路亽.° 提交于 2021-02-04 08:34:09
问题 I am trying to define a VSCode task in tasks.json that would adapt to the specific architecture where VSCode runs. To do this, I want to get the architecture as uname --m ( e.g. "aarch64" or "amd64"). My goal is to interpolate the output of uname into an environment variable like so "version": "2.0.0", "tasks": [ { "label": "build", "type": "shell", "command": "cmake", "args": [ "-DMYLIB_INCLUDE_DIR=$MYLIB/include", "-DMYLIB_LIBRARY=$MYLIB/lib" ], "options": { "env": { "MYLIB": "$

How to configure a VSCode Task to run a powershell script in the integrated terminal

纵饮孤独 提交于 2021-01-28 10:40:44
问题 In such a way that it is not in a sub shell. I need it to be able to prepare the environment...set environment variable. "version": "0.1.0", "command": "${workspaceFolder}/Invoke-Task.ps1", /*"command": "powershell", creates subshell so doesn't work*/ "isShellCommand": false, "args": [], "showOutput": "always", "echoCommand": true, "suppressTaskName": true, "tasks": [ { "taskName": "task1", "args": ["task1"] }, { "taskName": "task2", "args": ["task2"] } ] 回答1: This has been doable since 2017,

VSCode extension Installation Dependency activation order

懵懂的女人 提交于 2021-01-28 06:47:33
问题 I have a VSCode extension which has an installationDependency in the package.json: "extensionDependencies": [ "publisher.packagename" ] this works well - it runs the activation event for the dependency before the one I have written as you would expect: export async function activate(context: vscode.ExtensionContext) {... however - I would like my extension to first reset an environment variable before the dependency activates. Is it possible to determine (in my case reverse) the order of

Is there a way to set up a shortcut to call Build Tasks in VS Code?

安稳与你 提交于 2021-01-27 02:55:42
问题 Currently, I have a Build Task set up in Visual Studio Code (not Visual Studio). When I press Ctrl + Shift + B , I get a list of my build tasks, I then have to select my task and then it will compile and run my program. Is there an easier way to do this, so instead of Ctrl + Shift + B -> Enter , I can just press one button and have a preset Build Task run? Either a keyboard button or a GUI button will work great. 回答1: Mark the task as your default build task via Terminal -> Configure Default

Evaluating Environment Variables in VS Code Extension

五迷三道 提交于 2020-12-13 18:52:37
问题 I'm developing an extension in VS Code to add language support for OpenSCAD (Script-based 3D modeling program). Currently, I have been working on a way to open / preview a file in OpenSCAD from VS Code, which I have been able to do successfully using my own preview manager. My issue is that I want to add configurable naming formats when exporting an OpenSCAD file that use environment variables similar to those used in the tasks.json file. More info can be found here: https://code.visualstudio