I am writing javascript and am currently doing simple exercises / programs. From time to time I want to run a file for testing. I know that I can create an HTML file and do it in the console. In Sublime, there is a way to “build” the current file and immediately see the results (say, everything sent to console.log).
With VS Code, it seems that for every file I want to build / debug in this way, I have to manually modify the launch.json file to display the name of the current program.
I researched the way of this and I found out that there are variables like ${file} , but when I use this in the launch.json attribute "program", for example:
"program": "${workspaceRoot}/${file}"
with or without the workspaceRoot part, I get the following error:
Attribute "program" does not exist" (file name here).
Am I missing a simple way to accomplish this, or should I constantly edit launch.json every time I want to run a file?
Thanks in advance!
javascript visual-studio-code
jdb79
source share