Reload active target platform when its .target file changes#2354
Reload active target platform when its .target file changes#2354vogella wants to merge 1 commit into
Conversation
Watch the workspace file backing the active target definition and trigger LoadTargetDefinitionJob whenever its content is modified, so edits made through the editor, refactorings, or a git pull no longer require a manual "Reload Target Platform". Also record the file's modification timestamp on every load and, on workspace startup, compare it against the current value to catch changes made while the IDE was closed (covering both workspace .target files and external file: handles, which resource deltas cannot observe). Reloads are coalesced behind a short delay so a burst of file events (a refactoring, or a git pull touching the file several times) results in a single load instead of repeatedly cancelling and rescheduling an in-flight resolve.
0f5fb19 to
4593ad7
Compare
|
I found people are often wanting the opposite: Opening a target platform (e.g. without internet connection) can easily break your workspace as it leaves the active target in an somehow intermediate state. This has been acknowledged here even by yourself: #1030 (comment)
So what changes your mind and have you considered to make the behavior at least configurable? Especially on larger workspace a change in target change would mean update and possibly recompile a lot of projects, I'm not sure "a short delay so a burst of changes triggers a single load" is sufficient here either. As this is a major change in behavior at least this has to be discussed with a broader audience! |
|
Indeed. Also, given the fact that any resolution failure leaves a corrupted target platform state, the whole workspace could easily become unusable because of a refresh. I've not reviewed to see how this deals with saving a *.target file; that too triggers a delta... |
Automatically reloads the active target platform when its backing
.targetfile changes, so editing the file (in the editor, via a refactoring, or agit pull) no longer requires a manual "Reload Target Platform".Workspace files are watched through resource deltas; a modification timestamp recorded on each load also catches edits made while the IDE was closed, including external
file:targets that deltas cannot observe. Reloads are coalesced behind a short delay so a burst of changes triggers a single load rather than repeatedly cancelling an in-flight resolve.Adds tests covering the backing-file resolution and the auto-reload behaviour.