Bug 576377 - Provide shortcuts/commands for incremental multiselection/multiple carets in text editors
Summary: Provide shortcuts/commands for incremental multiselection/multiple carets in ...
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.22   Edit
Hardware: All All
: P3 enhancement with 3 votes (vote)
Target Milestone: 4.24   Edit
Assignee: Dirk Steinkamp CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 578525 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-10-01 03:58 EDT by Dirk Steinkamp CLA
Modified: 2022-03-25 08:45 EDT (History)
8 users (show)

See Also:


Attachments
Gif-Animation of add-to-multi-selection with keybinding (228.51 KB, image/gif)
2022-02-28 16:15 EST, Dirk Steinkamp CLA
no flags Details
Gif-Animation with extending and reducing selection by keyboard bindings (467.71 KB, image/gif)
2022-02-28 19:22 EST, Dirk Steinkamp CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Steinkamp CLA 2021-10-01 03:58:54 EDT
This is a follow-up to https://bugs.eclipse.org/bugs/show_bug.cgi?id=466532 / comments 66-68 and opened as a new ticket as requested.
------------------

Thanks for putting all the effort into the new multiselection/multiple carets - it looks great already!

Question/Suggestion: Would it be possible to have something like ATL-J in a well known other Java-IDE ;-) ... meaning: take the current selection and add another selection that matches the currently selected text?

I can't find anything of the likes in the most recent demo, and also not in the preliminary release notes for 4.22.

Example:

Given the code:
  public static final String a;
  public static final String b;
  public static final String c;

When:
- Selecting the first "public" (line a)
- pressing ALT-J

Then:
- the next found "public" gets added as a multi-selection (line b, when pressing again line c)


Variations:
- ALT-SHIFT-J removes the last added selection from the multiselection
- when invoked without a selection, the selection is automatically expanded to the currently selected (sub)word and this selection is then taken for multiselect
- ALT-SHIFT-J when only the original first selection area exists could add a new multiselection with a match *above* the original selection
- CTRL-ALT-SHIFT-J to select all matching occurrences


Here's an example of the basic functioning: https://www.facebook.com/watch/?v=1442031062486810

Thanks for considering! :-)
Comment 1 Rune Flobakk CLA 2021-10-01 06:02:25 EDT
Just wanted to add a small comment, for reference.
I have something like what you describe installed from here https://github.com/caspark/eclipse-multicursor. Really basic implementation, but is surprisingly effective in some editing cases.

However, it is no longer maintained. It works now, but will probably break at some point, and I have no idea how it will behave co-existing with the multi-caret feature of https://bugs.eclipse.org/bugs/show_bug.cgi?id=466532
Comment 2 Mickael Istria CLA 2022-02-06 04:47:55 EST
Adding a comment to "Also select next occurence" would be pretty straightforward to implement. The shortcut is another story, there is not much room left in Eclipse IDE for shortcuts... But at least having the command would allow individuals to bind it to some shortcuts via their preference already until a good shortcut is enabled by default.
Are you willing to contribute such a command?
Comment 3 Dirk Steinkamp CLA 2022-02-22 15:41:10 EST
(In reply to Mickael Istria from comment #2)

> Are you willing to contribute such a command?

@Mickael: not sure whom you're asking. If it's me: if I were able to, of course I would. Yet I have no idea yet what I would have to do, as I'm currently only a user of Eclipse, but have never done any work on the platform so far. How much effort does it take to set up an environment that would enable me to contribute something? Is there any documentation how to start, that you'd recommend?
Comment 4 Niraj Modi CLA 2022-02-25 10:18:24 EST
*** Bug 578525 has been marked as a duplicate of this bug. ***
Comment 5 Mickael Istria CLA 2022-02-28 11:36:10 EST
(In reply to Dirk Steinkamp from comment #3)
> How much effort does it take to set up an environment that
> would enable me to contribute something?

Just make sure you're using a recent build of Eclipse IDE, install Eclipse Plugin Development in it, clone https://git.eclipse.org/c/platform/eclipse.platform.text.git , import the org.eclipse.ui.workbench.texteditor project in it and create the commands (see plugin.xml) to manipulate multi-carets as desired.
Then you can test your code with Right-click > Run As > Eclipse application.
Those commands will immediately be available via Ctrl+3 in the "application under test", then you can try to bind those commands to some available shortcuts.

> Is there any documentation how to start, that you'd recommend?

I find most documentation too complex to start as they expect you to clone and open all projects. The lines above are IMO the simplest ones to start with.
Comment 6 Dirk Steinkamp CLA 2022-02-28 12:45:41 EST
(In reply to Mickael Istria from comment #5)

Thanks for the kickstart! 
I managed to follow your steps and as a first smoke test change the description of a command :-).

Only thing that didn't work right from the start was the repository:
https://git.eclipse.org/c/platform/eclipse.platform.text.git 

after looking it up I changed it to "r" and that worked:
https://git.eclipse.org/r/platform/eclipse.platform.text.git 

I'm gonna play around with it and see what I can accomplish regarding the commands. I guess I'll have to come back for some more help if I managed to get something working on my machine ;-).
Comment 7 Dirk Steinkamp CLA 2022-02-28 16:15:29 EST
Created attachment 288134 [details]
Gif-Animation of add-to-multi-selection with keybinding

First approximation of how it might work
Comment 8 Dirk Steinkamp CLA 2022-02-28 16:27:16 EST
(In reply to Mickael Istria from comment #5)

Your initial guidance was helpful: My first experiments seem to work somewhat ;-) ... see the attached gif for a first experiment with a keybinding.

Issues/Questions:

* The cursor on the first line is invisible. This also happens with the original "To Multi-Selection" feature. Any idea how to fix this?

* We need a way to stop this multi-edit by keyboard. So far the only reliable way seems to be to click with the mouse somewhere else ... That would need an extra command, right?

* The proposed command to select "backwards" would need to know what was the initial state -- is there a way to share a state between several executions of a command or even between two related commands?
Comment 9 Dirk Steinkamp CLA 2022-02-28 19:22:38 EST
Created attachment 288135 [details]
Gif-Animation with extending and reducing selection by keyboard bindings

This is a further extension of the multi-selection-commands, that now support expanding the selection, reducing the selection, and revoking the selection.

I just prepared some commands without key binding defaults so far.


The key issue here is the missing cursor in the first line. It even disappears sometimes after revoking all selections. I think that needs to be fixed elsewhere.


If I want to contribute code for these commands, what do I have to do? Simply upload a patch here? I've seen some usage of Gerrit, but I have no experience with that, so I would need some guidance.
Comment 10 Mickael Istria CLA 2022-03-01 03:10:08 EST
(In reply to Dirk Steinkamp from comment #9)
> This is a further extension of the multi-selection-commands, that now
> support expanding the selection, reducing the selection, and revoking the
> selection.
> I just prepared some commands without key binding defaults so far.

Great!

> The key issue here is the missing cursor in the first line. It even
> disappears sometimes after revoking all selections. I think that needs to be
> fixed elsewhere.

Yes, can you please report a separate bug about this?

> If I want to contribute code for these commands, what do I have to do?
> Simply upload a patch here?

Yes, although "simply" is not always so simple if you don't know Gerrit (the Eclipse project is progressively moving to GitHub to make things simpler).

> I've seen some usage of Gerrit, but I have no
> experience with that, so I would need some guidance.

Extensive documentation is available at https://wiki.eclipse.org/Gerrit
Assuming your remote is named `gerrit`, then you can do `git push gerrit HEAD:refs/for/master` to generate a Gerrit review. HTTPS password can be retrieved at https://git.eclipse.org/r/settings/#HTTPCredentials; you may also prefer to use SSH and change your remote accordingly.
HTH
Comment 11 Dirk Steinkamp CLA 2022-03-01 06:49:11 EST
(In reply to Mickael Istria from comment #10)

> > The key issue here is the missing cursor in the first line. It even
> > disappears sometimes after revoking all selections. I think that needs to be
> > fixed elsewhere.
> 
> Yes, can you please report a separate bug about this?

will do

> > If I want to contribute code for these commands, what do I have to do?
> > Simply upload a patch here?
> 
> Yes, although "simply" is not always so simple if you don't know Gerrit (the
> Eclipse project is progressively moving to GitHub to make things simpler).

that's what I feared. I'll see what I can accomplish. ;-)
If it doesn't work out I'll post a patch here and will ask you to integrate it.

Do I see it correctly, that tests are supposed to be in a different project?
Comment 12 Mickael Istria CLA 2022-03-01 07:29:36 EST
(In reply to Dirk Steinkamp from comment #11)
> Do I see it correctly, that tests are supposed to be in a different project?

Yes, tests are in a separate project because it works best with OSGi for integration testing. You may want to add your tests to org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/TextMultiCaretNavigationTest.java .
Comment 13 Dirk Steinkamp CLA 2022-03-01 07:46:23 EST
New issue for missing caret: https://bugs.eclipse.org/bugs/show_bug.cgi?id=579028
Comment 14 Dirk Steinkamp CLA 2022-03-01 15:11:21 EST
(In reply to Mickael Istria from comment #12)
> (In reply to Dirk Steinkamp from comment #11)
> > Do I see it correctly, that tests are supposed to be in a different project?
> 
> Yes, tests are in a separate project because it works best with OSGi for
> integration testing. You may want to add your tests to
> org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/
> TextMultiCaretNavigationTest.java .

I try to run the (so far unmodified) test class with the Eclipse JUnit runner, but with no success - could you help me out and tell me how to run the tests?
(I tried importing and opening all ~20 projects from the repository you mentioned, do a maven test, run an ant build - but none succeeded.)

java.lang.NoClassDefFoundError: org/eclipse/e4/ui/workbench/IWorkbench
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:100)
	at org.eclipse.ui.editors.tests.TextMultiCaretNavigationTest.setUpBeforeClass(TextMultiCaretNavigationTest.java:58)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.IWorkbench
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 39 more

java.lang.NullPointerException
	at org.eclipse.ui.editors.tests.TextMultiCaretNavigationTest.tearDown(TextMultiCaretNavigationTest.java:64)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.RunAfters.invokeMethod(RunAfters.java:46)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Comment 15 Mickael Istria CLA 2022-03-01 15:57:02 EST
Do you see errors on the project(s) upon import?
Are you using Run As > JUnit Plugin Test?
Comment 16 Dirk Steinkamp CLA 2022-03-01 16:55:39 EST
(In reply to Mickael Istria from comment #15)
> Do you see errors on the project(s) upon import?
> Are you using Run As > JUnit Plugin Test?

Yes, there are quite some errors in various projects. Mostly they report imports that cannot be resolved. And bundles that cannot be resolved.

I didn't run "JUnit Plugin Test" before -- this seems to give more extensive error messages -- see below.



!SESSION 2022-03-01 22:50:56.140 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.12
java.vendor=Azul Systems, Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -version 3 -port 51572 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames org.eclipse.ui.editors.tests.TextMultiCaretNavigationTest -application org.eclipse.pde.junit.runtime.coretestapplication -testpluginname org.eclipse.ui.editors.tests
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -consoleLog -version 3 -port 51572 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames org.eclipse.ui.editors.tests.TextMultiCaretNavigationTest -application org.eclipse.pde.junit.runtime.coretestapplication -data C:\Java\katas/../junit-workspace -dev file:C:/Java/katas/.metadata/.plugins/org.eclipse.pde.core/pde-junit/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -testpluginname org.eclipse.ui.editors.tests

!ENTRY org.eclipse.text.quicksearch.tests 4 0 2022-03-01 22:51:03.541
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.text.quicksearch.tests [411]
  Unresolved requirement: Require-Bundle: org.eclipse.ui.tests.harness; bundle-version="1.6.0"

	at org.eclipse.osgi.container.Module.start(Module.java:463)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.lambda$1(ModuleContainer.java:1834)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1829)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1775)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1739)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1661)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:228)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:339)

!ENTRY org.eclipse.ui.editors.tests 4 0 2022-03-01 22:51:03.550
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.ui.editors.tests [433]
  Unresolved requirement: Require-Bundle: org.eclipse.ui.tests.harness; bundle-version="1.8.0"

	at org.eclipse.osgi.container.Module.start(Module.java:463)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.lambda$1(ModuleContainer.java:1834)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1829)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1775)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1739)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1661)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:228)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:339)

!ENTRY org.eclipse.ui.genericeditor.tests 4 0 2022-03-01 22:51:03.555
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.ui.genericeditor.tests [439]
  Unresolved requirement: Require-Bundle: org.eclipse.ui.tests.harness; bundle-version="1.4.500"
  Unresolved requirement: Require-Bundle: org.eclipse.jface.text.tests; bundle-version="3.11.100"
    -> Bundle-SymbolicName: org.eclipse.jface.text.tests; bundle-version="3.12.400.qualifier"
       org.eclipse.jface.text.tests [273]
         Unresolved requirement: Require-Bundle: org.eclipse.test.performance; bundle-version="3.13.0"

	at org.eclipse.osgi.container.Module.start(Module.java:463)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.lambda$1(ModuleContainer.java:1834)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1829)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1775)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1739)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1661)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:228)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:339)

!ENTRY org.eclipse.jface.text.tests 2 0 2022-03-01 22:51:05.961
!MESSAGE Could not resolve module: org.eclipse.jface.text.tests [273]
  Unresolved requirement: Require-Bundle: org.eclipse.test.performance; bundle-version="3.13.0"


!ENTRY org.eclipse.ui.editors.tests 2 0 2022-03-01 22:51:05.965
!MESSAGE Could not resolve module: org.eclipse.ui.editors.tests [433]
  Unresolved requirement: Require-Bundle: org.eclipse.ui.tests.harness; bundle-version="1.8.0"


!ENTRY org.eclipse.ui.genericeditor.tests 2 0 2022-03-01 22:51:05.968
!MESSAGE Could not resolve module: org.eclipse.ui.genericeditor.tests [439]
  Unresolved requirement: Require-Bundle: org.eclipse.jface.text.tests; bundle-version="3.11.100"
    -> Bundle-SymbolicName: org.eclipse.jface.text.tests; bundle-version="3.12.400.qualifier"
       org.eclipse.jface.text.tests [273]
         Unresolved requirement: Require-Bundle: org.eclipse.test.performance; bundle-version="3.13.0"


!ENTRY org.eclipse.text.quicksearch.tests 2 0 2022-03-01 22:51:05.972
!MESSAGE Could not resolve module: org.eclipse.text.quicksearch.tests [411]
  Unresolved requirement: Require-Bundle: org.eclipse.ui.tests.harness; bundle-version="1.6.0"


!ENTRY org.eclipse.osgi 4 0 2022-03-01 22:51:05.976
!MESSAGE Application error
!STACK 1
java.lang.IllegalArgumentException: Bundle "org.eclipse.ui.editors.tests" not found. Possible causes include missing dependencies, too restrictive version ranges, or a non-matching required execution environment.
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.getClassLoader(RemotePluginTestRunner.java:120)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.getTestClassLoader(RemotePluginTestRunner.java:114)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:766)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:490)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:513)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:74)
	at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.start(CoreTestApplication.java:28)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
An error has occurred. See the log file
C:\Java\junit-workspace\.metadata\.log.
Comment 17 Mickael Istria CLA 2022-03-02 03:41:09 EST
(In reply to Dirk Steinkamp from comment #16)
> Yes, there are quite some errors in various projects. Mostly they report
> imports that cannot be resolved. And bundles that cannot be resolved.

OK, so things won't work until those Require-Bundle errors are resolved.
Are you using a recent I-Build of the Eclipse SDK to make sure you have the right depdendencies?
You may also need to import some projects that are not part of the SDK, and it quickly becomes a puzzle to find which project comes from which Git repository, but for the example of org.eclipse.text.quicksearch.tests, the project can be imported from the same Git repository.
Comment 18 Dirk Steinkamp CLA 2022-03-02 12:39:26 EST
(In reply to Mickael Istria from comment #17)
> (In reply to Dirk Steinkamp from comment #16)
> > Yes, there are quite some errors in various projects. Mostly they report
> > imports that cannot be resolved. And bundles that cannot be resolved.
> 
> OK, so things won't work until those Require-Bundle errors are resolved.
> Are you using a recent I-Build of the Eclipse SDK to make sure you have the
> right depdendencies?
> You may also need to import some projects that are not part of the SDK, and
> it quickly becomes a puzzle to find which project comes from which Git
> repository, but for the example of org.eclipse.text.quicksearch.tests, the
> project can be imported from the same Git repository.

I'm currently on 4.23M3.
BUT: I installed PDE tools from the Marketplace and that's probably a version too old. I'll try downloading the M3-package with PDE tools included and see if that will help.
Comment 19 Mickael Istria CLA 2022-03-02 12:44:40 EST
(In reply to Dirk Steinkamp from comment #18)
> I'm currently on 4.23M3.

This should be mostly fine then. What are the specific bundles that can't be resolved? Those may need to be imported in the workspace if they're not available in the target-platform (which is by default your IDE).
Comment 20 Dirk Steinkamp CLA 2022-03-02 13:43:33 EST
I've installed the 2022-03M3 package with PDE, and that resolves most of the error messages. (There are some errors in some of the *.test-packages, but all but one are related to projects I'm not working on, so I simply closed them ;-)...)

What's left is this in the project org.eclipse.ui.editors.tests:
- "Bundle 'org.eclipse.ui.tests.harness' cannot be resolved"
- The import org.eclipse.ui.tests cannot be resolved
  (import org.eclipse.ui.tests.harness.util.DisplayHelper)

As I don't own a horse I also don't have a harness :-P ... do you have a spare one for me, or can tell me in which git repository the right one is on offer?
Comment 21 Mickael Istria CLA 2022-03-02 14:44:07 EST
(In reply to Dirk Steinkamp from comment #20)
> do you have a
> spare one for me, or can tell me in which git repository the right one is on
> offer?

This org.eclipse.ui.tests.harness is in the eclipse.platform.ui repository (same URI as eclipse.platform.text, but with ui instead of text). It has some other dependencies that you can install instead of importing: the Eclipse Platform p2 repository at https://download.eclipse.org/eclipse/updates/4.23-I-builds/ , you can try installing the "Eclipse Test Framework".
Alternatively, you can also install the desired bundle in your IDE with command-line, using p2 director, and it will install it and its dependencies at once. Documentation to use p2 director is http://help.eclipse.org/latest/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.html
Comment 22 Dirk Steinkamp CLA 2022-03-02 17:57:04 EST
(In reply to Mickael Istria from comment #21)
> This org.eclipse.ui.tests.harness is in the eclipse.platform.ui repository
> (same URI as eclipse.platform.text, but with ui instead of text). It has
> some other dependencies that you can install instead of importing: the
> Eclipse Platform p2 repository at
> https://download.eclipse.org/eclipse/updates/4.23-I-builds/ , you can try
> installing the "Eclipse Test Framework".

I tried this and finally succeeded (didn't manage to clone the repo with the Eclipse build-in "clone with smart import", as it took forever and then complained about a timeout, but using regular git it worked easily)!
Thank you!

The tests in org.eclipse.ui.editors.tests now run (only StatusEditorTest throws an error, but that's not my business ;-)...).

So I'll see if I can now provide some tests for the new functions, and after that I will check out if Gerrit likes me or not ;-) ...
Comment 23 Eclipse Genie CLA 2022-03-04 15:35:11 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/191500
Comment 24 Eclipse Genie CLA 2022-03-05 22:00:21 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/191513
Comment 26 Eclipse Genie CLA 2022-03-13 14:07:43 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/191824
Comment 28 Dirk Steinkamp CLA 2022-03-15 12:03:26 EDT
I think the implementation of this feature is now done.
Where does documentation for new and noteworthy go?
How do we best create awareness for early adopters of integration-builds to try out the feature, and give us feedback so we can adjust early enough if issues arise?
Comment 29 Mickael Istria CLA 2022-03-15 17:13:45 EDT
(In reply to Dirk Steinkamp from comment #28)
> Where does documentation for new and noteworthy go?

It's on this repository https://git.eclipse.org/r/plugins/gitiles/www.eclipse.org/eclipse/news.git/

> How do we best create awareness for early adopters of integration-builds to
> try out the feature, and give us feedback so we can adjust early enough if
> issues arise?

This new and noteworthy document does a decent job. But you can also post about it mailing-list or social media if you want to make more buzz.
Comment 30 Dirk Steinkamp CLA 2022-03-15 18:37:16 EDT
Thanks!


Here's a video with a good demonstration of multi carets/selections in sublime -- might be a good source for inspiration: https://www.youtube.com/watch?v=3_xWl80TnCU
Comment 31 Eclipse Genie CLA 2022-03-15 19:39:21 EDT
New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/191935
Comment 32 Eclipse Genie CLA 2022-03-17 17:42:03 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/192039
Comment 33 Eclipse Genie CLA 2022-03-18 01:41:15 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/191859
Comment 34 Sarika Sinha CLA 2022-03-18 05:13:03 EDT
(In reply to Eclipse Genie from comment #33)
> New Gerrit change created:
> https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/191859

For 4_23_Maintenance


/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/multiselection/AbstractMultiSelectionHandler.java
Has 5 warnings after https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/191500 is released
Comment 35 Dirk Steinkamp CLA 2022-03-18 05:29:09 EDT
(In reply to Sarika Sinha from comment #34)
> (In reply to Eclipse Genie from comment #33)
> > New Gerrit change created:
> > https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/191859
> 
> For 4_23_Maintenance

is this already included in 4.23 somehow? I thought the feature is planned for 4.24. 

You assigned me for code review: Do I have to do anything right now? (I'm new to Eclipse contributions, so please be patient in explaining me the ways things are done ;-) ...)
Comment 36 Sarika Sinha CLA 2022-03-18 07:14:39 EDT
(In reply to Dirk Steinkamp from comment #35)
> (In reply to Sarika Sinha from comment #34)
> > (In reply to Eclipse Genie from comment #33)
> > > New Gerrit change created:
> > > https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/191859
> > 
> > For 4_23_Maintenance
> 
> is this already included in 4.23 somehow? I thought the feature is planned
> for 4.24. 
> 
> You assigned me for code review: Do I have to do anything right now? (I'm
> new to Eclipse contributions, so please be patient in explaining me the ways
> things are done ;-) ...)

Not in 4.23 release. But if someone builds a new Eclipse from 4.23_Maintenance.
As this is an accessibility issue, we are back porting for IES build which will use 4.23_Maintenance.

As I did cherry pick, it automatically assigned you as the reviewer. After I resolve the merge conflicts. If you can review the changes to make sure that it is correct and same as the one released to 4.24, It will be great.
Comment 37 Dirk Steinkamp CLA 2022-03-18 07:24:51 EDT
(In reply to Sarika Sinha from comment #36)

> Not in 4.23 release. But if someone builds a new Eclipse from
> 4.23_Maintenance.
> As this is an accessibility issue, we are back porting for IES build which
> will use 4.23_Maintenance.
> 
> As I did cherry pick, it automatically assigned you as the reviewer. After I
> resolve the merge conflicts. If you can review the changes to make sure that
> it is correct and same as the one released to 4.24, It will be great.

You need to include this fix, too: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/192039

And there are some more issues (look for "Multiple carets") either already fixed or in discussion/preparation on the platform level. Without those the feature will appear to be broken, at least on win32.

I'm also working on things in JavaEditor related to the multi caret issue.

So this is a more complex field -- I don't know if you want to backport all of these ...
Comment 38 Dirk Steinkamp CLA 2022-03-18 07:31:57 EDT
PS: maybe easier is to find the issues I'm currently working on this way:

https://git.eclipse.org/r/q/owner:dirk.steinkamp%2540gmx.de

So far they are all related to multi carets and would need consideration if they should be included for 4_23_Maintenance
Comment 39 Sarika Sinha CLA 2022-03-18 08:09:20 EDT
(In reply to Dirk Steinkamp from comment #38)
> PS: maybe easier is to find the issues I'm currently working on this way:
> 
> https://git.eclipse.org/r/q/owner:dirk.steinkamp%2540gmx.de
> 
> So far they are all related to multi carets and would need consideration if
> they should be included for 4_23_Maintenance

Thanks.
Comment 41 Eclipse Genie CLA 2022-03-23 20:19:09 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/192202