Import completion for Kotlin Native projects isn't...
# intellij
n
Import completion for Kotlin Native projects isn't handled properly by the Kotlin plugin: https://kotlinlang.slack.com/archives/C3SGXARS6/p1741307850698669
r
Hi! Could you please elaborate a little? What is your particular scenario in the IDE?
A screenshot or a short video or a reproducer would be extremely helpful 🙏
n
A screenshot of the import completion in IntelliJ. Luckily Shutter works well with IntelliJ for doing screenshots. All the symbols in the list are variables.
Here is a recording of the screen using Simple Screen Recorder.
Another recording. This time some additional details have been included to provide a clearer view of the issue.
r
Would it be possible for you to try K2 Mode, please, and see if the completion changes?
I am actually not sure that libgpiod is going to be available as a part of Kotlin Native libraries out-of-the-box You can probably use it by making a
.def
file and generating bindlings by hand (see the docs and an example) I see that it can be imported as
import libgpiod.gpiod_chip_get_line
after you have a definition, for example cc @sergey.bogolepov
👍 1
n
A def file has already been created for the libgpiod library. Seems as though the library isn't one of the official Linux userspace libraries even though the source code for the library is available on the official Linux Kernel git website ( https://web.git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git ), which is confusing. Currently I am in the process of building the library for the Debix Infinity SBC, after successfully running a K/N Hello World style program ( https://kotlinlang.slack.com/archives/C8C6E5S82/p1741557858987249 ) on the SBC itself.
Static linking works fine with the gpiod library on the linuxArm64 target, and there is no need to disable caching. Caching seems to fail if the library is dynamically linked (in theory). I can run the Kotlin Native program on the SBC without any issues, although I have replaced the main function with a mocked version since the electrical side isn't setup on the SBC yet.
@Roman Golyshev By the way the K2 mode is already enabled. The project is using Kotlin 2.1.10.
👍 1