Im starting a python basic course and trying to run some initial code with Vscode. After watching the course videos i notice that im not seeing any output under the DEBUG CONSOLE. I do get an output under the TERMINAL section.
Also, i notice that the debug icon is different compared to the one in the videos (mine has a play arrow).
Am i missing something?
My python
C:\Users\andres>py --version
Python 3.8.3
my current launch.json is
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"cwd": "",
"console": "integratedTerminal"
}
]
}
thanks
thanks to #tHeSiD for the initial advise. for the winerror123, i deleted and recreated the json file
Related
I've tried to debug my hello world program in go and cannot get debugging to work.
I've installed via homebrew and the google website. I've tried various online config, installed delve and breakpoints just won't stick.
Paths
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOPATH/bin:/usr/local/go/bin
Configuration
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "hello.go"
}
]
}
I am trying to debug a Go project in VSCode. I am able to debug it, but the application is running in the internal VSCode terminal. I need the application to run in an external console instead. For instance I want it to run in cmd.exe.
// .vscode/launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}"
}
]
}
How can I make the debug session open a external console and run it there, rather than in the internal console of VSCode?
The developers for the Go VSCode extension are in the process of adding a launch property for this. See: https://github.com/golang/vscode-go/issues/124#issuecomment-1006122877
How do I get rid of this annoying message every time there's an error in my code?
I found the solution to this problem:
The error message isn't actually caused by VScode, it's caused by the golang extension.
To disable it you have to go to the extension manager and click the little gear next to the installed extension and revert it to a previous version from the context menu. The version I reverted to is from about a year ago.
If you don't see the little gear icon you need to have the extension installed first.
Add your main.go file path to "program" attribute located in launch.json file.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "E:/GoProjects/main.go",
"env": {},
"args": []
}
]
}
Check the Go Lang extension settings and turn off the "Build On Save" feature.
I'm trying to debug a go project with vscode, when I run debug with those settings:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}",
"envFile": "${workspaceFolder}/.env.local",
"args": [],
}
]
}
I get:
go: finding gitlab.com/company/project/.vscode latest
can't load package: package gitlab.com/company/project/.vscode: unknown import path "gitlab.com/company/project/.vscode": cannot find module providing package gitlab.com/company/project/.vscode
exit status 1
Process exiting with code: 1
What can I do to fix it ?
Sounds like you're editing a file within your .vscode folder (e.g. the launch.json file you quoted) when you try to debug. Debug is relative to the file you have open (as you can see by the ${fileDirname} in your config). So the easiest fix is to make sure you have open the Go file you want to debug when you try to debug.
If you only ever want to debug one binary in your project, you can override the program setting in launch.json to always point at that package.
I successfully installed the "actionssdk-smart-home-nodejs" and it works well if i launch it using the command "node index.js" within the folder "...actionssdk-smart-home-nodejs\smart-home-provider".
I need now to debug some part of the code, thus i tried to debug it using VS Code as editor and with the launch.json configured like
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${file}"
}
]
}
When i launch the debugger all seems to start fine, but when i use the Google Chrome browser to access the main page (http://localhost:3000/) i get as response only "Cannot GET /".
It seems like the static route defined in the file "smart-home-provider-cloud.js" app.use('/', express.static('./frontend'));
isn't matched.
So i can't figure out why launching without debugging all works fine and if a start the debugger express returns only "Cannot GET /".
I would be grateful for any help or clue for further investigation !
After long digging i found my issue. The config file for debugging was missing a config line.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${file}",
"cwd":"${workspaceRoot}/smart-home-provi
}
]
}