New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate into 'launch.json' usability improvements #13353
Comments
After discussions with @weinand we have decided to introduce top level comments in the generated 'launch.json' which can point to some documentation (depending on the debug adapter). In the node case they point to https://go.microsoft.com/fwlink/?linkid=830387 . Due to that we need to imporve our documentation for 'launch.json', there is an issue which is tracking this microsoft/vscode-docs#450 Instead of using smart indentation we have decided to remove all configurations which are not needed for the initial experience and which had the default value if not set anyways. Apart from that we also use a heuristic that we add the With all of this put together, here is how previously an initial 'launch.json' looked.
And here is the current structure. Much more clean and easier to use IMHO
Feedback on the current strcture are very welcome. |
In order to support this we changed how initial configurations are contributed by a command by the debug adapters. How this works in the current stable version is described here. We changed this a bit and decided to give the full power of generating the initial 'launch.json' to the debug adapters - if a debug adapter contributes a command for providing the initial launch configuration. The current node debugger is good example of this. Though there is some ugly string magic in order to make this possible for the node debug case here. For regular adapters this should be more straightforward as only the string content should be sent and no conversion from json is required. @weinand should we ping the debug adapter writers so they are aware of the change on time (before our next release notes)? |
@isidorn yes, please cc the 'usual suspects' (https://github.com/Microsoft/vscode-debugadapter-node/wiki/VS-Code-Debug-Protocol-Implementations) for this issue. |
Is this a breaking change? |
@felixfbecker forgot to mention - we will still support contributing the 'initialConfigurations' from the 'package.json' of a debug adapter. But that approach has less power as it is impossible to add comments using that approach. However it is a breaking change in a sense that contributing the 'initialConfigurations' via a command now always has to return the full content of a 'launch.json' - and not only the 'configurations' part. |
Okay, haven't implemented the initialConfigurations request yet, so shouldn't break anything on my side. Will you bump the major version then if this is a breaking protocol change? |
I suggest to
{
"type": "node",
"request": "launch",
"name": "Launch",
"program": "${workspaceRoot}/bin/www", // from package.json/'main'
"args": [],
"cwd": "${workspaceRoot}" |
reopening to continue the discussion |
|
@egamma yes, |
@pieandcakes @edumunoz for visibility. If I read this correctly, we should be expecting our debug adapters to just stop working in the near future. Is this already checked in? What is the best way to test? |
I like this change, since I always thought the initial configs were a little overwhelming at first look, and I like stripping them down to the bare minimum. |
I would also like colorizing type/request - @felixfbecker I see them as special in that if you change one, you've totally changed the config and probably have to start over/change lots of other fields. If you need to edit a launch config, you probably start with the other fields, so makes sense to emphasize them. |
Awesome changes to make @delmyers, my understanding is that this shouldn't break our existing C++ debug adapter given what @isidorn mentioned here:
|
There are two primary reasons PowerShell folks even need to go into The second reason is to set the "startup script". Right now the PowerShell package json configures the launch.json BTW as a PowerShell user, I really wish "program" was called "script" as that is the proper vernacular in PowerShell. :-) What if I could right click on a file in the Explorer and click "Set as debug start program/script"? I'd like that. And selecting that same menu item again would toggle it off. If no "file" is set as the debug startup program/script, then the default behavior would be pulled from the Comments and docs would be nice but it only goes so far |
BTW |
@rkeithhill Isn't there I also think there needs to be a way to define args without touching launch.json. PHPUnit doesn't have |
@felixfbecker RE |
@delmyers We will need to do work for this but I assume then we can control which launch.json parameters to provide based on their OS without the user seeing other parameters that are not for their OS. I'll create a task and we can schedule the work. as @edumunoz and @isidorn mentioned, it seems like they will be backwards compatible for at least the near future. |
@felixfbecker you could use the same approach as @jrieken in #12735 for asking the user for a specific test. |
@rkeithhill above you said "BTW as a PowerShell user, I really wish "program" was called "script" as that is the proper vernacular in PowerShell. :-)" You are free to rename "program" to "script" because that is defined in the schema of your extension |
One question: the support for providing the initial launch.json from a command like the mock adapter does, is this something that is in VS Code today? Is it going to stick around? For C#, we would much rather generate launch.json from the language service than the debug adapter. So having an extension command sounds good. |
@gregg-miskelly we shipped this feature in the September release: |
After taking into account the feedback here is how the initial 'launch.json' for node now looks in dark and light theme Closing this as we have added the initial features which we wanted. I expect seperate issues and feature requests on how to further improve this. We are graying out the 'type', 'request' and 'version' since the user is usually not interested in editing those. All debug adapters should profit from this. |
I still disagree. Of course I as a user am interested in editing those. When I want to add a new configuration, I actually have to edit those. |
So, 👎 |
@MythicAngel VS Code always supported comments in all of its own setting files including launch.json. We were just not using them until this change. |
Invalid JSON in a file with extension No problem from my side, I'm just a normal (read: js, sql and php) user of vscode and didn't even know about the comment thing in settings area. |
@MythicAngel I proposed this once: #4851 |
Yes, this was already discussed in #4851 and the argumentation is still valid. |
While simplifying the config and reducing information overload are good, I think the syntax highlighting could be improved. I agree with @felixfbecker . As user of course I'm interested in my debug target's name, as it's the label I'll be dealing with in Debug Viewlet. I certainly care if it's Contrary to what the highlighting suggests, the currently grayed-out options are the most important ones. |
Okay, I've been using this new highlighting for a week now in insiders and want to share my honest feedback. I can only say it is horribly confusing. At first sight it just looks like the highlighting is plain broken. But it also goes against the point of syntax highlighting. Syntax highlighting is there so I can read/scan code quicker. In the JSON case that means keys and values are colored differently. So in my mind I scan the JSON from top to bottom and "read" the keys and their values. And of course I also scan the target and request, no matter if they are "important" in your opinion or not, because the eyes just go from top to bottom. Having both the key and the value grey just makes it harder to scan the whole file, it disturbs. Besides that, the claim that these are not edited is wrong - adding a new launch config for me means selecting an existing, and using the keyboard shortcut to copy the lines down. And then go and edit the values, including request and type. |
This is great feedback, thanks a lot! |
And after using regularly for a week, I still like it :) I am often looking at launch configs and toggling 'sourceMap', or changing the args or program, but a 'node' launch config will always be 'node', so I want to focus on the props that distinguish one 'node' launch config from another. And I can still edit the other props if needed, but rarely do. My only concern would be that it's not obvious at first why it's gray. Will people think that those lines are somehow disabled? |
I should mention that I also have many projects with mixed launch configs. For example a repository with configs for debugging the PHP backend, the Chrome frontend or the Gulp build script. |
My 2 cents here after using it for a week. As I'm using a color theme I wrote, at the first sight of this feature, the first thing that came into my mind is |
@weinand Is there an officially supported way to declare a configuration attribute as deprecated? Right now I'm leaving in |
would be nice to set |
@rkeithhill no, it is not yet possible to declare a configuration attribute as deprecated. I've created this feature request: #14260 |
We need to make the whole 'launch.json' experience more user friendly. Some ideas from @egamma:
fyi @weinand
The text was updated successfully, but these errors were encountered: