I am using R Debugger in Vscode to develop an RShiny app while using SSH to connect to the remote.
My launch.json file looks like this:
{
"version": "0.2.0",
"configurations": [
{
"type": "R-Debugger",
"name": "Launch R-Workspace",
"request": "launch",
"debugMode": "workspace",
"workingDirectory": "", // If I put my actual path here, it changes nothing
"allowGlobalDebugging":true
}
]
}
For the purposes of this topic, I have these folders/files:
src/www/uis
src/server.R
I set breakpoints in files within src/www/uis as well as within src/server.R.
When I use Launch R-Workspace, the breakpoints at src/www/uis will trigger but within src/server.r they turn into "unverified breakpoints".
What I've tried:
Reading through similar questions and findings answers that did not seem relevant. Reading through the documentation where I did not see anything useful to me.
Any insight?
Thanks
Related
I've created a AWS SAM project using nodejs14.x. I've been able to get debugging working, but every time I run my program it stops on an AWS wrapper index.js file.
See this link for a picture of the actual file. It looks like the file is located at \var\runtime\index.js. If I press Continue, my program runs fine, and breakpoints in it are stopped at. But it's really annoying to have to press Continue to get past this file every single time I debug.
Does anyone know a way to "ignore" this file when debugging? In this help page about debugging in VSCode, it talks about a stopOnEntry variable you can set in launch.json. However, no Intellisense suggestions appear for stopOnEntry, and I'm not sure if aws-sam supports this.
If it helps, here's my launch.json file:
{
"configurations": [
{
"type": "aws-sam",
"request": "direct-invoke",
"aws": {
"credentials": "profile:<myemail>"
},
"name": "MyLambdaFunction:src/handlers/my-lambda-file.myLambdaFunction (nodejs14.x)",
"invokeTarget": {
"target": "code",
"projectRoot": "${workspaceFolder}/",
"lambdaHandler": "src/handlers/my-lambda-file.myLambdaFunction",
},
"lambda": {
"runtime": "nodejs14.x",
"payload": {},
"environmentVariables": {}
},
}
]
}
I'd like to know if it's possible to have the launch.json file of VSCode using the hostname of my machine. To be more precisely, I'd like to use the hostname in the configurations.url properties, something like this:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch",
"url": "https://<<hostname>>/",
"webRoot": "${workspaceFolder}"
}
]
}
As you can see, the url properties has <<hostname>>; though, I'd like that, when pressing F5, that <<hostname>> is automatically replaced with the machine hostname (e.g. DESKTOP-JUWKA3).
I've tried to look for answer on stackOverflow, as well as VSCode official site:
https://code.visualstudio.com/docs/nodejs/browser-debugging
https://code.visualstudio.com/docs/editor/variables-reference
I thought something was possible with the information in the second link, but unfortunately I haven't been able to do that (maybe I'm not capable of doing it >_>)
Strangely, VS Code stopped accepting input from integrated and external terminals. It was working with fish as the shell on Arch an hour ago. If I run the following Python code, for example:
print('Please enter a number: ', end='')
a = float(input())
print(f'Your number is: {a}')
and I type 1 and hit Enter, the cursor moves to the next line and all execution halts. The debugger is still running as if I didn't enter anything, but the terminal is displaying my input. When I hit stop, I see the error "timeout after 1000ms" as an alert in the lower right of VS Code.
I haven't made any changes to launch.json after generating from the Python: Current File option. For clarity's sake, that code is here:
{
// 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}",
"console": "integratedTerminal"
}
]
}
I haven't found any resolution by reading the docs. Is this just a bug that will get fixed, or am I doing something wrong?
Edit
Executing the code from the shell normally runs as expected.
https://github.com/microsoft/vscode-python/issues/13449
check this out, try downgrade the extension back to another version.
Am trying to get breakpoints to work in VS Code with an Ember addon (version 3.18). Have tried launch.json as:
{
"version": "0.2.0",
"configurations": [
{
"type": "edge",
"request": "launch",
"name": "Launch Edge against localhost",
"port": 9222,
"runtimeArgs": [ "--remote-debugging-port=9222" ],
"url": "http://localhost:4200",
"sourceMapPathOverrides": {
"dummy/*": "${workspaceFolder}/tests/dummy/app/*",
"test-addon/*": "${workspaceFolder}/addon/*",
}
}
]}
It works fine for setting breakpoints in files in the dummy test app. But when setting a breakpoint in files within the addon folder, VSCode says "Breakpoint set but not yet bound". How can this be fixed? I assume the 2nd sourcemap path override is wrong?
After a bit of further experimenting, seems the 2nd path should be:
"addon-tree-output/test-addon/*": "${workspaceFolder}/addon/*"
Update:
Turns out this still doesn't break inside addon files correctly. eg. in an addon component file:
#action
click() {
console.log('hello') // Set breakpoint here
}
// Instead, jumps to here
Some difference between the dummy and vendor source maps perhaps? There is an option in ember-cli-build.js:
babel: {
sourceMaps: 'inline'
}
but this only applies to the dummy test app as it states in the comment underneath it?
With the right debug config file I can make VSCode run the currently focussed file through Mocha. However, I find it frustrating that if I am working on the actual code, rather than the spec file and I press F5, it tries to run the actual code as a spec file through Mocha.
So, my question is; given a file structure like this:
Folder
File.js
File.spec.js
And a debug config (.vscode/launch.json) like this:
{
// 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": "Unit Tests: Current File",
"program": "${workspaceRoot}/node_modules/.bin/_mocha",
"cwd": "${workspaceRoot}",
"args": [
"-u", "tdd",
"--timeout=999999",
"--colors",
"--opts", "${workspaceRoot}/mocha.opts",
"${file}" // I want to make this dynamic
],
}
]
}
Is it possible to get VSCode to debug the spec file whether the spec file (File.spec.js) or it's subject (File.js) are selected?
You can introduce a new dynamic variable by writing a simple extension that just defines one command, e.g. a smartFile command.
Then you can refer to that command in your launch config as ${command:smartFile}.
For the implementation of the command you can use everything available in VS Code extension API. So you can not only calculate a path based on your folder structure, but you can even pop-up UI. E.g. you could use QuickPick to select a test case from the list of all tests.