kotlin-language-server
kotlin-language-server copied to clipboard
Detection of generated code
Given the following example
import kotlinx.serialization.Serializable
@Serializable
data class X(val a: Int)
val foo = X.serializer()
VS Code can not resolve the reference serializer
, although the compiler can build it without problems.
I guess the problem is, that the method is generated at compile time, and does not exists, as the language server needs to know of it.
+1 Maybe there is option to set to target generated classes for lsp?
@SRechenberger @belenot Did you ever find a workaround to get the language server to work with generated sources?
cc: @rckgomz
Yeah I can get it to work with everything, but the generated classes. Some tools like Netflix Dsg (for graphql) among others generate the java classes under target
and they are invisible to the LSP
There is an option to specify jars, but not classes to include. Ideally it should detect target
folder automatically? I'm not well versed in java/kotlin, but seems to be a convention