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

How to remove action button and add new action button in breakpoints viewlet's action bar? #106263

Closed
Nina0408 opened this issue Sep 8, 2020 · 9 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster

Comments

@Nina0408
Copy link

Nina0408 commented Sep 8, 2020

Hi there,

I have some requests as below:

  1. How to add a new action button and remove a existing action button from breakpoints viewlet's action bar?
  2. How to customize the workflow of persisting breakpoint locations after debug session ended ?

I have not found any doc about it, Please help, Thanks very much!

@weinand weinand assigned isidorn and unassigned weinand Sep 8, 2020
@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Sep 8, 2020
@isidorn
Copy link
Contributor

isidorn commented Sep 8, 2020

  1. Not possible. Breakpoints action bar is not contributable to. Though I know @connor4312 wanted something like this
  2. Can you clarify this please, I do not know what you mean?

Are you writing an extension or?

@isidorn isidorn added the info-needed Issue requires more information from poster label Sep 8, 2020
@connor4312
Copy link
Member

Though I know @connor4312 wanted something like this

For my need I opened a DAP proposal (microsoft/debug-adapter-protocol#137) since it was a generic behavior and adding a button to the breakpoints view would not have been sufficient -- I also wanted to show these breakpoints, which is a large surface area that's not contributable to right now. I wonder if @Nina0408 will face the same issue...

@Nina0408
Copy link
Author

Nina0408 commented Sep 9, 2020

Thanks @isidorn
@connor4312 My request is to remove the "add function breakpoint " action button and add "remove the selected breakpoints" action button in below action bar.
屏幕快照 2020-09-09 上午9 18 56

My second issue is after the debug session ended, the debuggee file (with some breakpoints on it) will be deleted by our code logic, and at the next time, I will reload a new file with the same name and same content, the previous added breakpoints will not displayed on this new file when start debugging? so I guess the breakpoints information will be deleted when the file is deleted? am I right?

If I want to keep the breakpoints information and re-use it at next time , Can I take over the breakpoint management from vscode?

Thanks!

@weinand
Copy link
Contributor

weinand commented Sep 9, 2020

@Nina0408 yes, VS Code deletes breakpoints when the underlying file is deleted (or renamed).
Instead of deleting the file you could just replace the contents. Then the breakpoint will be preserved.
Or you can re-create the breakpoints through the extension API vscode.debug.addBreakpoint.

@isidorn please correct me if my suggestions from above are incorrect.
BTW, breakpoints are lost if a file is renamed. Why are we not updating the breakpoint instead?

@Nina0408
Copy link
Author

@weinand Thank you for your suggestion, I will try this API vscode.debug.addBreakpoint.

@isidorn
Copy link
Contributor

isidorn commented Sep 10, 2020

@weinand yes you are correct.
When the file gets renamed we probably get a delete event from the underlying fileService and we get rid of the breakpoints. There probably is not a rename event and that is the reason why we do not just update the breakpoints.

@Nina0408
Copy link
Author

Nina0408 commented Sep 11, 2020

Hi @weinand ,

As you suggested, use APIvscode.debug.addBreakpoints in DAP to reload the breakpoints.

So when the debuggee file is deleted, I plan to save the breakpoints line number list into a local file.
And next time , when the debuggee file is recreated, I will call API vscode.debug.addBreakpoints to add the breakpoints back.

But after I checked the api doc as below:
屏幕快照 2020-09-11 下午1 55 36

The keys of input parameter "Breakpoint" as below, There is no key for line number which is required to indicate the breakpoint location.
屏幕快照 2020-09-11 下午1 57 05

Please advice, Thanks!!

@weinand
Copy link
Contributor

weinand commented Sep 11, 2020

Breakpoint is the base class of all breakpoint types. You are interested in SourceBreakpoint.

@Nina0408
Copy link
Author

@weinand I see, Thank you very much!

@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2020
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 info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants