javavscode
javavscode copied to clipboard
Plugin never gives suggested imports
Attached is a screen recording of a relatively basic interaction with the plugin. In it I run in to the following issues:
- Despite having picocli on the class path, no classes from it are given as suggested imports.
- When typing an import it eagerly autocompletes to
java.lang.ProcessHandle.Infowith no confirmation that its what i wanted. I just typedinfo. - For a very noticeable period of time after having the correct import in place there is an erroneous red underline under part of the import (the
picinpicocli)
I suspect these issues are related so i'm not sure the right way to divide the issues up
Another example of the autocomplete being wack:
I have found one case where the index didn't work: the first query to the index for a given file must happen before the indexing is done. The easiest way to achieve that is to have the file open, and the classpath setup, stop VS Code, delete the extension's userdir, and start VS Code again. I've attempted to fix that here: https://github.com/apache/netbeans/pull/8255
For 2. - note there's a code completion popup showing Info in the java.lang.ProcessHandle, and . confirms code completion. Also note the code completion is not going to offer info.picocli, as that's not in the picocli jar, as far as I can tell.
@lahodaj . might be the signal you listen to for confirming code completion, but its not a valid signal since it is what you would have typed ignoring the suggested completions. Thats the reason its so jarring - if you aren't looking for at the completion menu and just write code "as normal" it is jumping in with something random. Which is especially bad given how fuzzy of a match it is.
And yeah - its not info.picocli, realized that but i also don't think it affects the overall shape of the issues.
@lahodaj
.might be the signal you listen to for confirming code completion, but its not a valid signal since it is what you would have typed ignoring the suggested completions. Thats the reason its so jarring - if you aren't looking for at the completion menu and just write code "as normal" it is jumping in with something random. Which is especially bad given how fuzzy of a match it is.
Fully agreed. For the record: https://github.com/apache/netbeans/issues/5130
Hey @bowbahdoe,
You can try our latest extension version, we’ve introduced a new configuration option jdk.java.completion.commit.chars to customize the code completion accept characters.
If everything works as expected, we can go ahead and close this issue.
And will the default setting for this new configuration option be something sensible, like the Enter key?
From what I can tell, yes.
Default is what VSCode provides. So Enter and Tab is the default key.