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
Issues/77879 #79065
Issues/77879 #79065
Conversation
if (debugService.getConfigurationManager().canSetBreakpointsIn(editor.getModel())) { | ||
return debugService.addBreakpoints(modelUri, [{ lineNumber: position.lineNumber }], 'debugEditorActions.toggleBreakpointAction'); | ||
} | ||
const lineNumbers = new Set(editor._getCursors().getAll() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use editor.getSelections()
instead of editor._getCursors
.
That is the proper API (I just double checked)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I did this I thought the Selection object was for highlighted text only, realized later on that was not the case. I made this change. In using the Selection object I am only considering the line the cursor is on. I could have done all lines that are selected, since the original did not do this, I did not either.
.filter(cs => cs.modelState.position) | ||
.map(cs => cs.modelState.position.lineNumber)); | ||
|
||
const promises = Array<Promise<any>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for this promises array.
You can just say return Promise.all(lineNumbers.map(..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this change. Only reason I was doing that before is because there is the possibly to remove multiple breakpoints from a line, resulting in multiple promises for one iteration. I just wrapped that with a Promise.all so they resolve correctly.
Thanks for your PR. It looks good and it works fine. |
Looks great, thanks a lot for your contribution! Merging in 👏 |
#77879