Skip to content
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

Make run and debug welcome view extensible #85548

Closed
isidorn opened this issue Nov 25, 2019 · 17 comments
Closed

Make run and debug welcome view extensible #85548

isidorn opened this issue Nov 25, 2019 · 17 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-release-notes Issue/pull request mentioned in release notes on-testplan
Milestone

Comments

@isidorn
Copy link
Contributor

isidorn commented Nov 25, 2019

We need to introduce a contributable menu to the Debug: Start view such that each extension can contribute commands tehre.

We would have to enforce when context on top of these contributed commands just so the view does not end up being a jungle. For example when activeFile is python add the python commands.

An open question is how these contributed commands would look like, would it also be a blue button, or is there a ... affordance which when clicked shows all the contributed commands.

@isidorn isidorn added feature-request Request for new features or functionality debug Debug viewlet, configurations, breakpoints, adapter issues labels Nov 25, 2019
@isidorn isidorn added this to the December 2019 milestone Nov 25, 2019
@isidorn isidorn self-assigned this Nov 25, 2019
@isidorn
Copy link
Contributor Author

isidorn commented Dec 24, 2019

For now I believe a better approach is for each extension to contribute a view, for example microsoft/vscode-python-debugger#164

Due to that pushing this feature request out of this milestone and we can reconsider this in the future if needed.

@isidorn
Copy link
Contributor Author

isidorn commented Feb 19, 2020

Debug start view can now be contributed to. We still need to:

  • show button as disabled
  • add telemetry
  • render keybindings
  • figure out a context for extensions to use
  • make sure my buttons are at the top

fyi @joaomoreno

@gjsjohnmurray
Copy link
Contributor

This seems to have landed in today's Insiders. I noticed that we're getting a focus rectangle that doesn't occur on Stable:

image

@isidorn
Copy link
Contributor Author

isidorn commented Feb 20, 2020

@gjsjohnmurray correct. We decided to change that behavior, that focus is first passed to the view, and then the user can navigate to focus what button / text he wants. We think this makes the most sense from the accessibility standpoint.

@isidorn
Copy link
Contributor Author

isidorn commented Feb 20, 2020

@connor4312 @roblourens please note that the debug start view is now contributable to.
You could potentially add an action to open the Javascript Debugger.
I am still thinking about context keys and will keep you updated on that.
Here's an example how Git extension contributes a button to the explorer view

"view": "workbench.explorer.emptyView",

The id of the debug start view is workbench.debug.startView

fyi @weinand

@weinand
Copy link
Contributor

weinand commented Feb 20, 2020

I think the contributed action should open the debug terminal.

isidorn added a commit that referenced this issue Feb 21, 2020
@isidorn
Copy link
Contributor Author

isidorn commented Feb 21, 2020

After some pondering I decided on the following context key:
debugStartLanguage
This context key will be set to the last active editor language that has a debugger interested in it.

So for example, user opens a javascript file, and the open a json file.
The context key will have the value javascript. Since no debugger is interested in json files.
I believe this context key will convey the right notion of what a user is interested in debugging and not bring too much UI flickering.

Since context keys luckliy now support OR I I suggest that javascript debugger contributes a Debugger Terminal command when debugStartLanguage == javascript || debugStartLanguage == typescript.... All the language from here

If there are better ideas on what context key to use to not have the view cluttered I am open for suggestions.

@connor4312 let me know if you do not have time to contribute the "Debug Terminal" action and I can also provide a PR.

Follow up item to show button as disabled #91141

@isidorn
Copy link
Contributor Author

isidorn commented Feb 21, 2020

I will also store the value of the context key per workspace storage.
So when a user starts vscode again and has no editor open that we preserve the last language he was interetsed in. Thus the contributed buttons would still be there.

@joaomoreno
Copy link
Member

@isidorn Telemetry is in: a1f61fd

@isidorn
Copy link
Contributor Author

isidorn commented Feb 21, 2020

Thanks a lot! Very elegant :)

@joaomoreno
Copy link
Member

joaomoreno commented Feb 21, 2020

@isidorn And here are preconditions for button enablement (internal only): 0c1c8f2

@isidorn
Copy link
Contributor Author

isidorn commented Feb 21, 2020

Awesome, adopted it for debug. 🎉

@connor4312
Copy link
Member

I probably won't have time to do this before endgame, but would be happy to accept a PR or take care of it next iteration.

@isidorn isidorn added the on-release-notes Issue/pull request mentioned in release notes label Feb 28, 2020
@isidorn isidorn changed the title Make initial debug / run view extensible Make run and debug welcome view extensible Mar 6, 2020
@isidorn
Copy link
Contributor Author

isidorn commented Mar 6, 2020

Dear debug protocol implementers,

Debug welcome view is now supporting contributing welcome content via static package.json API.
Thus extensions can contribute text and buttons to the welcome view. The idea is to introduce actions and help text that should make it easier for users to start debugging.
Please note that we would like to keep this view not cluttered, thus we highly recommend that you use the context key debugStartLanguage. More about this context key can be found in my comment here.

API details here #89080
This is still proposed API and we are in the transition of making the API final - which should happen in the March milestone.
Example how to js-debug did this microsoft/vscode-js-debug@9e6dc67

image

@APerricone, @akaroml, @andysterland, @ayuckhulk, @DanTup, @daviwil, @devoncarew, @dibyendumajumdar, @DonJayamanne, @felixfbecker, @glennsarti, @gregg-miskelly, @hbenl, @iradul, @ivanbuhov, @joelday, @jpogran, @joshtynjala, @Kode, @miniwolf, @MSLaguana, @luabud, @lukaszunity, @ntotten, @phoityne, @pieandcakes, @ptrthomas, @raix, @richterger, @rkeithhill, @rebornix, @roblourens, @svaarala, @testforstephen, @vadimcn, @vshaxe, @WebFreak001, @weinand, @yurydelendik

@pieandcakes
Copy link
Contributor

@WardenGnaw

@raix
Copy link
Contributor

raix commented Mar 8, 2020

Do we have to support translations in the wellcome text?

@isidorn
Copy link
Contributor Author

isidorn commented Mar 9, 2020

@raix that would be great, since the welcome text is user facing and all user facing text should be translated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-release-notes Issue/pull request mentioned in release notes on-testplan
Projects
None yet
Development

No branches or pull requests

7 participants