redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.07k stars 430 forks source link

Code completion does not insert parentheses and parameter suggestions #3701

Open ctjdr opened 2 months ago

ctjdr commented 2 months ago

Code completion fails to insert parantheses and parameter suggestions when invoked on a type for the first time.

Environment
Steps To Reproduce
  1. Open minimal Java Maven Project (Sample GitHub Repo)
  2. Open Java file App.java
  3. (Make sure that Language Server workspace is cleaned)
  4. In line 19, enter set. and wait for completion list to appear
  5. Enter clo to filter completion list entries
  6. Hit <Enter> to select entry clone() from completion list
Current Result

set.clo gets expanded to set.clone

Expected Result

set.clo gets expanded to set.clone()

Additional Informations
fbricon commented 2 months ago

See if you can reproduce after disabling intellicode extensions

ctjdr commented 2 months ago

Yes, I can reproduce it with all IntelliCode-* extensions disabled.

snjeza commented 1 month ago

I can't reproduce the issue. @ctjdr Could you try to set "java.server.launchMode": "Standard" ?

ctjdr commented 1 month ago

I updated the sample project settings.json according to your request, cleaned the Java LS workspace, restarted VS Code and was able to reproduce the issue with the exact same effect. This is the client.log and server.log of the reproduction attempt. I really appreciate your help.

ctjdr commented 1 month ago

I just created a new profile to start with blank user settings. With this setup I am not able to reproduce the issue. I will incrementally add my specific user settings to check, which setting causes the issue, so I don't waste your time. If I find something interesting, I will let you know.

ctjdr commented 1 month ago

Eventually, I found the culprit. The issue can only be reproduced with this setting:

    "editor.quickSuggestions": {
        "other": "inline"
    }

I don't know if this is expected. You may close the issue. Thanks for your help, again.