eclipse.platform icon indicating copy to clipboard operation
eclipse.platform copied to clipboard

[debug] Prevent or fix content assist in Expressions view

Open trancexpress opened this issue 3 months ago • 2 comments

See original report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=543086

As the discussion goes, content assist is not expected to be shown for the Expressions view as it doesn't work.

We should either prevent the pop-up (according to the discussion on the original ticket, it might be some focus bug) or fix content assist in the view.

Here is a screen recording on how to bring up the content assist window in the Expressions view:

https://github.com/user-attachments/assets/3b93b6d5-4420-45c8-8c8c-75d1dd9f07e4

I.e. select input text and then invoke content assist. Its not trivial to get the content assist window to show up.

trancexpress avatar Sep 10 '25 09:09 trancexpress

I don't see any obvious reason in theory why the content-assist coulnd't be make available in the expressions view, just like it can be available in the "Debug Shell" view in the same context.

mickaelistria avatar Sep 10 '25 10:09 mickaelistria

I've debugged some, looks like content assist is provided for the details pane at the bottom of the Expressions view.

For whatever reason, in some cases (e.g. like in the recording), the content assist hotkey in the cell editor is forwarded to the details pane. I'm not sure why, so far. It doesn't look like the expressions cell editor has content assist itself.

Here are the relevant stack traces:

The content assist window is seen due to using a SourceViewer for the details pane:

	at org.eclipse.swt.widgets.Shell.<init>(Shell.java:272)
	at org.eclipse.swt.widgets.Shell.<init>(Shell.java:380)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.createProposalSelector(CompletionProposalPopup.java:607)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.lambda$0(CompletionProposalPopup.java:517)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:502)
	at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1874)
	at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:999)
	at org.eclipse.ui.console.actions.TextViewerAction.run(TextViewerAction.java:71)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
	at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:124)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:98)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:237)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:174)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:165)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:204)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:320)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:581)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:662)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:451)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:104)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1977)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1655)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1682)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1665)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1704)
	at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:1000)
	at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:4020)
	at org.eclipse.swt.widgets.Text.gtk_key_press_event(Text.java:1876)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2639)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:6864)
	at org.eclipse.swt.widgets.Text.windowProc(Text.java:2982)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6191)

The respective SourceViewer is created here:

	at org.eclipse.jface.text.source.SourceViewer.<init>(SourceViewer.java:427)
	at org.eclipse.jface.text.source.SourceViewer.<init>(SourceViewer.java:409)
	at org.eclipse.debug.internal.ui.views.variables.details.DefaultDetailPane.createSourceViewer(DefaultDetailPane.java:451)
	at org.eclipse.debug.internal.ui.views.variables.details.DefaultDetailPane.createControl(DefaultDetailPane.java:431)
	at org.eclipse.debug.internal.ui.views.variables.details.DetailPaneProxy.setupPane(DetailPaneProxy.java:225)
	at org.eclipse.debug.internal.ui.views.variables.details.DetailPaneProxy.display(DetailPaneProxy.java:127)
	at org.eclipse.debug.internal.ui.views.variables.VariablesView.refreshDetailPaneContents(VariablesView.java:1160)
	at org.eclipse.debug.internal.ui.views.variables.VariablesView.showDetailPane(VariablesView.java:881)
	at org.eclipse.debug.internal.ui.views.variables.VariablesView.buildDetailPane(VariablesView.java:857)
	at org.eclipse.debug.internal.ui.views.variables.VariablesView.setDetailPaneOrientation(VariablesView.java:830)
	at org.eclipse.debug.internal.ui.views.variables.VariablesView.createViewer(VariablesView.java:514)
	at org.eclipse.debug.ui.AbstractDebugView$ViewerPage.createControl(AbstractDebugView.java:285)
	at org.eclipse.debug.ui.AbstractDebugView.createDefaultPage(AbstractDebugView.java:378)
	at org.eclipse.ui.part.PageBookView.createPartControl(PageBookView.java:441)
	at org.eclipse.debug.ui.AbstractDebugView.createPartControl(AbstractDebugView.java:337)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:160)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:155)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:367)

The action is created here:

	at org.eclipse.ui.console.actions.TextViewerAction.<init>(TextViewerAction.java:43)
	at org.eclipse.debug.internal.ui.views.variables.details.DefaultDetailPane.createActions(DefaultDetailPane.java:594)
	at org.eclipse.debug.internal.ui.views.variables.details.DefaultDetailPane.createControl(DefaultDetailPane.java:435)
	at org.eclipse.debug.internal.ui.views.variables.details.DetailPaneProxy.setupPane(DetailPaneProxy.java:225)
	at org.eclipse.debug.internal.ui.views.variables.details.DetailPaneProxy.display(DetailPaneProxy.java:127)
	at org.eclipse.debug.internal.ui.views.variables.VariablesView.refreshDetailPaneContents(VariablesView.java:1160)
	at org.eclipse.debug.internal.ui.views.variables.VariablesView.showDetailPane(VariablesView.java:881)
	at org.eclipse.debug.internal.ui.views.variables.VariablesView.buildDetailPane(VariablesView.java:857)
	at org.eclipse.debug.internal.ui.views.variables.VariablesView.setDetailPaneOrientation(VariablesView.java:830)
	at org.eclipse.debug.internal.ui.views.variables.VariablesView.createViewer(VariablesView.java:514)
	at org.eclipse.debug.ui.AbstractDebugView$ViewerPage.createControl(AbstractDebugView.java:285)
	at org.eclipse.debug.ui.AbstractDebugView.createDefaultPage(AbstractDebugView.java:378)
	at org.eclipse.ui.part.PageBookView.createPartControl(PageBookView.java:441)
	at org.eclipse.debug.ui.AbstractDebugView.createPartControl(AbstractDebugView.java:337)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:160)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:155)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:367)

Keep this in mind:

public class ExpressionView extends VariablesView {

The content assist is provided by this code:

"main" #1 [3705556] prio=6 os_prio=0 cpu=7103.06ms elapsed=786.47s tid=0x00007f03e002ea70 nid=3705556 runnable  [0x00007f03e45fa000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.jdt.internal.debug.ui.contentassist.JavaDebugContentAssistProcessor.computeCompletionProposals(JavaDebugContentAssistProcessor.java:145)
        at org.eclipse.jface.text.contentassist.ContentAssistant$2.lambda$0(ContentAssistant.java:2064)
        at org.eclipse.jface.text.contentassist.ContentAssistant$2$$Lambda/0x00007f0344bb5ed0.accept(Unknown Source)
        at java.util.Collections$SingletonSet.forEach([email protected]/Collections.java:5126)
        at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:2063)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
        at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:2060)
        at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:577)
        at org.eclipse.jface.text.contentassist.CompletionProposalPopup.lambda$0(CompletionProposalPopup.java:507)
        at org.eclipse.jface.text.contentassist.CompletionProposalPopup$$Lambda/0x00007f0344bb5820.run(Unknown Source)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
        at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:502)
        at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1874)
        at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:999)
        at org.eclipse.ui.console.actions.TextViewerAction.run(TextViewerAction.java:74)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
        at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:124)
        at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:98)
        at java.lang.invoke.LambdaForm$DMH/0x00007f0344bb8400.invokeVirtual([email protected]/LambdaForm$DMH)
        at java.lang.invoke.LambdaForm$MH/0x00007f0344bb9c00.invoke([email protected]/LambdaForm$MH)
        at java.lang.invoke.Invokers$Holder.invokeExact_MT([email protected]/Invokers$Holder)
        at jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl([email protected]/DirectMethodHandleAccessor.java:157)
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke([email protected]/DirectMethodHandleAccessor.java:103)
        at java.lang.reflect.Method.invoke([email protected]/Method.java:580)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
        at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
        at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:237)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:174)
        at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:165)
        at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
        at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
        at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:204)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:320)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:581)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:662)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:451)

Its the selection that enables the content assist:

"main" #1 [3705556] prio=6 os_prio=0 cpu=45191.23ms elapsed=7394.15s tid=0x00007f03e002ea70 nid=3705556 at breakpoint [0x00007f03e45fc000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:277)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:287)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:239)
        at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.lookUpHandler(HandlerServiceImpl.java:99)
        at org.eclipse.ui.internal.handlers.E4HandlerProxy.handlerChanged(E4HandlerProxy.java:115)
        at org.eclipse.core.commands.AbstractHandler.fireHandlerChanged(AbstractHandler.java:77)
        at org.eclipse.jface.commands.ActionHandler.lambda$0(ActionHandler.java:84)
        at org.eclipse.jface.commands.ActionHandler$$Lambda/0x00007f034452cba8.propertyChange(Unknown Source)
        at org.eclipse.jface.action.AbstractAction.firePropertyChange(AbstractAction.java:52)
        at org.eclipse.jface.action.AbstractAction.firePropertyChange(AbstractAction.java:75)
        at org.eclipse.jface.action.Action.setEnabled(Action.java:541)
        at org.eclipse.ui.console.actions.TextViewerAction.update(TextViewerAction.java:64)
        at org.eclipse.debug.internal.ui.views.variables.details.AbstractDetailPane.updateAction(AbstractDetailPane.java:124)
        at org.eclipse.debug.internal.ui.views.variables.details.DefaultDetailPane.configureDetailsViewer(DefaultDetailPane.java:862)
        at org.eclipse.debug.internal.ui.views.variables.details.DefaultDetailPane.setDebugModel(DefaultDetailPane.java:968)
        at org.eclipse.debug.internal.ui.views.variables.details.DefaultDetailPane.display(DefaultDetailPane.java:720)
        at org.eclipse.debug.internal.ui.views.variables.details.DetailPaneProxy.setupPane(DetailPaneProxy.java:228)
        at org.eclipse.debug.internal.ui.views.variables.details.DetailPaneProxy.display(DetailPaneProxy.java:127)
        at org.eclipse.debug.internal.ui.views.variables.VariablesView.refreshDetailPaneContents(VariablesView.java:1160)
        at org.eclipse.debug.internal.ui.views.variables.VariablesView.lambda$4(VariablesView.java:1123)
        at org.eclipse.debug.internal.ui.views.variables.VariablesView$$Lambda/0x00007f0344943170.selectionChanged(Unknown Source)
        at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:819)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
        at org.eclipse.ui.internal.JFaceUtil$$Lambda/0x00007f03441b2c70.run(Unknown Source)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:167)
        at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:816)
        at org.eclipse.jface.viewers.ColumnViewer.firePostSelectionChanged(ColumnViewer.java:1051)
        at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1184)
        at org.eclipse.jface.viewers.StructuredViewer$$Lambda/0x00007f03445b4d08.accept(Unknown Source)
        at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:83)
        at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:283)
        at org.eclipse.jface.util.OpenStrategy$1.lambda$1(OpenStrategy.java:437)
        at org.eclipse.jface.util.OpenStrategy$1$$Lambda/0x00007f0344ba5368.run(Unknown Source)

I assume this is to enable actions in the details pane when an expression row is selected.

Before that the content assist command is still triggered by the cell editor, but the handler is not enabled. I'm not sure how we can avoid triggering the content assist command while editing the cell...

Note that its also possible to type in the details pane (both in the Expressions view and the Variables view).

trancexpress avatar Sep 10 '25 14:09 trancexpress