Skip to content

ContentAssistProcessor no longer activated when CTRL key is pressed #2723

Closed as not planned
@ptziegler

Description

@ptziegler

Let's make sure issue is not already fixed in latest builds first.

Steps to reproduce

  • Create a custom source viewer with a default ContentAssist.
  • Register a custom ContentAssistProcessor that is automatically activated when pressing space.
  • Activate the processor by pressing CTRL+Space

I expected: The processor to be activated

But got: The processor remains inactive

Tested under this environment:

  • Windows 11
  • Eclipse 2024-12

Workaround

ContentAssistant assistant = new ContentAssistant() {
    @Override
    protected AutoAssistListener createAutoAssistListener() {
        return new AutoAssistListener() {
            @Override
            public void keyPressed(KeyEvent e) {
                if (e.stateMask == SWT.CONTROL) {
                    e.stateMask = 0;
                }
                super.keyPressed(e);
            }
        };
    }
};

Community

  • I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.

This is a result of #1556 in an attempt to fix #891. As part of this change, any events where the CTRL key is pressed will no longer activate the content processor.

In hindsight, I wonder if it would've been a better approach to create a subclass for the AutoAssistListeners and use it wherever state masks are undesirable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions