Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run/Debug CURRENT file in WebStorm

I have a lot of scripts I want to run / debug from Webstorm, but for each I have to go thru the process of "Run > Edit Configurations" and add a new configuration mapped to each file.

Is there a variable / shortcut to tell WebStorm to run / debug currently opened file? Something like ${opened-file} would be great to have a Run Configuration "template".

Thanks.

like image 791
Maz Avatar asked Feb 10 '14 15:02

Maz


People also ask

How do I run a debug in WebStorm?

Start debugging If your application is running in the development mode on localhost , you can start debugging it from the built-in Terminal ( Alt+F12 ), from the Run tool window, or from the Debug tool window. Just hold Ctrl+Shift and click the URL at which the application is running.

How do I run a file in WebStorm?

To run a script, open it in the editor or select it in the Project tool window, and then select Run <script file name> from the context menu. WebStorm creates a temporary run/debug configuration of the type Node. js. To run a test, click the gutter icon next to it or press Ctrl+Shift+F10 .

How do I debug JavaScript code in WebStorm?

Start debuggingOpen the HTML file that references the JavaScript to debug or select the HTML file in the Project tool window. From the context menu of the editor or the selection, choose Debug <HTML_file_name>. WebStorm generates a debug configuration and starts a debugging session through it.


1 Answers

Application parameters has a macros support (plus icon in the field). You need to use $FilePathRelativeToProjectRoot$ macros.

This example runs node /node_modules/.bin/wdio wdio.local.conf.js --spec foo.js. foo.js is $FilePathRelativeToProjectRoot$

enter image description here

like image 121
Stanislav Mayorov Avatar answered Sep 20 '22 16:09

Stanislav Mayorov