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

Autocompletion overwrites following characters #352

Closed
fly1n opened this issue Nov 1, 2017 · 29 comments
Closed

Autocompletion overwrites following characters #352

fly1n opened this issue Nov 1, 2017 · 29 comments

Comments

@fly1n
Copy link

fly1n commented Nov 1, 2017

Autocompletion overwrites following characters

Environment
  • Operating System: Windows 10 Pro (64 bits)
  • JDK version: JDK8_144, JDK8_151, , JDK8_152, OpenJdk8_144
  • Visual Studio Code version: 1.17.2
  • Java extension version: 0.12.0
Steps To Reproduce
  1. [step 1] Type "<Integer>"
  2. [step 2] Put cursor before "<Integer>", Type "Array", waiting for autocompletion to show "ArrayList". Select "ArrayList", several characters of the following "<Integer>" will be overwriten.

This bug can be easily reproduced on all java files.

Current Result

Sometimes "ArrayListInteger>", sometimes "ArrayListeger>", sometimes "ArrayList<Integer>"

Expected Result

"ArrayList<Integer>"

@fbricon
Copy link
Collaborator

fbricon commented Nov 1, 2017

This works fine in Eclipse, so definitely a bug in jdt.ls side

@fly1n
Copy link
Author

fly1n commented Nov 8, 2017

Is this bug fixed in 0.13.0? I still have this bug.

@fbricon
Copy link
Collaborator

fbricon commented Nov 8, 2017

Yes it's supposed to be fixed. Can you still reproduce this issue consistently?

@fly1n
Copy link
Author

fly1n commented Nov 8, 2017

Yes. I tried several times. This bug still appear consistently. I am using OpenJDK8_151 now.

@fbricon
Copy link
Collaborator

fbricon commented Nov 8, 2017

@fly1n please set java.trace.server to verbose in VS Code's preferences, so we can trace messages exchanged between the server and VSCode. Then you can attach your VSCode logs (see Language Support for Java in the Output view)

@fly1n
Copy link
Author

fly1n commented Nov 8, 2017

vscode_log.txt

@snjeza
Copy link
Contributor

snjeza commented Nov 8, 2017

@fbricon it seems that a timeout of 1 sec sometimes isn't enough.

@fly1n could you try the following:

  • type Array
  • when VS Code shows the ArrayList completion, wait for a few seconds
  • apply completion

@fly1n
Copy link
Author

fly1n commented Nov 8, 2017

I know that this bug does not happen when I wait for few seconds, but you can't expect every user to wait for few seconds before autocompletion, right?

@snjeza
Copy link
Contributor

snjeza commented Nov 8, 2017

@fly1n Right. I just wanted to check if a timeout is the cause of the issue because I can't reproduce it.

@fbricon will we increase a timeout?

@fly1n
Copy link
Author

fly1n commented Nov 8, 2017

Sorry, I thought this does not happen after waiting for few seconds but did not really test it. I test it again for few times, it happens even after I wait for about 10 seconds. I also found another behavior.
In my project, when I type "LSR" before "()", the expected autocompletion is "LSRNIC", apart from the case that autocompletion sometimes overwrites following "()", the autocompletion itself is not consistent as it sometimes ends with "LSRNIC(parent))", sometimes ends with "LSRNIC)" (overwrites one character "("), sometimes "LSRNIC" (completely overwrites "()").

@snjeza
Copy link
Contributor

snjeza commented Nov 8, 2017

I still can't reproduce the issue with VS Code Java 0.13.0. Please take a look at https://www.screencast.com/t/vTKvleEJcvk

@fly1n
Copy link
Author

fly1n commented Nov 8, 2017

I tried to use the same file as you, and this bug did not happen in that file. I can send you my project. Since it is my course project, I do not want to upload it to github, can you give me your email please?

@snjeza
Copy link
Contributor

snjeza commented Nov 8, 2017

snjezana.peco@redhat.com

@fbricon
Copy link
Collaborator

fbricon commented Nov 8, 2017

I've tried very hard to autocomplete as fast as I can (definitely sub second) and can't reproduce it either.

@snjeza
Copy link
Contributor

snjeza commented Nov 8, 2017

@fly1n try to reinstall the VS Code Java LS extension. It is possible that you are using an older version.

@fly1n
Copy link
Author

fly1n commented Nov 8, 2017

I reinstalled the whole VS code with only Java extension, this bug still appears.

@fly1n
Copy link
Author

fly1n commented Nov 8, 2017

Can you try to just type lower case "ls" before "()", and then select the first autocompletion ("LSR"). This setting is able to reproduce the bug in my side.

@snjeza
Copy link
Contributor

snjeza commented Nov 9, 2017

Can you try to just type lower case "ls" before "()", and then select the first autocompletion ("LSR"). This setting is able to reproduce the bug in my side.

I have tried it, but can't reproduce the issue.

@fly1n Could you check your VS Code Java LS version?

vscode

@fly1n
Copy link
Author

fly1n commented Nov 9, 2017

See this: https://www.screencast.com/t/7s73x82XKb, it is 0.13.0.

@snjeza
Copy link
Contributor

snjeza commented Nov 9, 2017

@fly1n could you disable other extensions?

@fly1n
Copy link
Author

fly1n commented Nov 10, 2017

https://www.screencast.com/t/aKkFvziNcJt2
I reinstalled VS Code 1.18.0 with only Java LS 0.14.0.

@snjeza
Copy link
Contributor

snjeza commented Nov 10, 2017

@fly1n
Copy link
Author

fly1n commented Nov 11, 2017

Unfortunately the bug still happens.

@snjeza
Copy link
Contributor

snjeza commented Nov 11, 2017

@fly1n I suppose you have a very fast machine. What hardware are you using?
Could you try to reproduce the issue using https://drive.google.com/open?id=1WZJ8hXd3QuRpAkfLJo0X_uft70LpyRcp ?

@fly1n
Copy link
Author

fly1n commented Nov 11, 2017

Cool! This version works for me. Now I do not have that bug.

@fly1n
Copy link
Author

fly1n commented Nov 12, 2017

This bug happens much less after I use your newest version, but it still happens few times when I wrote code. So, I think this solution is still not a radical one.

@snjeza
Copy link
Contributor

snjeza commented Nov 12, 2017

@fly1n
Copy link
Author

fly1n commented Nov 14, 2017

I used the newest one for one day. It seems that this bug is completely resolved in the newest version.

@fbricon
Copy link
Collaborator

fbricon commented Nov 20, 2017

with @snjeza's fix, not only is autocompletion more robust, it's also now super fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants