Skip to content

Prevent Target Editor reverts for marker-only resource changes - #2414

Merged
merks merged 1 commit into
eclipse-pde:masterfrom
vlakn:prevent_target_editor_revert_on_marker_updates
Aug 7, 2026
Merged

Prevent Target Editor reverts for marker-only resource changes#2414
merks merged 1 commit into
eclipse-pde:masterfrom
vlakn:prevent_target_editor_revert_on_marker_updates

Conversation

@vlakn

@vlakn vlakn commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

The issue first surfaced with the m2e PDE integration, which triggers marker updates while editing a .target definition. These marker updates cause TargetEditor to revert the editor, discarding unsaved source-page input.

The behavior is not specific to m2e. Creating a bookmark on the open .target file also produces a marker-only resource delta and triggers the same revert.

For example, enter any unsaved XML change in the source page and then create a bookmark on the .target file. The Target Editor discards the working copy although the file content remains unchanged.

This change prevents the Target Editor from reverting unsaved source-page edits when the workspace reports a marker-only change for the opened .target file.

Background

Commit 68642a1 extended TargetEditor.doRevert() to also revert dirty text-editor pages.

TargetEditor.InputHandler.resourceChanged() currently invokes doRevert() for every IResourceDelta.CHANGED delta on the target file. This includes marker-only deltas, although they do not alter the target definition content.

With the m2e PDE integration installed, workspace refreshes and marker updates trigger such deltas. While editing the XML source page, typing a character such as < then discards the unsaved working copy.

Before

Target_Editor_Before

After

Target_Editor_After

@merks merks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like a nice simple change to fix behavior that drives me crazy. 😕

@vogella

vogella commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Ah, that is that? Drove me also crazy, I always assumed that it is the XML language server.

@merks

merks commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Ignore the license failure, it's been flaky again:

Received an error response from the Eclipse Foundation

@vogella

vogella commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Big thanks @vlakn for this fix

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Test Results

  129 files  ±0    129 suites  ±0   37m 7s ⏱️ -13s
3 531 tests ±0  3 477 ✅ +40   54 💤 ±0  0 ❌  - 40 
9 396 runs  ±0  9 266 ✅ +40  130 💤 ±0  0 ❌  - 40 

Results for commit e06b3b5. ± Comparison against base commit b5aa639.

@HeikoKlare HeikoKlare left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some manuel testing of the change (in particular that marker/bookmark changes do not revert changes of the editor content) and found everything to work fine so far.

Awesome to have this fixed. Thank you, @vlakn!

@merks

merks commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

FYI, I manually test this in a self-hosted launch, first reproducing the problem (with the language server stuff in the target platform), then applying the patch to verify that the reverts don't happen, and then also verifying that if I edit the file via a different editor and save, the revert does happen.

So this looks great! 🏆 🏅

@merks
merks merged commit e15c569 into eclipse-pde:master Aug 7, 2026
18 of 19 checks passed
@vlakn
vlakn deleted the prevent_target_editor_revert_on_marker_updates branch August 7, 2026 15:11
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.

4 participants