How do I open the 'launch.json' file in Visual Studio Code?

Viewed 26068

I am a new programmer that started learning Python, but there's something bothering me which I'd like to change.

As I've seen that it is possible to remove the unwanted path from the terminal when executing code, I cannot figure out how to access the Visual Studio Code launch.json file and all of the explanations on Google are quite confusing.

2 Answers

In Visual Studio Code, use shortcut Ctrl + Shift + P to open the Command Palette and type Open launch.json. And it will open the launch.json file for you. If you also can't open launch.json then try the way below.

Check if the .vscode folder exists in the root folder. If not, then create a new one and create file launch.json in that. Now you have launch.json for your workspace and you can configure your project.

Enter image description here

Note that if Visual Studio Code hasn't created a launch.json file for your project yet, do the following:

  • Click the Run | Add Configuration menu option, and one will automatically be generated for you, and opened in the editor.
Related