Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Simplify generated launch.json #404

Closed

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 ruby generates is the following:

{
	// 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": "Debug Local File",
			"type": "Ruby",
			"request": "launch",
			"cwd": "${workspaceRoot}",
			"program": "${workspaceRoot}/main.rb"
		},
		{
			"name": "Listen for rdebug-ide",
			"type": "Ruby",
			"request": "attach",
			"cwd": "${workspaceRoot}",
			"remoteHost": "127.0.0.1",
			"remotePort": "1234",
			"remoteWorkspaceRoot": "${workspaceRoot}"
		},
		{
			"name": "Rails server",
			"type": "Ruby",
			"request": "launch",
			"cwd": "${workspaceRoot}",
			"program": "${workspaceRoot}/bin/rails",
			"args": [
				"server"
			]
		},
		{
			"name": "RSpec - all",
			"type": "Ruby",
			"request": "launch",
			"cwd": "${workspaceRoot}",
			"program": "${workspaceRoot}/bin/rspec",
			"args": [
				"-I",
				"${workspaceRoot}"
			]
		},
		{
			"name": "RSpec - active spec file only",
			"type": "Ruby",
			"request": "launch",
			"cwd": "${workspaceRoot}",
			"program": "${workspaceRoot}/bin/rspec",
			"args": [
				"-I",
				"${workspaceRoot}",
				"${file}"
			]
		},
		{
			"name": "Cucumber",
			"type": "Ruby",
			"request": "launch",
			"cwd": "${workspaceRoot}",
			"program": "${workspaceRoot}/bin/cucumber"
		}
	]
}

This is simply overwhelming and I believe it should be improved with the following:

  • cwd should not be in every configuration, instead the default value should be ${workspaceRoot}. You can register a DebugConifgurationProvider which will just resovle every launch configuration by appending "cwd": ${workspaceRoot}
  • All these configurations should be contributed also as snippets, since then they would be offered in inteli-sense when user presses Add Configuration blue button. Example
  • When the launch.json needs to be generated the suer should be asked via QuickPick what kind of launch configuraiton he wants. Based on his response we should just generate that configuration, and not all of the above. If you are interested in doing this I can point you to an example I will write in a couple of days.

All of this should be pretty straightforward. Please let me know if you need help.

Activity

  1. wingrunr21 commented on Nov 9, 2018

    @wingrunr21
    Collaborator

    Hi @isidorn

    Thank you for the suggestions. A PR would be most helpful but otherwise I'll get to it when I get to it.

  2. isidorn commented on Nov 9, 2018

    @isidorn
    Author

    @wingrunr21 this milestone I am doing this for 10+ extension so doing 10+ PRs for me does not really scale for me.
    So it would be awesome if you do this when you find the time. I can help with questions of course.

  3. wingrunr21 commented on Nov 9, 2018

    @wingrunr21
    Collaborator

    Understood. The comment was also geared towards others viewing this issue. My work on this extension is only in my free time and I've got much bigger fish to fry in this extension right now.

    As it stands, the debugger requires quite a bit of love in this extension in general. So, this will get done when I get a PR for it or I get time.

    Thanks

  4. isidorn commented on Nov 9, 2018

    @isidorn
    Author

    I will create a help-wanted issue in the vscode repository which links to this one.
    Since we have a big traffic of contributers, somebody might show up

  5. YisraelV commented on Nov 30, 2018

    @YisraelV
    Contributor

    @isidorn can you tell me of any extension that uses the quickpick so I can have a look?

  6. isidorn commented on Nov 30, 2018

    @isidorn
    Author

    @YisraelV sure, here's an example microsoft/vscode-docker#618
    But I think this extension needs some more love with regards to debugging.
    @wingrunr21 would be best to provide exact pointers here.

  7. YisraelV commented on Nov 30, 2018

    @YisraelV
    Contributor

    @wingrunr21 thought I'd follow the first post suggestions

    1. only one configuration is created depending on selection in ui.
    2. the rest of the suggestions are available through snippets.
    3. cwd is not shown and gets a default of workspace root

    What do you think?

  8. wingrunr21 commented on Nov 30, 2018

    @wingrunr21
    Collaborator

    Sounds good to me. I can push these changes out with a few of the other changes staged in master.

  9. wingrunr21 commented on Dec 9, 2018

    @wingrunr21
    Collaborator

    This should be resolved by #408.

  10. YisraelV commented on Dec 9, 2018

    @YisraelV
    Contributor

    @wingrunr21 thanks for taking the time to merge.

  11. isidorn commented on Dec 10, 2018

    @isidorn
    Author

    Awesome work, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions