How to get breakpoints insertion order in theia

We are using the theia editor breakpoint for debugging purposes and we need to restrict them to use the breakpoint based on the count which we are receiving from the backend.

We have the enabled/disabled flag to update the restriction.

For e.g, if the max breakpoint support is 6 and the if we place the breakpoint more than 6 we are showing the popup to enable unlimited breakpoint or not. if the unlimited breakpoint is not enabled then we need to remove the current line breakpoint.
Also if we already enabled unlimited breaking and in any case if we restricted in between need to remove the breakpoint by placing an order.

Could someone update the is there any way theia maintain the breakpoint insertion order?

@sathiskumar thank you for the discussion, if you haven’t already I’d suggest you take a look at our BreakpointsManager. You can use it to maintain your own insertion order or history by listening to the breakpoint change events. From it you should have the necessary information of what breakpoint you want to replace, or restrict your users from adding more. The actual restriction would need to be done on your side as well.

Note: the debug extension is quite complicated to modify and extend with dependency injection so there is likely to be some pain points along the way.