vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Code completion does not insert parentheses and parameter suggestions

Open ctjdr opened this issue 1 year ago • 6 comments

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

Environment
  • Operating System: Ubuntu 22.04.4 LTS
  • JDK version: java-21-openjdk-amd64
  • Visual Studio Code version: 1.91.0
  • Java extension version: 1.32.0
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
  • When completion item is focussed, completion item details (JavaDoc) cannot be displayed.
  • Language client logs report an error every time the cursor keys are used to navigate the completion list (client.log)
  • When completion item is selected (hitting <Enter>), language server reports an error (server.log)
  • When triggering the completion list a second time, completion works as expected
  • Reproduction can be repeated after cleaning Java Language Server workspace
  • When reproducing the issue, I only had these extensions enabled: Selection_180

ctjdr avatar Jul 11 '24 11:07 ctjdr

See if you can reproduce after disabling intellicode extensions

fbricon avatar Jul 11 '24 11:07 fbricon

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

ctjdr avatar Jul 11 '24 11:07 ctjdr

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

snjeza avatar Jul 11 '24 16:07 snjeza

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 avatar Jul 11 '24 17:07 ctjdr

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 avatar Jul 11 '24 17:07 ctjdr

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.

ctjdr avatar Jul 11 '24 18:07 ctjdr