Skip to content

Conversation

@sarahhaggarty
Copy link
Collaborator

This PR adds the -Xcompiler-plugin-order compiler option for Kotlin 2.3.0.

@sarahhaggarty sarahhaggarty requested a review from bnorm November 19, 2025 13:22
@sarahhaggarty sarahhaggarty requested a review from a team as a code owner November 19, 2025 13:22
@sarahhaggarty sarahhaggarty requested a review from bnorm November 19, 2025 16:19
Copy link
Collaborator

@koshachy koshachy left a comment

Choose a reason for hiding this comment

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

Overall is good!
Mentioned some ideas so maybe they could help to explain some things more clearly.
Up to you.


### -Xcompiler-plugin-order={plugin.before>plugin.after}

Configure the running order of compiler plugins. Place the compiler plugin you want to run first on the left side of the
Copy link
Collaborator

Choose a reason for hiding this comment

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

While the sentence is clear and well-written, WDYT if we make it more straightforward?

It is just a random thought:
Configure the running order of compiler plugins. Compiler runs plugin.before first, and then plugin.after.

You can define multiplae ordering rules for three or more plugins. For example:

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or something similar.
WDYT?

It's OK not to take my version :)

kotlinc -Xcompiler-plugin-order=plugin.middle>plugin.last
```

This results in the following running order: `plugin.first`, then `plugin.middle`, and finally `plugin.last`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe numbered list will show it more clearly?

| SAM with receiver | `org.jetbrains.kotlin.samWithReceiver` |
| Serialization | `org.jetbrains.kotlinx.serialization` |

This running order controls only the backend of compiler plugins and not the frontend.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have any links that helps to define the diffrence backend and frontend? 🤔

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.

4 participants