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

FL-24489: Adjusted prev live template logic #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sellmair
Copy link
Member

Compose Preview template prev in IJ/AS now only shows up for Android source set. The hierachy of Kotlin contexts is replicated inside the "Android" group within the context selection. Compose Preview template prev in Fleet uses proper annotation, based on the source set where it is called:

  • For Android, it uses androidx Preview annotation.
  • For Common & JVM it uses jetbrains Preview annotation.
  • For iOS and other sources it is not showing up at all. Also, the template in Fleet shows up only for top-level declarations, fixing FL-23101, and prevCol template is only enabled for Android source set.

GitOrigin-RevId: 785a7e85338dd3ec5f98c242b139d3fe6d3c75ef

Copy link
Contributor

@andymagee andymagee left a comment

Choose a reason for hiding this comment

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

AndroidKotlinTemplateContextType is meant to be generic for all Android code, correct? It may be worth having it in a more generic module than Compose, since it would apply to any other Android-specific live templates.

LGTM otherwise, from the perspective of Android Studio.

Compose Preview template `prev` in IJ/AS now only shows up for Android source set. The hierachy of Kotlin contexts is replicated inside the "Android" group within the context selection.
Compose Preview template `prev` in Fleet uses proper annotation, based on the source set where it is called:
- For Android, it uses androidx Preview annotation.
- For Common & JVM it uses jetbrains Preview annotation.
- For iOS and other sources it is not showing up at all.
Also, the template in Fleet shows up only for top-level declarations, fixing FL-23101, and `prevCol` template is only enabled for Android source set.

GitOrigin-RevId: 6537741769014f659a1daa05318d2d8e541df6b7
@intellij-monorepo-bot intellij-monorepo-bot force-pushed the ilia.bogdanovich/FL-24489-prev-live-template branch from 622f7f1 to 2731abd Compare March 25, 2024 13:51
@boiler23
Copy link

Hi @andymagee, thanks for the comment!
Yes, AndroidKotlinTemplateContextType is meant to be used by any Android template-related code, so it makes sense to move it to a more generic module, which I did with the recent update: it is now located in the android-templates module.
Can you please take a look at the changes once again?

@andymagee
Copy link
Contributor

Looks good to me, thanks!

@boiler23
Copy link

OK, great! Would you be able to merge it into the Android Studio codebase? And I'll merge it into our master then :)

@andymagee
Copy link
Contributor

OK, great! Would you be able to merge it into the Android Studio codebase? And I'll merge it into our master then :)

Sure thing, will do.

@boiler23
Copy link

Perfect! Changes been merged into IJ master.

@andymagee
Copy link
Contributor

Just merged into our main branch as well. Mirroring to AOSP's mirror-goog-studio-main branch is disabled at the moment, but it will show up there once mirroring starts again.

@boiler23
Copy link

Great, thank you!

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.

3 participants