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

Send custom message to Python extension in VS Code for justMyCode #170

Closed
Anapo14 opened this issue Oct 18, 2019 · 9 comments
Closed

Send custom message to Python extension in VS Code for justMyCode #170

Anapo14 opened this issue Oct 18, 2019 · 9 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Anapo14
Copy link
Contributor

Anapo14 commented Oct 18, 2019

We are learning that most users are struggling to discover the justMyCode warning message we print in the debugger console when they attempt to step into library and have the toggle set to 'true'. It would be great if we could send a custom message to the python extension and let the extension-side handle the action of pulling focus to the console,better alerting users about the justMyCode warning. We could even have a pop-up that allows the user to disable the setting as well as a 'learn more' link included in the notification that leads to a screenshot/example in the docs displaying the behavior.

@int19h
Copy link
Contributor

int19h commented Oct 18, 2019

A popup is probably a better idea here.

Do we want this to be a specific message for JMC specifically, or a more generic one that'll allow us to do other popup notifications in the future?

@karthiknadig
Copy link
Member

We need a generic mechanism for this. We really need a API in VSCode to handle custom reverse requests. Until that point this should be an event.

@Anapo14
Copy link
Contributor Author

Anapo14 commented Oct 21, 2019

A more generic one @int19h. +1 to Karthik.

@int19h int19h transferred this issue from microsoft/ptvsd May 4, 2020
@int19h int19h added the enhancement New feature or request label Jun 19, 2020
@fabioz
Copy link
Collaborator

fabioz commented Mar 26, 2021

I think we may also want to show a message in case a breakpoint is disabled due to justMyCode (i.e.: the VSCode UI isn't great at the moment: #572).

@judej judej added this to the Dev 17.1 milestone Oct 20, 2021
@int19h
Copy link
Contributor

int19h commented Oct 26, 2021

@fabioz, since you're already touching the relevant code in #766, do you want to add the custom message, as well?

@fabioz
Copy link
Collaborator

fabioz commented Oct 26, 2021

Sure... this will also need something in the VSCode Python side (which is probably most of the work to have this implemented), so, it'd be nice to have the format which would be expected in the client defined to implement this feature.

I think that a straightforward way could be just adding some json data to the existing output event and then have the UI act on it.

@int19h
Copy link
Contributor

int19h commented Oct 26, 2021

Since the ask was for a generic mechanism, I think re-using "output" makes a lot of sense. But I don't think we can use "data" alone, since the spec says it will be pretty-printed out.

Now, in the DAP spec for "output", the "category" property allows for arbitrary strings. So we can add a new category - say, "warning"? And then the message goes into "output" - and I don't think we need "data" then.

@karthiknadig, what do you think?

@int19h
Copy link
Contributor

int19h commented Nov 30, 2021

DAP now has the "important" category that is exactly this: microsoft/debug-adapter-protocol#218

It's not implemented in the VSCode client just yet, but it's already scheduled: microsoft/vscode#138091

Note that existing clients are already required by the spec to implement any unknown value as "console", so we can switch right away without having to wait for VSCode.

@karthiknadig
Copy link
Member

DAP now has the "important" category that is exactly this: microsoft/debug-adapter-protocol#218

This is fantastic.

fabioz added a commit to fabioz/debugpy that referenced this issue Dec 17, 2021
fabioz added a commit to fabioz/debugpy that referenced this issue Jan 20, 2022
fabioz added a commit to fabioz/debugpy that referenced this issue Jan 20, 2022
@fabioz fabioz closed this as completed in 0105bd9 Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants