kotlin-language-server icon indicating copy to clipboard operation
kotlin-language-server copied to clipboard

Missing suggestions

Open Xandaros opened this issue 3 years ago • 2 comments

I can't really tell when this happens, but quite frequently, some suggestions are simply missing.

I am currently working on an Android project and I decided to use gson to do some JSON serialization. If I type in, for example, JsonElement, it won't come up as a suggestion. Once it marks it as an unresolved reference, there is also no code action available.

However, if I go to manually import it, it suggests it just fine. As in, if I go to the top of the file and start typing in import com.google.gson.JsonElement it will suggest every part as I type.

I'm using coc-kotlin.

Xandaros avatar Sep 07 '22 13:09 Xandaros

Actually, after restarting vim, this works fine now. Restarting coc with :CocRestart resulted in errors, which I unfortunately can't see any more.

This has actually happened a lot so far - it looks like it gets into a state where it loses its index, but doesn't reindex or anything.

Xandaros avatar Sep 07 '22 13:09 Xandaros

I am currently working on an Android project and I decided to use gson to do some JSON serialization. If I type in, for example, JsonElement, it won't come up as a suggestion. Once it marks it as an unresolved reference, there is also no code action available. However, if I go to manually import it, it suggests it just fine. As in, if I go to the top of the file and start typing in import com.google.gson.JsonElement it will suggest every part as I type.

That sounds REALLY weird. Usually the code action should work as long as the symbol is in the symbol index. Is there any way for you to get the request that coc-kotlin sends to the language server? The textDocument/codeAction request?

themkat avatar Sep 08 '22 18:09 themkat