Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix InlinedAnnotationSupport#isInVisibleLines #2580

Conversation

tobiasmelcher
Copy link
Contributor

isInVisibleLines uses a cached endOffset variable which is not correctly invalidated when ProjectionSupport is enabled.

cached endOffset variable is only reset in callback documentAboutToBeChanged but not in documentChanged which is not sufficient.

Scenario:

  1. document.replace(...) is called
  2. documentAboutToBeChanged is called and endOffset is set to null
  3. source viewer repaint event is triggered (between documentAboutToBeChanged and documentChanged) and code minings are drawn, isInVisibleLines is called with the old not yet updated document and endOffset is set. The repaint event is only triggered in this timeslot when ProjectionSupport is installed on the SourceViewer.
  4. documentChanged called; now document is up to date but endOffset cache contains outdated value of the old document
  5. code minings at end of document are no longer rendered because isInVisibleLines returns false (which is not correct)

@eclipse-platform-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

tests/org.eclipse.ui.editors.tests/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From ff21a44ff0a99e9f4d2395e1849588c11c744d9e Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <[email protected]>
Date: Tue, 3 Dec 2024 17:57:45 +0000
Subject: [PATCH] Version bump(s) for 4.35 stream


diff --git a/tests/org.eclipse.ui.editors.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.ui.editors.tests/META-INF/MANIFEST.MF
index 74a27a2c7f..506d79157e 100644
--- a/tests/org.eclipse.ui.editors.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.ui.editors.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.ui.editors.tests;singleton:=true
-Bundle-Version: 3.13.600.qualifier
+Bundle-Version: 3.13.700.qualifier
 Bundle-Vendor: %Plugin.providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.jface.text.tests.codemining,
-- 
2.47.0

Further information are available in Common Build Issues - Missing version increments.

Copy link
Contributor

github-actions bot commented Dec 3, 2024

Test Results

 1 821 files  + 1 821   1 821 suites  +1 821   2h 0m 53s ⏱️ + 2h 0m 53s
 7 727 tests + 7 727   7 498 ✅ + 7 498  228 💤 +228  1 ❌ +1 
24 342 runs  +24 342  23 594 ✅ +23 594  747 💤 +747  1 ❌ +1 

For more details on these failures, see this check.

Results for commit c983d93. ± Comparison against base commit ce9874f.

♻️ This comment has been updated with latest results.

@tobiasmelcher
Copy link
Contributor Author

problem scenario documented with testInlinedAnnotationSupportIsInLinesReturnsValidResultAfterDocumentChange. It only occurs on windows, not on macOS.

tobias-melcher and others added 2 commits December 4, 2024 12:29
isInVisibleLines uses a cached endOffset variable which is not correctly
invalidated when ProjectionSupport is enabled.

cached endOffset variable is only reset in callback
documentAboutToBeChanged but not in documentChanged which is not
sufficient.

Scenario:
1. document.replace(...) is called
2. documentAboutToBeChanged is called and endOffset is set to null
3. source viewer repaint event is triggered (between
documentAboutToBeChanged and documentChanged) and code minings are
drawn, isInVisibleLines is called with the old not yet updated document
and endOffset is set. The repaint event is only triggered in this
timeslot when ProjectionSupport is installed on the SourceViewer.
4. documentChanged called; now document is up to date but endOffset
cache contains outdated value of the old document
5. code minings at end of document are no longer rendered because
isInVisibleLines returns false (which is not correct)
@mickaelistria mickaelistria force-pushed the InlinedAnnotationSupport_isInVisibleLines branch from 2ec90de to c983d93 Compare December 4, 2024 11:29
@BeckerWdf
Copy link
Contributor

failing test are unrelated

@BeckerWdf BeckerWdf merged commit ea68ca2 into eclipse-platform:master Dec 5, 2024
15 of 17 checks passed
@BeckerWdf BeckerWdf added this to the 4.35 M1 milestone Dec 6, 2024
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