How to set the working directory for debugging a Python program in VS Code?

@SpeedCoder5’s comment deserves to be an answer. In launch.json, specify a dynamic working directory (i.e. the directory where the currently-open Python file is located) using: “cwd”: “${fileDirname}” This takes advantage of the “variables reference” feature in VS Code, and the predefined variable fileDirname. Note as comments say, you might also need to add the purpose … Read more

How to display current values of VS Code’s predefined variables (such as “${workspaceFolder}” or “${fileWorkspaceFolder}”)?

Old answer: There may be a better way but you could run a // “preLaunchTask”: “Echo vars” in your debug launch like: { “name”: “Chrome : Launch with sourcemaps”, “type”: “chrome”, “request”: “launch”, “url”: “http://localhost:3000”, “webRoot”: “${workspaceRoot}”, “sourceMaps”: true, “runtimeArgs”: [ “–remote-debugging-port=9222” ], “preLaunchTask”: “Echo vars” }, in your launch task and then in tasks.json … Read more

Debugger not stopping at breakpoints in VS-Code

Setting “justMyCode”: false makes it stop at breakpoint: { “version”: “0.2.0”, “configurations”: [ { “name”: “Python: Debug Current File”, “type”: “python”, “request”: “launch”, “program”: “${file}”, “console”: “integratedTerminal”, “stopOnEntry”: true, “justMyCode”: false }, ] }

My Angular application doesn’t hit breakpoint when debugging?

Here’s what was going on! It has to do with the path to the project in the .vscode file and the need to debug two separate project/s folders at one time! ${workspaceFolder} I have two folders for the app Yogabandy-SPA (Angular app) Yogabandy.API (ASP.Net Core Web API) I thought the best place for the .vscode … Read more

How to attach the VSCode debugger to the Brave browser?

For MacOS users I was able to connect to create a configuration in launch.json so that the Brave browser launches on MacOS. I appended the “userData”: true property because I was getting an error. I figured that out by looking at this page. https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome { “type”: “chrome”, “request”: “launch”, “name”: “Brave”, “runtimeExecutable”: “/Applications/Brave Browser.app/Contents/MacOS/Brave Browser”, … Read more

Unbound breakpoint – VS Code | Chrome | Angular

The fix for this was simple, I hadn’t set the sourceMap property to true in angular.json for that particular environment, instead I had “sourceMap”: false, See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/SourceMap for more info. With thanks to Connor – https://github.com/microsoft/vscode-js-debug/issues/872

How to debug a nodemon project in VSCode

Change package.json to “scripts”: { “dev”: “node app.js”, “debug”: “nodemon –inspect app.js” } –inspect is for versions >= 6.3. –legacy or –auto for older versions And launch.json to: “version”: “0.2.0”, “configurations”: [ { “type”: “node”, “request”: “attach”, “name”: “Node: Nodemon”, “processId”: “${command:PickProcess}”, “restart”: true, “protocol”: “inspector” } ] the restart flag is the key here. … Read more

How to make vscode not wait for finishing a preLaunchTask?

This worked for me. Note all these are required, even though none are important: problemMatcher.pattern.regexp problemMatcher.pattern.file problemMatcher.pattern.location problemMatcher.pattern.message problemMatcher.background.activeOnStart problemMatcher.background.beginsPattern problemMatcher.background.endsPattern { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format “version”: “2.0.0”, “tasks”: [ { “label”: “build-extras”, “type”: “shell”, “isBackground”: true, “command”: “./script/build-extras”, // This task is run before some debug tasks. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)