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

Conflicting keybinding for Open Type #38

Closed
trancexpress opened this issue Jan 3, 2022 · 23 comments · Fixed by #551
Closed

Conflicting keybinding for Open Type #38

trancexpress opened this issue Jan 3, 2022 · 23 comments · Fixed by #551

Comments

@trancexpress
Copy link

On Eclipse bugzilla the issue was: https://bugs.eclipse.org/bugs/show_bug.cgi?id=527785

A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
,
Category(org.eclipse.lsp4e.category,Language Servers,null,true),
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@101eb529,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
Open a type in a Java editor,
Category(org.eclipse.ui.category.navigate,Navigate,null,true),
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6a9b8f33,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)

@cdietrich
Copy link
Member

cdietrich commented Jan 10, 2022

same for rename

!SUBENTRY 1 org.eclipse.jface 2 0 2022-01-10 11:14:45.490
!MESSAGE A conflict occurred for ALT+COMMAND+R:
Binding(ALT+COMMAND+R,
	ParameterizedCommand(Command(org.eclipse.ui.edit.rename,Rename,
		Rename the selected item,
		Category(org.eclipse.ui.category.file,File,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@64a4739,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,cocoa,system)
Binding(ALT+COMMAND+R,
	ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring ,
		Rename the selected element,
		Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@7ab3f194,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,cocoa,system)

https://bugs.eclipse.org/bugs/show_bug.cgi?id=578135
eclipse-m2e/m2e-core#415

@garretwilson
Copy link

I installed Eclipse EE 2022-12, and now when I try to find a Java class using Ctrl+Shift+T, I first get a menu asking if I want to "Go to Symbol in Workspace" or "Open Type". I can keep doing this over and over and it shows these conflicting mapped commands.

But oddly if I Ctrl+Click on a class to open another file, and then close the file going back to the original class source code, then Ctrl+Shift+T brings up "Open Type" as I would expect.

My error log shows

eclipse.buildId=4.26.0.20221201-1200
java.version=17.0.5
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

org.eclipse.jface
Warning
Thu Jan 05 09:41:46 BRT 2023
Keybinding conflicts occurred.  They may interfere with normal accelerator operation.

eclipse.buildId=4.26.0.20221201-1200
java.version=17.0.5
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

org.eclipse.jface
Warning
Thu Jan 05 09:41:46 BRT 2023
A conflict occurred for ALT+SHIFT+R:
Binding(ALT+SHIFT+R,
	ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring ,
		Rename the selected element,
		Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true),
		WorkbenchHandlerServiceHandler("org.eclipse.jdt.ui.edit.text.java.rename.element"),
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system)
Binding(ALT+SHIFT+R,
	ParameterizedCommand(Command(org.eclipse.ui.edit.rename,Rename,
		Rename the selected item,
		Category(org.eclipse.ui.category.file,File,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.ui.edit.rename"),
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system)

eclipse.buildId=4.26.0.20221201-1200
java.version=17.0.5
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

org.eclipse.jface
Warning
Thu Jan 05 09:41:46 BRT 2023
A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
	ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
		Open a type in a Java editor,
		Category(org.eclipse.ui.category.navigate,Navigate,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.jdt.ui.navigate.open.type"),
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+T,
	ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
		,
		Category(org.eclipse.lsp4e.category,Language Servers,null,true),
		WorkbenchHandlerServiceHandler("org.eclipse.lsp4e.symbolinworkspace"),
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system)

This bug is very problematic, as "Open Type" via Ctrl+Shift+T is one of my most-used commands.

@mickaelistria
Copy link
Contributor

mickaelistria commented Jan 6, 2023 via email

@garretwilson
Copy link

garretwilson commented Jan 6, 2023

What file is open while you're trying Ctrl+Shift+T ?

Just a normal Java source file.

Whenever I open Eclipse for the first time, it exhibits this bug. I can switch tabs to other Java source file, and I still get a menu every time I hit Ctrl+Shift+T. It's not until I Ctrl+Click on some class that Ctrl+Shift+T starts functioning normally again and immediately brings up the "Open Type" dialog.

It feels like there is a bug in Eclipse EE 2022-12 that gets confused as to the context upon startup, and somehow Ctrl+Click to follow a class definition resets it.

@mickaelistria
Copy link
Contributor

OK. And is the Java source opened in the Java editor or in the Generic Editor? Do you have other plugins installed that are supposed to provide Java assistance? The Ctrl+Shift+T handler from LSP4E shouldn't be participating at all unless there is a language server bound to .java files, and IIRC there is not such one by default in Eclipse packages.

@garretwilson
Copy link

And is the Java source opened in the Java editor or in the Generic Editor?

The Java editor. And once the Ctrl+Click workaround happens, the same editor works again—like it has worked for like 20 years.

Do you have other plugins installed that are supposed to provide Java assistance?

I am using the exact EE distribution for 2022-12: eclipse-jee-2022-12-R-win32-x86_64.zip. I don't believe I have installed any other plugins.

The Ctrl+Shift+T handler from LSP4E shouldn't be participating at all unless there is a language server bound to .java files, and IIRC there is not such one by default in Eclipse packages.

Exactly. And that's why this is a bug.

@miklossy
Copy link
Contributor

miklossy commented Jan 9, 2023

Maybe a duplicate of #164

@mickaelistria
Copy link
Contributor

Maybe a duplicate of #164

Not exactly. #164 is about a logged message (which should be removed in Platform by the way); Here there is another preliminary issue: what does configure LSP4E to be active on .java files; this is not much intended in the EPP packages as far as I know. The EPP package needs to be investigated first.

@lukeu
Copy link

lukeu commented Jan 18, 2023

Saw this for the first time, after Eclipse upgraded itself to:

Eclipse IDE for Eclipse Committers (includes Incubating components)
Version: 2023-03 M1 (4.27.0 M1)

I can confirm the previous comments...

  • the issue returns after a restart, with only a few .java files open in Java Editors. Ctrl+click resolves it.
  • that Alt+Shift+R to refactor-rename (a class) "goes crazy" (menu bar flashing) for 20-30s before popping up the "ambiguous action" menu

@mickaelistria
Copy link
Contributor

What is the language server that is bound to Java files and contributes to Ctrl+Shift+T?

@lukeu
Copy link

lukeu commented Jan 19, 2023

I've never deliberately started any language-server-backed-editor. (Yet - very interested in that though.) How would I find out?

@mickaelistria
Copy link
Contributor

I've never deliberately started any language-server-backed-editor. (Yet - very interested in that though.) How would I find out?

I don't think it would be deliberate. Can you please share the content of the "Language Servers" preference page and see what is bound to Java files?

@lukeu
Copy link

lukeu commented Jan 20, 2023

Hope this helps:
image

@papegaaij
Copy link

It's not just Open type that's affected by this issue. I just noticed that Rename (Alt+Shift+r) doesn't work either. After Ctrl-clicking on any Java identifier, it works again.

@wrayphi
Copy link

wrayphi commented Jan 30, 2023

recently upgraded to 20221201-1913 and seeing same issues for both (Alt + Shift + R) and (Ctrl + Shift + T). Thanks for tip on ctrl clicking which clears it up temporarily

@kopfarzt
Copy link

kopfarzt commented Feb 1, 2023

Same here, Alt-Shift-R and Ctrl-Shift-T do not work.

Version: 2022-12 (4.26.0)
Build id: 20221201-1913

@lukeu
image

@mickaelistria
Copy link
Contributor

I tried the following:

  • Downloaded Eclipse IDE for Java Developers 2022-12 from https://www.eclipse.org/downloads/eclipse-packages/ ; directly the .tar.gz for Linux, without the installer
  • Created a new Java project
  • Created a new class in this Java project
  • Hit Ctrl+Shift+T => got the "Open Type" dialog without preliminary choice.

So I cannot reproduce the issue. Can someone provide detailed steps to reproduce, from a fresh download and unzip of the package?

@lukeu
Copy link

lukeu commented Feb 4, 2023

Can someone provide detailed steps to reproduce, from a fresh download and unzip of the package?

Same steps as yours, but using the 2022-12 IDE For Committers Edition, produces it. (In also a new workspace.)

@bgaraude
Copy link

So I cannot reproduce the issue. Can someone provide detailed steps to reproduce, from a fresh download and unzip of the package?

I did the very same than you did, except it was with the windows version:

  • Download the windows eclipse-java-2022-12-R-win32-x86_64.zip package from https://www.eclipse.org/downloads/packages/
  • Created a new Java project
  • Created a new Java class named Foo
  • Hit Ctrl+Shift+T => got the below popup in lower right corner (cf attached picture), and no dialog.

open-type

@estepper
Copy link

I just wanted to write the exact same thing. With windows eclipse-java-2022-12-R-win32-x86_64.zip I can reproduce both key binding issues.

For the Shift+Alt+R problem it's even weirder on my machine. When I press those keys in a Java editor on a Java type name the entire workbench window starts to flicker for about 5 seconds until it pops up the conflict notification in the very top left corner of my monitor (outside of Eclipse).

For me the two problems started all of a sudden yesterday in an existing installation/workspace.

Please please please give me back the behavior that my fingers are used to for the last two decades!

When you need more information then please let us know ASAP...

@jukzi
Copy link

jukzi commented Mar 7, 2023

So I cannot reproduce the issue. Can someone provide detailed steps to reproduce, from a fresh download and unzip of the package?

OOmp Eclipse (https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md). When you click ctrl+shift+T the first time the dialog appears. After selecting Open Type once, it does not appear anymore.

@mickaelistria
Copy link
Contributor

I'm closing this in LSP4E, it's more properly actionable on JDT end: eclipse-platform/eclipse.platform.ui#513 (comment)

@mickaelistria
Copy link
Contributor

Note that additionally to having a proposal to ensure the JDT editor uses the right command for the binding, LSP4E also has received many improvements, currently only available in snapshots, that can have a postiive impact on this issue. So please try installing LSP4E snapshots. A release may take place later this week or next week.

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 a pull request may close this issue.