varabyte / kobweb-intellij-plugin

An official IntelliJ IDE plugin to include Kobweb-specific enhancements and understanding to your project
Apache License 2.0
10 stars 2 forks source link

Warn about Kobweb / Compose version mismatch #9

Open bitspittle opened 5 months ago

bitspittle commented 5 months ago

Can we discover those versions from the project's Gradle model? Worst case, we can parse libs.versions.toml directly, but that's more fragile. What if a user isn't using version catalogs?

Nxllpointer commented 5 months ago

Yes this can be done using the gradle tooling api. Probably by either making the kobweb gradle plugin build a model, or what i have seen the kotlin gradle plugin doing, injecting custom code when running gradle from the tooling api

Nxllpointer commented 5 months ago

Actually i think just implementing this in the gradle plugin and logging a warning is the proper solution

bitspittle commented 5 months ago

Not a bad thought! Two possible problems I see with the Gradle approach:

  1. If your Compose and Kobweb versions are mismatched, you might generate some wild errors that may dominate the warning/error output list, so the user never even sees the warning from Gradle
  2. People might ignore it because they aren't sure how to fix it

If we use the IDE to detect this, we can show a message via a notification bubble that's 1) really easy to see and 2) includes a link that the user clicks on which could just fix this for them.

BTW, it's possible we should do both things. The Gradle plugin should list a warning, AND the IDE should have integrations for detecting and helping with it.

Nxllpointer commented 5 months ago

Fair. We can log a warning and add some version mismatch info to the Gradle model. Will probably start working on the model tomorrow