clutcher / bh

Issue tracker for Better Highlights Intellij IDEA plugin
6 stars 0 forks source link

kotlin top level member links #98

Closed mgroth0 closed 4 months ago

mgroth0 commented 4 months ago

I am having trouble getting kotlin top level functions working in links, and I'm also unsure if I'm doing it correctly.

For example, say I have a file called com/mygroup/myproject/MyProject.kt:

package com.mygroup.myproject
fun myFunction() = Unit

Is it referenced as [[com.mygroup.myproject#myFunction]] (the "kotlin" qualified name)? Or [[com.mygroup.myproject.MyProjectKt#myFunction]] (the "java" qualified name, with the synthetic file class included)? It seems like both are not working, but I'm unsure if I'm even using the correct syntax, and whether or not kotlin top level functions are supported.

Once we confirm what is the correct syntax, I suggest adding an example to the How to use linking for kotlin top level functions and properties.

clutcher commented 4 months ago

@mgroth0 I need to check, but most probably it can work in the same way as in non-oop languages via file link. Something like [[MyProject.kt#myFunction]]. In any case I think that I can resolve and release fix for that somewhere next week.

clutcher commented 4 months ago

@mgroth0 It was easier than I thought. Release 2024.1.7 should be available for update in few days. Referencing is implemented via file name [[MyProject.kt#myFunction]]

mgroth0 commented 4 months ago

Nice, it works!