How do you find unused Kotlin code with IDEA? I on...
# getting-started
s
How do you find unused Kotlin code with IDEA? I only see the inspection "Unused declaration" for Java.
1
m
You should have an option called « Inspect code » into the « Code » menu
s
You should have an option called « Inspect code » into the « Code » menu
There is no inspection/rule for unused Kotlin method as far as I can see. How is it called?
m
I don't have IntelliJ anymore on my computer but I suppose it is the same as Android Studio. Whenever I want to find unused code (whatever it is Java or Kotlin) I run "Inspect code" for the whole project. A window will open at the bottom of your IDEA and you will see everything that need to be fixed (like unused code)
s
There seems to be no unused code for Kotlin, just for Java. That's why I'm asking.
m
Okay! Then I can't help. Sorry!
s
Thank you for trying. 🙏
1
a
Inspection “Kotlin | Redundant constructs | Unused symbol”
thank you color 1
s
Thank you. I did not consider a method a "symbol". I see that it finds both, properties and functions.
a
Symbol is a weird name I think. We should probably use “declaration” too.
2
s
Great, thank you 🙂