Skip to content

Simplify generated launch.json #3321

@isidorn

Description

@isidorn

Hey,

VSCode dev here. This milestone I am looking into simplifing generated launch.json for various extensions microsoft/vscode#62851

The launch.json that Python generates is attached at the end. This is far too complex for the avarage user. I suggest to simplify it the following way:

  • DebugConfigurationProvider should use the quickPick to ask the user if he would like to debug the current file, attach, debug a python module, python django or debug python flask. Based on the user response only generate one configuration
  • Remove host: "localhost" from the attach, this should be the default value and should not be specified
  • If you strongly feel that the user should be asked what console to use, also ask that as a follow up question. IMHO this should not be asked, and just generate what you think is the best default experience
  • If the port is not standard also ask the user for it using quickInput, example
  • You are already contributing configurationSnippets which is great

If you agree with the suggestions I am making here I am also here to help with any potential questions you might have. The changes should not require a lot of work but will simplify the flow a lot imho.

{
	// Use IntelliSense to learn about possible attributes.
	// Hover to view descriptions of existing attributes.
	// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Python: Current File (Integrated Terminal)",
			"type": "python",
			"request": "launch",
			"program": "${file}",
			"console": "integratedTerminal"
		},
		{
			"name": "Python: Attach",
			"type": "python",
			"request": "attach",
			"port": 5678,
			"host": "localhost"
		},
		{
			"name": "Python: Module",
			"type": "python",
			"request": "launch",
			"module": "enter-your-module-name-here",
			"console": "integratedTerminal"
		},
		{
			"name": "Python: Django",
			"type": "python",
			"request": "launch",
			"program": "${workspaceFolder}/manage.py",
			"console": "integratedTerminal",
			"args": [
				"runserver",
				"--noreload",
				"--nothreading"
			],
			"django": true
		},
		{
			"name": "Python: Flask",
			"type": "python",
			"request": "launch",
			"module": "flask",
			"env": {
				"FLASK_APP": "app.py"
			},
			"args": [
				"run",
				"--no-debugger",
				"--no-reload"
			],
			"jinja": true
		},
		{
			"name": "Python: Current File (External Terminal)",
			"type": "python",
			"request": "launch",
			"program": "${file}",
			"console": "externalTerminal"
		}
	]
}

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions