How to configure JS/TS debugger on PhpStorm like on VSCode with attach option? - visual-studio-code

I am moving from VSCode to PhpStorm. In VSCode I could configure debugger with attach mode.
What is attach mode? It allows you to debug your app in existing browser window. In launch mode new instance of browser is started.
In PhpStorm I can't see that option in docs. Do I search in wrong way? Or there is a trick to do that?
Thank you for response.

You can use the Attach to Node.js/Chrome run configuration to attach the debugger to a running Node.js process/Chrome browser started with --remote-debugging-port option. See https://www.jetbrains.com/help/phpstorm/2021.3/running-and-debugging-node-js.html#node_debugging_running_application for more info.

Related

Xdebug works with PhpStorm but not on VSCode

Just simple problem which I can't figure out. Just switched to VSCode for testing and want to set up debugger same as I have in PhpStorm.
Here are the current settings which I use that works in PhpStorm:
I use path mapping because of docker to specify remote directory.
Now switching to VSCode I have something like this but nothing is happening when I turn on debug, I switched ideKey to VSCODE in the container and in the browser extension setting and checked phpinfo() to verify.
Is there any setting in the VSCode which specifies ideKey as well that I'm missing or any other setting? Any help would be appreciated.

Always open integrated terminal with new window

I would like to automatically open integrated terminal when I open a new window (directory/project) in vscode. Is this possible to achieve with a setting? Tried to look for a setting on the internet but couldn't find.
Actually I think there is no settings for that but there is an extension in vscode for that: https://marketplace.visualstudio.com/items?itemName=EthanSK.restore-terminals and I think you can configure it.

phaser on vscode launch

I've created a simple game using Phaser on vscode.
I read that i need to run it locally in order to run it on chrome and i can't manage to do so using vscode's F5.
when im on "index.html" and pressing F5 it pops out an alert box that says "cannot find progrem to debug".
pressing F5 while im on any other file causes a error in the debugger "window is not defined"(when im on phanser.js)/"Phaser is not defined"(when im on any other file)
how can i start this program correctlly ? sorry for the basic question .
http-server works just fine. But if you want to debug the game easily. You might want to follow the steps in this post: https://divillysausages.com/2015/06/09/using-phaser-with-visual-studio-code/
It is an instruction for setting up Typescript phaser development in vscode, but the steps that teach you how to set up node server also applies to a javascript usage case. If you want to make it easy to debug(pause code executing while game running, etc.) Try to set it up in that way.
Had to install http-server from npm and run it in terminal.
tried it before, but accidently installed it not globaly.
now it works. thanks!

Visual Studio code 'open in browser' extension failed

I have installed Open in browser visual studio extension. But when I try to open the browser by shortcut Alt+B. It fails showing the following:
Running the contributed
command:'extension.openInDefaultBrowser' failed.
Please help if there's any solution.
Go to settings --> Extensions --> Open in Browser and set a default browser. In my case I have set it to "chrome" (it can be "firefox" too), so it opens in chrome every time I use the extension.
i have no problem when i using windows, but since i use linux open in browser extension not work because default browser not set as well, and i try to set manual in VS Code setting and set the plugin open-in-browser by default to Firefox
its solving my problem i hope its work to you
If the above solution didn't work install its previous version
Vote up If this Helped !!

How to debug an interactive Node.js app in VS Code?

How do you run and debug an interactive Node.js app (one that prompts the user to enter STDIN on the console) in VS Code using a simple launch (F5). I have so far been running the app using node --inspect-brk . and then attaching VS Code. This works fine, but I'm just wondering if there's a faster way. If I look at the DEBUG CONSOLE pane, I can see the STDOUT, but I can't add input there.
Randy's comment was my answer with a link here. Thanks, Randy.
The solution is to configure the console value in your launch.json file. I added "console": "integratedTerminal" and now when I hit F5 I can jump to the integrated terminal (CTRL+<backtick>) and interact with my app.