-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Merge add/remove functions into a single update/splice functions #42481
Comments
For breakpoints the order is irrelevant so "re-arrange" is not a useful operation. In addition the "splice" operation does not support deletion of arbitrary elements (only deletion of consecutive ranges). "splice" style API works fine for everything that is manipulated in ranges, e.g. text, or text-lines, and may be even workspace folders if their order is an important characteristic that results in many range-based operations. After having used the "updateWorkspaceFolders" for testing #42195 I know for sure sure that I do not want to use this API for breakpoints. |
Well, now the two of you better talk |
See my question #42642. |
I used to have a simple add/remove API but @alexandrudima filed #37301 so I think he should also chime in to give feedback on splice API vs. add/remove API. I am fine either way, I think what we are "working around" is the fact that an extension cannot make changes to the array directly, so we come up with methods that provide similar functionality. |
We do not need a general discussion about splice vs. add/remove API. There are pros and cons for both API styles in different situations. I have no problems with using the splice API for workspace folders because folders have an index and replacing folders for rename purposes profit from splice. But I do not want to use splice for the breakpoints API. Alex's arguments from #37301 do not apply for breakpoints:
|
re #42321
I believe this is very similar to modifying workspace folders which started with add/remove functions and ended with a single update function. The update allows for more operations, like re-arrange and removal/addition in one call.
fti @bpasero
The text was updated successfully, but these errors were encountered: