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

Support for editing 'accessType' property of data breakpoints #113922

Closed
yannickowow opened this issue Jan 6, 2021 · 9 comments · Fixed by #117835
Closed

Support for editing 'accessType' property of data breakpoints #113922

yannickowow opened this issue Jan 6, 2021 · 9 comments · Fixed by #117835
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-release-notes Issue/pull request mentioned in release notes on-testplan release-notes Release notes issues
Milestone

Comments

@yannickowow
Copy link
Contributor

Regarding #83649 ( @isidorn )

As discussed in previous issue about DataBreakpoints support, it can be great if VS Code can surface a user interface to create and edit Data Breakpoints regarding to their attributes, such as read, write, readWrite for access type and condition/hitCondition.

Thanks

@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jan 6, 2021
@weinand weinand added this to the On Deck milestone Jan 6, 2021
@weinand weinand added the feature-request Request for new features or functionality label Jan 6, 2021
@weinand weinand changed the title Support for DataBreakpoints edit in user interface Support for editing DataBreakpoint access property Jan 6, 2021
@weinand weinand changed the title Support for editing DataBreakpoint access property Support for editing 'accessType' property of data breakpoints Jan 6, 2021
yannickowow added a commit to yannickowow/vscode that referenced this issue Mar 5, 2021
yannickowow added a commit to yannickowow/vscode that referenced this issue Mar 5, 2021
@weinand weinand modified the milestones: On Deck, March 2021 Mar 8, 2021
@isidorn
Copy link
Contributor

isidorn commented Mar 11, 2021

@yannickowow thanks for your request and thanks for your PR, I will comment here for both.

Overall I think this makes a lot of sense, however since not a lot of debug extension use data breakpoints I would suggest the following approach:

  • Add the ability to edit condition and hit condition of Data breakpoints in VS Code. That way data breakpoints will be aligned with other breakpoints
  • Look into making the breakpoints menu contributable. That way extensions can contribute read, write, readWrite commands for data breakpoints

If we decide to go down this approach then my suggestions are the following:

 { 
type: 'breakpoint' | 'exceptionBreakpoint' | 'functionBreakpoint' | 'dataBreakpoint',
name?: string;
id?: string;
  • I can make the breakpoints menu contributable
  • With those context the extension can easily identify on what breakpoint the user is triggering the action. And the extension could use the quick pick for input of a command

@weinand @yannickowow Let me know what you think. I personally like this approach because:

  1. less code is added to vscode
  2. we are opening up breakpoints view to contributions which can benefit other extensions as well

@weinand
Copy link
Contributor

weinand commented Mar 11, 2021

@isidorn Why is there a need for having contributable commands for DataBreakpoint access types?

The DataBreakpointInfoResponses returned by the DataBreakpointInfoRequest are the possible data breakpoint candidates and as such offer a set of 0-3 possible DataBreakpointAccessTypes: none (=write), read, write, readWrite.

Today VS Code only show this context menu action (which is basically for the "write" access type):

2021-03-11_18-08-19

When starting to respect the DataBreakpointAccessType we just have to provide the possible menu actions (or a submenu), e.g. "Break when value changes", "Break when value is read", "Break when value is read or changes". Picking one of them just fills in the DataBreakpointAccessType in the newly created data breakpoint.

@yannickowow
Copy link
Contributor Author

yannickowow commented Mar 11, 2021

Actually, my PR is "updating" the current Break When Value Changes behaviour depending on DataBreakpointAccessTypes attributes (as you can see in the screenshot in the previous reply from weinand).

In my opinion, adding contributable commands for breakpoints can be great (!), but I do not think it will (or can) replace integrated commands, in order to respect DAP implementations. Removing currently supported commands might suggests a DAP update, or it might suggests that Visual Studio Code will not fully implement this protocol...

To do my implementation, I modified current supported command to be aware of accessTypes attributes. This issue was also mentioned here (#83649) :

  • VS Code didn't respect the accessTypes attribute of DataBreakpointInfoResponse. When it returns an array ['read', 'write', 'readWrite'], right click the variable, the menu only shows Break When Value Changes.

When AccessTypes returns ['readWrite', 'write']
image
When returning ['read']
image

I did assume the previous implementation was a "default" one, and then returning an empty array is equivalent to "write" ("Break When Value Changes")

Regards.

@weinand
Copy link
Contributor

weinand commented Mar 11, 2021

@yannickowow Yes, a missing "accessTypes" property or an empty array means "write".
So what you did for the Variable view's context menu looks good to me (and is all we need).

And you are right, today VS Code does not fully implement the spec.

(Note to myself: why is there a "readWrite" value if "accessTypes" is already an array which allows to specify ["read", "write"]...)

@isidorn
Copy link
Contributor

isidorn commented Mar 11, 2021

I do agree with what you are saying, that in order for VS Code to fully implement the Spec these should be integrated commands.
What I was trying to say is: I am not sure how popular these commands are going to be, and VS Code already does not fully implement the DAP spec, some parts of the DAP spec we simply do not add to VS Code.
So my question is how important is it that VS Code implements the full DAP data breakpoints spec?

I leave this decision to @weinand, just my hunch was that this was better suited in an extension and that the initial Data breakpoint support that we already have is enough - I did not get a single user (not extension writer) issue regarding data breakpoints for example so I am doubting their popularity. Once users start using data breakpoints I would be more passionate about adding further data breakpoints features. Though I might be wrong, just sharing my thoughts.

@weinand
Copy link
Contributor

weinand commented Mar 11, 2021

@isidorn The "Julia" team is asking for "accessTypes" support. I will dig out the issue...

From the VS Code roadmap:

Expose more UI for DAP features that are currently not surfaced in the VS Code debugging UI.

In this specific case I think the missing functionality of our current implementation is very small: and optionally showing the three missing actions does not involve lots of code. On the contrary: delegating the implementation to an extension would require much more effort on our side because of missing extension APIs.

@isidorn
Copy link
Contributor

isidorn commented Mar 11, 2021

Makes sense to me. I was just raising my concerns.
Anyways let me know how I can best help here.

@yannickowow
Copy link
Contributor Author

Actually, I may have some questions about updating accessType attribute in DataBreakpoint...
When modifying a DataBreakpoint, since accessPoint is unique, I don't know if it is ok to show it with "check" rather than a possible radiobutton...

image

@weinand
Copy link
Contributor

weinand commented Mar 11, 2021

@isidorn it was not the "Julia" team asking for this but "Java": it is the first item on this list of DataBreakpoint issues #83649

yannickowow added a commit to yannickowow/vscode that referenced this issue Mar 16, 2021
@weinand weinand added the release-notes Release notes issues label Mar 25, 2021
@isidorn isidorn added the on-release-notes Issue/pull request mentioned in release notes label Mar 26, 2021
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2021
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 insiders-released Patch has been released in VS Code Insiders on-release-notes Issue/pull request mentioned in release notes on-testplan release-notes Release notes issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@weinand @isidorn @yannickowow and others