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

chore: formatter indentation change #1933

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

quintesse
Copy link
Contributor

No description provided.

@@ -207,7 +207,7 @@
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="82"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens if you just remove this line (and use default value)?

Copy link
Contributor Author

@quintesse quintesse Mar 1, 2025

Choose a reason for hiding this comment

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

No idea, this is what Eclipse exported for me when I changed the option to the default.

Are you expecting some other behaviour?

@quintesse
Copy link
Contributor Author

quintesse commented Mar 4, 2025

So I tried the option that uses just a single indent when continuing a chain of method calls and it goes from this original format:

    public void downloadSources(Artifact artifact) {
        try {
            context .repositorySystem()
                    .resolveArtifact(context.repositorySystemSession(), new ArtifactRequest()
                                                                                                .setArtifact(
                                                                                                        new SubArtifact(
                                                                                                                artifact,
                                                                                                                "sources",
                                                                                                                "jar"))
                                                                                                .setRepositories(
                                                                                                        context.remoteRepositories()));
        } catch (ArtifactResolutionException e) {
            Util.verboseMsg("Could not resolve sources for " + artifact.toString());
        }
    }

to this new format:

    public void downloadSources(Artifact artifact) {
        try {
            context.repositorySystem()
                .resolveArtifact(context.repositorySystemSession(), new ArtifactRequest()
                    .setArtifact(new SubArtifact(artifact, "sources", "jar"))
                    .setRepositories(context.remoteRepositories()));
        } catch (ArtifactResolutionException e) {
            Util.verboseMsg("Could not resolve sources for " + artifact.toString());
        }
    }

Which I personally find much neater.

@cstamas
Copy link
Contributor

cstamas commented Mar 4, 2025

I like the last one as well!

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