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

Merged
merged 5 commits into from
Nov 7, 2024
Merged

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.

Release Notes

Features - Desktop

  • Compose plugin for IntelliJ IDEA now supports K2 mode

@@ -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
rock3r and others added 5 commits November 7, 2024 10:09
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.
@kropp kropp merged commit 1b877dd into JetBrains:master Nov 7, 2024
@rock3r rock3r deleted the support-k2-mode branch November 19, 2024 21:10
kropp pushed a commit that referenced this pull request Dec 12, 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.

---------

Co-authored-by: Victor Kropp <[email protected]>
(cherry picked from commit 1b877dd)
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.

2 participants