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

Use bootstrapping formatter starting from Intellij 2022.2 #798

Merged
merged 2 commits into from
Sep 26, 2022

Conversation

fawind
Copy link
Contributor

@fawind fawind commented Sep 26, 2022

Before this PR

Starting with version 2022.2, Intellij now runs with JDK 17 (release notes). This breaks the formatter because when running with JDK 15+, it requires respective --add-export args to be set.

The current workaround is to manually add the missing --add-export flags to the Intellij runtime JDK (see this related issue: google/google-java-format#787 (comment)).

After this PR

To avoid having to manually add the --add-export flags to the Intellij runtime JDK, we always use the bootstrapping formatter when running with Intellij 2022.2 or higher.

==COMMIT_MSG==
Use bootstrapping formatter starting from Intellij 2022.2
==COMMIT_MSG==

Possible downsides?

Running the bootstrapping formatter adds some lag to each formatting action and e.g. formatting a whole project is currently quite slow. However given that we already use this codepath for all projects using JDK 15 or higher, this seems okay.

Copy link

@xRuiAlves xRuiAlves left a comment

Choose a reason for hiding this comment

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

Thanks for fixing, Fabian! 👍

@bulldozer-bot bulldozer-bot bot merged commit 7f425f6 into develop Sep 26, 2022
@bulldozer-bot bulldozer-bot bot deleted the fw/intellij-222 branch September 26, 2022 12:31
@svc-autorelease
Copy link
Collaborator

Released 2.27.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants