How do I update the Kotlin plugin in IntelliJ 15.0.2?


#1

In IntelliJ 15.0.2 the Kotlin plugin is Version: 1.0.0-beta-2428-IJ143-18.

My understanding is that this version is older than Beta 3.

When I right-click on the plugin in the Settings dialog, “Update Plugin” is disabled.

How do I update it?

Thanks,
Neil


#2

You should get an autoupdate notification if you edit a Kotlin file. Alternatively, you can manually download the plugin from plugins.jetbrains.com and use the “Install plugin from disk” button to install it.


#3

I didn’t get the autoupdate notification, but manually installing it worked fine.

Thank you


#4

I encountered the same problem, and I believe it was also after installing 15.0.2. “Check for Updates” didn’t find anything, but Preferences->Plugins->Kotlin->Update worked.


#5

“Check for updates” is intentionally disabled for the Kotlin plugin. We don’t want to show Kotlin plugin updates to all users of IntelliJ IDEA, the majority of which don’t yet use Kotlin and would only be annoyed by suggestions to restart the IDE for the sake of updating a plugin they don’t use.


#6

Hmm. That sounds like a good reason to do a Chrome-style background download+update without any UI notifications, rather than to make the process of updating the Kotlin plugin more annoying.


#7

From a user’s perspective, the natural solution is not to enable the Kotlin plugin by default, and to update it like any other plugin when enabled.


#8

It’s not possible to update an IntelliJ IDEA plugin without restarting the IDE.


#9

From a user’s perspective, having a Kotlin plugin which is disabled by default is no different from not having a bundled Kotlin plugin at all.


#10

Doesn’t IntelliJ bundle many plugins that aren’t activated by default? Anyway, posts like this one, Usability issues with beta-4 package refactoring, and http://stackoverflow.com/questions/34458588/kotlin-is-it-no-longer-possible-to-iterate-a-map-with-destructured-entry-bug indicate that something is wrong with the current update method.


#11

All the plugins bundled with IntelliJ IDEA are enabled by default; there’s a wizard shown during the first run of the product that allows the user to disable some of the plugins if they choose to do so.

As far as I can see, the main problems with the current update method are caused by mismatches of the Kotlin version used by the Gradle build and the version of the installed plugin, as well as the presence of multiple incompatible versions of the runtime. Those issues are not exactly related to the plugin auto-update policy; also, most of them should disappear after 1.0, which will add much stronger backwards compatibility requirements to the runtime.


#12

That, plus the need to know that “Check for Updates” doesn’t update the Kotlin plugin, plus no update notification after installing 15.0.2, plus the plugin’s “Update” button not appearing despite a new version being available.

Any chance that a future version of the IntelliJ plugin will use the same compiler/runtime version as that used by the build, as supported for other languages such as Groovy?


#13

I’m not sure why you’re saying that it’s supported for Groovy. Groovy code analysis in IntelliJ IDEA does not use any code from the Groovy compiler, and its behavior does not depend on the version of Groovy that you use in your project (well, there may be explicit checks in the code, similar to the language level checks that exist for Java). The same is true for Scala.

The Kotlin plugin does use the same code for IDE error highlighting and compilation, and it integrates very tightly with the compiler code. It might, in theory, be possible to implement a stable API between the compiler and the plugin, so that the plugin will use the the compiler classes coming from the version of Kotlin referenced in your Gradle file, and not the version bundled in the plugin. However, I expect this to require quite a lot of work, and, if we’re successful in meeting the backwards compatibility guarantees that we currently intend to provide, the value of that work will be limited. If all versions of Kotlin will be compatible, then any version will be able to analyze your code equally correctly; the only thing to take care of is to ensure that the plugin is not older than the version in build.gradle, and to highlight features which have been added in Kotlin versions after the one in build.gradle as unsupported.


#14

Because the Groovy plugin picks up the Groovy compiler from the compile class path. (From what I remember, the Scala plugin picks it up from the .iml, which can easily be generated by the build.) Hence compilation results are guaranteed to be the same for build and IDE, provided that the compile class paths are exactly the same. Gradle does a good job of enforcing the latter these days.

I was kind of expecting the IntelliJ Kotlin plugin to be tightly coupled to the Kotlin compiler. This may be the way to go (at least for now), but keep in mind that compiler/language bugs can easily leave users in an awkward situation: They may be forced to upgrade or downgrade the Kotlin version used by the build, but may not have the option of, or may have to face the consequences of, doing the same for the IDE. I’ve ended up in this situation more than once with other languages and IDEs, and it can be a show-stopper.

Delegating compilation to the build tool (cf. Android Studio) would be another option to solve this problem.

PS: I’m not speaking for Gradle here (I’m no longer part of the team). I’m just a Kotlin user who firmly believes that the build tool needs to have ultimate authority on these things.


#15

Hmm, clicking on that Install button for the Kotlin plugin update doesn’t do anything on my installation, it seems. And without the update, I keep running into this issue:

I’m going via Tools > Kotlin > Configure Kotlin Plugin Updates, then Check for updates now > Install

I then tried updating the plugin via the Plugin configuration, which seemed to work at first, but then displayed me this nice error dialog:

Manually removing the plugin dir then seemed to work