ABckh / zed-java-eclipse-jdtls

Eclipse Public License 2.0
28 stars 3 forks source link

LSP adds the full package name to an incomplete package name #24

Closed lucastheliu closed 1 week ago

lucastheliu commented 1 month ago

Hi, I have a problem where LSP adds the full package name to an incomplete package name.

How to reproduce

Here is a scenario where I am trying to import any class in java.util.

When I type in import and java, the LSP behaves as expected and completes any unfinished import code.

expected

However, when I try to autocomplete util, the LSP adds the entire package name instead of just completing util.

before after

This is different from the expected behaviour of completing part of the import.

I suspect it may be a problem due to the dot (.) trigger breaking the package name completion, causing it to suggest completions without previous keyword.

Feel free to correct me if I am wrong.

ABckh commented 1 month ago

Hi @lucastheliu!

I managed to reproduce this issue and do not know why it is happing from the first glance, as a workaround I would suggest to use quick actions and add imports in this way:

Screenshot 2024-09-06 at 10 31 06 PM

I will take a look into it a bit later, as I want to fix the more important issue, which can also be related to this one: #23

lucastheliu commented 1 month ago

Sure, I think that should be enough for the time being.

ABckh commented 1 week ago

@lucastheliu Closing this for now, as there are no plans to fix it