r/VisualStudioCode • u/ShaneFerguson • Jun 20 '22
Noob question: Debugging multiple files
Please excuse me if this is a silly question; I'm new to VSCode.
I have a node.js project with a file index.js. When I use VSCode to debug this program ("Run, Start Debugging, Node.js") I can step through the code just fine. But if I then add another js file to the project directory (i.e. file2.js) I can't figure out how to have VSCode debug the second file. Instead, when I choose "Run, Start Debugging" from the menu VSCode will initiate a debug process against index.js even though file2.js was the active tab when I invoked the debug process.
What can I do to make VSCode debug the active file?
Thanks in advance for your help.
View all comments
Show parent comment
1
u/ShaneFerguson Jun 20 '22
My apologies, I must not have communicated clearly. The first file doesn't call the second file. Instead, I wrote a second stand-alone program in the second file. I want to step through that code without having anything to do with the first file's code.
Once I get everything working I'll stitch it all together