Skip to content

Reload active target platform when its .target file changes#2354

Draft
vogella wants to merge 1 commit into
eclipse-pde:masterfrom
vogella:reload-target-on-file-change
Draft

Reload active target platform when its .target file changes#2354
vogella wants to merge 1 commit into
eclipse-pde:masterfrom
vogella:reload-target-on-file-change

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Jun 3, 2026

Automatically reloads the active target platform when its backing .target file changes, so editing the file (in the editor, via a refactoring, or a git 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.

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.
@vogella vogella force-pushed the reload-target-on-file-change branch from 0f5fb19 to 4593ad7 Compare June 3, 2026 15:55
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Test Results

  126 files  ±0    126 suites  ±0   35m 50s ⏱️ +32s
3 512 tests +2  3 458 ✅ +2   54 💤 ±0  0 ❌ ±0 
9 339 runs  +6  9 209 ✅ +6  130 💤 ±0  0 ❌ ±0 

Results for commit 4593ad7. ± Comparison against base commit ffbbea8.

@laeubi
Copy link
Copy Markdown
Contributor

laeubi commented Jun 3, 2026

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)

I think we should rather only resolve on user request never automatically

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!

@merks
Copy link
Copy Markdown
Contributor

merks commented Jun 3, 2026

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants