Open files from imported projects on first run after update.#9464
Open files from imported projects on first run after update.#9464neilcsmith-net wants to merge 1 commit into
Conversation
|
seems to work pretty well! |
|
Thanks @mbien I've pushed an update that checks and stores the build number so that this only triggers on first run after import. I think that might be more efficient and better matches the purpose of this change? |
|
I didn't mind the first version since it ran in ~1ms on EDT which is probably not noticeable. The only suggestion I would have had was to change boolean hasEditor = wman.getModes().stream()
.filter(mode -> wman.isEditorMode(mode))
.flatMap(m -> Stream.of(wman.getOpenedTopComponents(m)))
.anyMatch(tc -> tc.getLookup().lookup(DataObject.class) != null); |
mbien
left a comment
There was a problem hiding this comment.
Preferences version looks also good (also a little faster)
I think the idea behind making it version based is that it allows the property to be imported (a boolean would break the logic here).
|
Thanks. I should have used |
|
maybe worth mentioning that this will only open files which actually belong to a project. E.g it didn't open |
|
I've added an extra note that explains why I said it partly resolves the issue. |
Open files from imported projects on first run after update. This follows on from #9449 and uses the now imported attributes to maintain the open files after updating the IDE. This (partly) resolves #9443 - it does not reopen files that are not part of a project.
The code first checks whether any editors are already open, otherwise it interferes with the last focused tab on subsequent runs. The other option would be to check for first run after update, but I'm not sure we have an easy way to do that?Updated to check and store the build version in the project list preferences so that it only executes on the first run after an import.The real project is extracted from the project lookup as the configuration cannot be read using the ergonomics wrapper project. (bug??)