vscode-kotlin icon indicating copy to clipboard operation
vscode-kotlin copied to clipboard

"Go To Definition F12" Support

Open cyrusrose opened this issue 2 years ago • 3 comments

Motivation

I'd like to read Kotlin source code using "Go To Definition" item in context menu, or by pressing F12. In Java, it works fine for me. But here not so much. E.g., it's possible to navigate to Java source from within .kt files, but not to files in kotlin-stdlib.

Description

This feature should make possible navigating to Kotlin source code via "Go To Definition" context menu item, or by pressing F12.

cyrusrose avatar Sep 06 '22 19:09 cyrusrose

I tried it both in Maven and Gradle, btw.

cyrusrose avatar Sep 06 '22 19:09 cyrusrose

Hey @cyrusrose

This is a known issue. However, the extension does provide partial support for "Go To Definition".

This feature should work for symbols defined on your project, as well as inside dependencies, as long as they do not belong to the kotlin stdlib. The kotlin stdlib issue is being tracked in https://github.com/fwcd/kotlin-language-server/issues/308

Please note that for gradle projects, definitions will only work on dependencies through decompiling. For maven projects, the language server supports source jars, so you should be able to see the source code of the symbols you're browsing.

daplf avatar Sep 07 '22 13:09 daplf

Tanks. I hope that you'll solve it soon, for stdlib :)

cyrusrose avatar Sep 14 '22 07:09 cyrusrose

I'll close this, since this is something handled by the language server, as mentioned above.

fwcd avatar Jan 15 '24 17:01 fwcd