launch Edge Canary with launch.json - microsoft-edge

Some time ago, the setting in launch.json would launch Edge Canary
"type": "msedge",
"version": "canary",
"request": "launch",
Now it opens the normal edge instead.
Any changes I am not aware of?
Thanks

You'll need to use the runtimeExecutable property:
{
"request": "launch",
"type": "msedge",
"runtimeExecutable": "canary",
}
https://code.visualstudio.com/docs/nodejs/browser-debugging#_launch-configuration-attributes

Related

How to autorun webpack-dev-server when starting debugging RoR session?

Since Rails 5.1, It's possible to run rails server next to webpack-dev-server. I have configured debugger in launch.json to run rails server. When I start rails server throught vscode, I want it to automatically run ./bin/webpack-dev-server on background for autocompile javascript changes as another process, but I can't figure out how to achieve this.
I have created task in tasks.json to run webpacker but I can't figure out how to combine it with launch.json.
Here is my launch.json:
{
"version": "0.2.0",
"configurations": [
{
"preLaunchTask": "webpack-dev-server",
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"program": "${workspaceRoot}/bin/rails",
"args": [
"server"
]
}
]
}
And here is tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "webpack-dev-server",
"type": "shell",
"command": "${workspaceRoot}/webpack-dev-server",
"isBackground": true,
}
]
}
When I run debugging and task separately, It's working as expected, but run then automatically when starting debugging not working.
Things I've tried:
run webpack-dev-server with "preLaunchTask" - problem with this is that "preLaunchTask" waits until webpack-dev-server stop running and after that runs debugging. I need them to run simultaneously next to each other.
Specify webpack-dev-server as another launch configuration and combine these two launches through compond in launch.json - this isn't working, because vscode needs to specify type of launch and shell isn't supported
run task with & at the end to suppress waiting for process finish - not working
If anybody solved this or know how to achieve running both processes simultaneously through one click, It would be helpful to share this knowledge.
Thank you.
So I found the solution thanks to https://stackoverflow.com/a/54017304/3442759.
In tasks.json there needs to be specified problemMatcher even when it's not used. Without problemMatcher specified, task will not run in the background even when isBackground is set to true.
I've created gist with setup steps. https://gist.github.com/tomkra/b1d67a7ae96af34cba78935f15b755b6
So final configuration is:
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"program": "${workspaceRoot}/bin/rails",
"args": [
"server"
],
"preLaunchTask": "webpack-dev-server"
}
]
}
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "webpack-dev-server",
"type": "shell",
"isBackground": true,
"command": "./bin/webpack-dev-server",
"problemMatcher": [
{
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": ".",
}
}
]
}
]
}

How do you configure VSCode to run on an iPhone with React Native

I want to run a React Native app on an iPhone, not on the simulator, using VSCode.
I came across this past question but cannot get various things here, including the accepted answer to work.
React Native in VS Code: add configuration for iOS Device to launch.json
The original launch.json which launches/runs the simulator is:
{
"name": "Debug iOS",
"cwd": "${workspaceFolder}",
"type": "reactnative",
"request": "launch",
"platform": "ios"
}
If I try augmenting that to be this:
{
"name": "Debug iOS",
"cwd": "${workspaceFolder}",
"type": "reactnative",
"request": "launch",
"target": "device",
"runArguments": ["--device", "iPhone"],
"platform": "ios"
}
(iPhone is the name of my connected device as showing in Xcode)
Or use the accepted answer verbatim:
{
"name": "My iPad",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "ios",
"target": "device",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
}
Then neither work, in both cases there is the same error:
An error occurred while launching the application. Error while
executing command
'/Users/me/Desktop/Checkouts/ReactNative/AwesomeProject/node_modules/.bin/react-native
run-ios --device iPhone --no-packager --verbose': Error while
executing command
'/Users/me/Desktop/Checkouts/ReactNative/AwesomeProject/node_modules/.bin/react-native
run-ios --device iPhone --no-packager --verbose' (error code 101)
(error code 303)
Anybody got this working and knows what the error/problem/fix is?

Vscode React Native run on device

I've followed many tutorials but I can't seem to make Vscode launch my React Native app on my device. I can run fine on simulator, but when I use the following configuration:
{
"name": "Can's iPhone",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "ios",
"target": "device",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react",
},
It just launches the app in last used simulator, instead of device. I've also tried:
{
"name": "Can's iPhone",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "ios",
"target": "device",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react",
"runArguments": [
"--device",
"EXACT_NAME_OF_MY_DEVICE"
],
},
Where EXACT_NAME_OF_MY_DEVICE is exact name of my device, but no avail; it still runs in simulator. When I select my device in Xcode and run, it runs fine though (but I want to use Vscode to debug TS) What am I doing wrong?

How to set dart & flutter to default when I'm buliding flutter projects

I'm using vs code to create and build a flutter project.
But every time I press F5 to build, vs code always asks me to select the environment. It's very annoying.
How to set dart & flutter to default when I'm buliding flutter projects.
For VSCode you need a launch configuration
If you don't have the following file, create one:
.vscode/launch.json
With contents of:
{
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"type": "dart",
"request": "launch",
"program": "${workspaceFolder}/main.dart"
}
]
}
Just make sure the program is pointing to your main dart file that has runApp in it
{
"configurations": [
{
"name": "Flutter",
"type": "dart",
"request": "launch",
"program": "lib/main.dart"
}
]
}

How do I set up the visual studio code launch.json file to debug F#?

How do I set up the debugger in launch.json?
Currently, I have
{
"version": "0.1.0",
"configurations": [
{
// Name of configuration
// Appears in the launch configuration drop down menu.
"name": "Launch Lukecxu",
"request": "launch",
"cwd": "/Users/lukexu/lukecxu",
"type": "node",
// Automatically stop program after launch.
"stopOnEntry": true,
"program": "${workspaceRoot}"
}
]
}
I found some of this online but it's not working. It said I should have "type" as mono but when I set it has mono it said type not supported.
For my system settings I did brew install mono and I also have ionide installed.
Right now I can't click the gutter to set any break points and when I hit F5 it says "Cannot launch program '/Users/lukexu/lukecxu'; configuring source maps might help."
Is there a tutorial to set up F# debugger in VSCode?
I think that you need to install mono debug extension
After you've installed extension following configuration should work:
{
"version": "0.1.0",
"configurations": [
{
// optional "preLaunchTask": "Build" - some way of building your application.
"externalConsole": true,
"name": "Launch",
"type": "mono",
// Workspace relative or absolute path to the program.
"program": "${workspaceRoot}/bin/myapp/myapp.exe",
"stopOnEntry": true
},
{
"name": "Attach",
"request": "attach",
"type": "mono",
"address": "localhost",
"port": 55555
}
]
}

Resources