Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ensure that new editors get unique ids #16455
This restores the behavior from when
Description of the Change
With this change, editors opened after restoring the window state will get assigned IDs starting from
An alternative could be to select the lowest available unique ID. This would require a more complicated ID generator, but is certainly possible if a more dense ID space is desirable.
Why Should This Be In Core?
Assuming that editor IDs are supposed to be unique, this is a bug in core.
Packages that look up editor instances by ID will be able to resolve to the correct editor.
I'm not aware of any drawbacks.
I'm not very familiar with writing jasmine tests, but I gave it a shot. If someone more experienced could provide guidance, I'd be happy to expand this a bit. I would personally prefer a test that actually checks for uniqueness of all IDs after initializing the workspace with a mixture of deserialized and "fresh" editors. The test I wrote is more a test of the exact bug this PR fixes, than protection against future regressions. I confirmed that it fails before this fix and passes after, at least...