javakotlinintellij-ideajvmintellij-plugin

How to create a new Intellij plugin LanguageFileType based on Kotlin?


c

I want to create a new LanguageFileType to support Kotlin inspection on my script language file with an extension "engine.kts". but there is an issue with getting the KotlinLanguage instance.

I already tried this way but it throws NullPointerException.

        Language.findLanguageByID("kotlin")

Solution

    1. Add Kotlin Dependency to your plugin.xml file.

    enter image description here

    1. Add compileOnly configuration to Gradle project dependency.
    compileOnly("org.jetbrains.kotlin:kotlin-compiler")