Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support K2 mode in the IJ plugin #5138

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rock3r
Copy link
Contributor

@rock3r rock3r commented Sep 14, 2024

This PR makes the IJ plugin run in K2 mode with the new Analysis APIs, instead of the old K1 APIs. It also includes cleaning up a bunch of compiler warnings, and some mistakes I saw when migrating to K2.

I have tested it on my own machine and it seems to work, both in IJ 243 EAP1 and 242.1, but I'd recommend you try it out too. Also, I don't have any Compose Web-based project to test the related changes with.

Important

Requires #5137 to be merged first.

1. Migrate to IJP Gradle plugin 2.x
2. Upgrade Gradle to 8.10
3. Bump IJ target to 2024.2.1
4. Clean up after migration
This makes the IJ plugin run in K2 mode with the new Analysis APIs,
instead of the old K1 APIs.
@@ -35,7 +32,7 @@ class PreviewStateService(private val myProject: Project) : Disposable {
init {
val projectRefreshListener = ConfigurePreviewTaskNameCacheInvalidator(configurePreviewTaskNameCache)
ExternalSystemProgressNotificationManager.getInstance()
.addNotificationListener(projectRefreshListener, myProject)
.addNotificationListener(projectRefreshListener, this)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what is the expected behaviour here — the service was marked as an app-level service and the project used as disposable, but using Project as disposable is bad. It feels like the service should be project-level, so this subscription would maintain the same scope, but I don't know if it's the right way to go about it.

@kropp kropp self-requested a review September 16, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant