Build Project shortcut is broken when Stratego editor is focussed (2)
Since feb 25 or 26 the Ctrl+Alt+B shortcut to build the project does not work anymore. Both on OSX and Windows.
Going to the menu: build project (by mouse) works fine.
Preferences > General > Keys > Build Project shows no key binding conflicts.
Changing the key binding to Ctrl+B doesn’t work either (removing it from build all as keybind). However Ctrl+B for build all works fine. So it seems to be happening after the key-bind triggers the build, the build just doesn’t start.Is anyone else running on nightly experiencing the same problem?
Submitted by Daco Harkes on 27 February 2014 at 22:25
Issue Log
I have the same issue on Linux since a day or two.
Same here, though I did not relate that to a particular version. In any case, as per Gabriel’s suggestion, just changing anything in the project’s xml file and saving it restores the build capability (once, that is). Is that also the same on your side?
For me changing and saving build.main.xml file also restores ctrl+alt+b.
I suspect that it has something to do with the current editor being a Stratego (or Spoofax editor), which somehow intercepts the shortcut, because the build project action in the project menu still works! It seems similar to the issue where a copy/paste with the keyboard in a Stratego editor would sometimes copy/paste from or into a different Stratego editor that was opened before.
I think you are right, I’ve noticed that it breaks after opening a str file.
The shortcut still works, if you focus to another view or editor. It’s only broken, when you focus an Spoofax (not only Stratego) editor.
It broke when I changed the selection provider in commit https://github.com/metaborg/spoofax/commit/55bc5bc48a2f657f33b4726970b076404e63be52
I’m now having a look into it.
Great :) Today I also noticed that it also happens in an NaBL editor, so it’s not just limited to Stratego editors.
I’ll have to blame IMP for this issue :-)
But I submitted a workaround: https://github.com/metaborg/spoofax/commit/5a066de35e393e3f300353864c43211f298cd906By default all editors in Eclipse support the shortcut, so even if you open a .str or .sdf3 file with a text editor (Open With -> Text Editor), the short cut works. However, to create support for the properties view, I had to extend JFace’s
TextSelection
by implementing JFace’sIStructuredSelection
. This turns the selection objects into bothTextSelection
andIStructuredSelection
instances and somehow IMP disables the shortcut because the selection is anIStructuredSelection
. I think IMP tries to obtain the projects that need to be build via theIStructuredSelection
or something, but fails to do so. There are indeed someif (selection instanceof IStructuredSelection) {...} else {...}
statements in IMP’s code but I haven’t been able to figure out where it’s actually happening.The workaround simply doesn’t turn the selections into
IStructuredSelections
if the editor doesn’t provide a properties view. This means that since SDF and Stratego editors do not provide a properties view, you can always build your projects when such an editor is open.
I guess this workaround will do for now. Either we need to further investigate IMP’s code, or simply wait until we removed our dependency on IMP.
Log in to post comments