redhat-developer / intellij-quarkus

IntelliJ Quarkus Tools
Eclipse Public License 2.0
119 stars 51 forks source link

The plugin completes code after typing opening curly brace #1395

Open acanthite1855 opened 1 week ago

acanthite1855 commented 1 week ago

I'm using IDEA Community Edition 2024.2.3 and Quarkus Tools 2.0.2.

Here is how to reproduce it:

  1. Make sure that the plugin is installed
  2. Create a new quarkus project (keep all setings default)
  3. Wait for IDEA to load the project, finish indexing etc - this is important
  4. Open a class file
  5. Start typing a new method void test(){

This is where it breaks IDEA's behavior. After I type { it pops up the list of suggestions. IDEA does not do that. And it really ruins user experience, because most of the time after typing { you just want to hit Enter to move to the next line.

It is also worth mentioning that it reproduces only in quarkus projects. Creating a plain java project will not reproduce it (even with the plugin enabled).

And here is a video of me reproducing it:

https://github.com/user-attachments/assets/cb146fbc-e1b2-48d0-966a-004a6b68d0af

angelozerr commented 1 week ago

Thanks @acanthite1855 for having reported the issue.

I think the problem comes from MicroProfile LS and LSP4IJ.

Let me investigate the problem.

@mrglavas I think you should have the same problem with your Liberty Tools.

angelozerr commented 1 week ago

@acanthite1855 it is a very annoying problem. I have fixed this problem but only if your project doesn't contains Qute.

If it is the case and if you want to try this fix before waiting the release:

And please give me feedback if it works for you.

I will ping you again when the fix will be available too when your project contains Qute.

mrglavas commented 1 week ago

@angelozerr I tried this out with our Liberty Tools 24.0.9 release with a recent LSPIJ 0.7.0 build and couldn't reproduce it. We're still on IntelliJ 2024.1.x if that matters.

mrglavas commented 1 week ago

Looks like I reproduced it with the latest LSP4IJ 0.7.0 nightly build. Not sure why I wasn't seeing this before.

image

angelozerr commented 1 week ago

You should have this problem with any version of LSP4IJ since I have implemented LSP completion triggerCharacters.

There were a bug with this completion triggerCharacters in LSP4IJ 0.7.0 that I have fixed since now you see this auto popup.

And this behaviour is correct because it is the MP LS which returns those triggerCharacters.

I did a fix in MP LS and it should work now. For your case you should do nothing, just use last LSP4MP (not released yet) and LSP4IJ 0.7.0 and it should work.

mrglavas commented 1 week ago

I did a fix in MP LS and it should work now. For your case you should do nothing, just use last LSP4MP (not released yet) and LSP4IJ 0.7.0 and it should work.

Thanks. We will try that out.

angelozerr commented 1 week ago

@mrglavas if I rememberto have this auto popup, you need to activae this IJ setting

image

And after that you should see the problem.