-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
[bndtools] Undo functionality not working #4433
Comments
I can reproduce this issue at will in my Eclipse installation, which is 2020-09. But when I run it out of the Eclipse workspace which uses 2018-12, the issue does not manifest. This makes a bit hard to debug. I'll need to come up with a Moreover, I can see that there is no special undo handling implemented in |
Just noting that upgrading to Eclipse 2020-12 didn't seem to fix this problem either. |
I have also seen the undo not working for a Java source file. I am using 2020-12. So perhaps the issue is something in Eclipse itself since it also happened on a Java source file as well as a Bnd file. |
There might be other issues with undo in Java, but this issue with the Bnd(run) editor is very specific and repeatable - the undo command gets redirected to the last editor opened, not in the editor that was active when the command was issued. I can manifest this bug at will with Bnd(run) files, but the same set of steps doesn't manifest with JDT's Java editor or even Eclipse's plain text editor. There may be some other undo issues with Java, but I suspect that they are not directly related to this issue. I suspect that this is a Bndtools bug. I've managed to get a resolving Eclipse 2020-09 instance in my Bndtools workspace (thanks to #4479) that I can launch and run through the debugger, so I should be able to get to the bottom of it soon. |
Ok, debugging this is proving to be a bit more of a nightmare than I had anticipated. I can reproduce the bug and step through it in the debugger, but the bit of code where I think stuff is going wrong is in EclipseContext which is frequently called for many reasons, so I need to set a conditional breakpoint to get it to stop at the interesting part - otherwise it stops all the time and there's a lot of manual stepping to do. Unfortunately, I hit #4506, but now I have a work-around. |
Just making a note on an important finding: given that this bug does not seem to affect other subclasses of TextEditor, I thought perhaps the reason might be that our text editor is a page in a multi-page form editor. To rule this out, I tried creating two PDE projects to see if the PDE manifest source editor had the same problem. For reference, it does not - you can have two PDE editors open for two separate manifests in two projects, and the undo histories remain independent. So it should be possible for this to work as a page in a multi-page form. I will keep digging. |
We ran into the exact same bug as described here. The issue was a missing <extension point="org.eclipse.ui.editors">
<editor
name="Spoofax dynamic editor"
contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
class="mb.spoofax.lwb.eclipse.dynamicloading.DynamicEditor"
id="spoofax.lwb.eclipse.dynamicloading.editor"
/>
</extension> |
@Gohla , thank you so much for this contribution[1]! I'll give this a try and hopefully it will fix this longstanding issue. I always thought it should be something simple missing, the difficult part was understanding which something... [1] Pun intended |
This fixes bndtools#4433 (undo not working in Bnd editors, among possible other things). Huge shout out to Gabriël Konat <g.d.p.konat@tudelft.nl> for this tip. Signed-off-by: Fr Jeremy Krieg <fr.jkrieg@greekwelfaresa.org.au>
A few of us had noticed that the undo functionality in Bndtools on Eclipse had gone a git awry. Often (always?) it doesn't work at all.
I think we had assumed that it was an Eclipse bug (on Slack, https://bugs.eclipse.org/bugs/show_bug.cgi?id=564366 was floated as a candidate). But what I've observed doesn't seem to apply to editing Java files - only bnd.bnd files. But I just observed something that might suggest otherwise and seems possibly related to some other weird issues I've seen with bndrun file editing (see #4202 for example). Forgive me for the long-winded description here; I'm not sure if I'll be able to reproduce it so I want to experiment and capture everything I'm doing while I've still got the issue happening.
So I think the summary from the above is: whenever you open a new Bnd editor, it seems to steal the "undo focus" from whichever Bnd editor had it. When you close that editor, the focus does not seem to return to any other Bnd editor.
This also explains why some of us had seen it and others not, or why we'd only seen it sometimes - if you freshly open a new file and start editing it, undo will work. But if you often have multiple editors open and switch between them, it won't work.
I just double checked and the same applies to Bndrun editors. There doesn't appear to be any cross-contamination between Bnd and Bndrun editors; it seems to remain "in the family".
It is possible that this is still an Eclipse issue; but it's also possible that we're doing something wrong with our working copy management that has exposed this bug. Not handling working copies properly could also cause other weird issues like #4202. Another possibility is a problem in BndEditModel somewhere.
I recall at some point it used to be the case that when you tried to open
A couple of possibly-related bug fixes that may have contributed:
The text was updated successfully, but these errors were encountered: