fwcd / kotlin-language-server

Kotlin code completion, diagnostics and more for any editor/IDE using the Language Server Protocol
MIT License
1.67k stars 210 forks source link

Missing suggestions #389

Open Xandaros opened 2 years ago

Xandaros commented 2 years ago

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 commented 2 years ago

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.

themkat commented 2 years ago

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?