daplf / vscode-java-kotlin

Experimental support for importing Kotlin code into Java projects via a JDT.LS extension
MIT License
25 stars 6 forks source link

Support go to definition from java to kotlin #3

Open daplf opened 2 years ago

daplf commented 2 years ago

When we request a definition of a kotlin symbol, we are taken to the bytecode rather than the source code.

We can probably fix this by adding a contentProvider. This requires us to implement a IContentProvider or IDecompiler that finds the name of the symbol we're trying to fetch and provides the kotlin source file for it. Finding the source file is trickier in Kotlin, since kotlin source files can contain multiple classes (and each one generates a different .class file). I would suggest we delegate this to the kotlin language server somehow. As such, the content provider would need to communicate with the KLS to fetch the definition of the symbol.