https://kotlinlang.org logo
#announcements
Title
# announcements
r

rockerhieu

07/06/2017, 6:55 AM
I have a Java class:
Copy code
public final class Utils {
  public static void somethingUseful() {}
}
I don't see any suggestion to import the static method
Utils.somethingUseful()
when writing Kotlin code. Do I need to configure the Kotlin IDEA plugin?
I'm using
Version: 1.1.3-release-Studio3.0-2
g

gildor

07/06/2017, 7:10 AM
Should work. If I write utils class name I see this class in suggestions, and if I choose it, Idea adds import. If I write only Utils method name and use Smart Type then Idea suggests me this class and method and imports it
r

rockerhieu

07/06/2017, 7:16 AM
apparently it didn't work for me then, let me record a video and share here
It only work if I already imported the class
g

gildor

07/06/2017, 7:31 AM
If you want to use static function from not imported class and write only function name you must use Class Name Completion it always worked this way for java and kotlin in Idea, otherwise suggestion of all available static functions would pollute suggestions To import class by function name write “colorize” and then press Class Name Completion (Ctrl + Alt + Space on Mac)
And you don’t need it if class already imported or you wrote class name before function
r

rockerhieu

07/06/2017, 7:35 AM
very useful, thanks Andrey
👌 1
c

christophsturm

07/06/2017, 10:08 AM
its a bug in 1.1.3. works in 1.1.2
2 Views