How to determine if a user called the kotlin built in keyword TODO()
Answered
Hello, I was wondering how can I determine if the built in keyword TODO() in kotlin is written in a line.
I need this check in order to know when to show an action I'm creating.
Thanks.
Please sign in to leave a comment.
Hi,
See: https://github.com/JetBrains/intellij-community/blob/243/plugins/kotlin/base/analysis/src/org/jetbrains/kotlin/idea/search/ideaExtensions/KotlinTodoSearcher.kt#L46-L48
Hey thanks for replying, couldn't find that class in my project, do I need to add some dependency to my build.gradle.kts?
I didn't mean to use
KotlinTodoSearcher
, but taking a look at how it checks whether aTODO()
is used.Anyway, you will need to use Kotlin PSI and will need to add a dependency to the Kotlin plugin. See:
https://plugins.jetbrains.com/docs/intellij/idea.html#kotlin