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

ContentAssistProcessor no longer activated when CTRL key is pressed #2723

Open
2 tasks done
ptziegler opened this issue Jan 17, 2025 · 0 comments
Open
2 tasks done

ContentAssistProcessor no longer activated when CTRL key is pressed #2723

ptziegler opened this issue Jan 17, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ptziegler
Copy link
Contributor

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.

@ptziegler ptziegler added the bug Something isn't working label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant