Skip to content

Please document the role of Active profile in Eclipse configuration #646

Open

Description

@oliviercailloux

The README states: “The plugin adds a google-java-format formatter implementation that can be configured in Window > Preferences > Java > Code Style > Formatter > Formatter Implementation.”

It is unclear what can be configured exactly, or whether anything can be configured, considering the note in the same file: “There is no configurability as to the formatter's algorithm for formatting. This is a deliberate design decision to unify our code formatting on a single format.”

Relatedly, the role of the Active profile dialog box is not clear.

I just tested changing the number of spaces in the active profile, and this seems to have no effect on Source / Format when the google-java-format implementation is selected.

Please add some explanations about what can be configured and which Active profile should be chosen or indicate if it is supposed to have no effect.

Activity

  1. oliviercailloux commented on Aug 23, 2021

    @oliviercailloux
    Author

    Possibly related to #260.

  2. seeruk commented on Jan 11, 2022

    @seeruk

    Also seeing the same thing. If the google-java-format formatter is selected (with 1.13.0 and the latest version of Eclipse), when I try to format code, absolutely nothing happens. If I go back to the Eclipse built-in formatter, it does format the code. I'm not sure if I'm missing a step or if the plugin is currently broken?

  3. greg-dennis commented on Mar 14, 2022

    @greg-dennis

    Still happening with the 1.15 release.

  4. lalmeras commented on May 7, 2024

    @lalmeras

    Same here. Does the documentation need to be updated, or are there anything I'm not doing right ?

  5. florianlacreuse commented on May 15, 2024

    @florianlacreuse

    Same here with Eclipse AND IntelliJ.

    IntelliJ Scheme XML file.

  6. Lonzak commented on Jun 25, 2025

    @Lonzak

    Same here - unclear what to select in the "active profile". Tried all profiles but nothing happens when I format the code.
    How is this supposed to work?

  7. lalmeras commented on Jun 25, 2025

    @lalmeras

    Here is a snapshot of a working setup:

    Image

    Formatter implementation choice is provided by google java format extension.

    Active profile choice is provided by importing https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml

    If you want to obtain a consistent result with cli or maven plugin formatting, you also need to remove all import group in organize imports setting:

    Image

    If it still not work, check that you added the following options to eclipse launch (see https://github.com/google/google-java-format?tab=readme-ov-file#as-a-library)

    --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
    --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
    --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
    --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
    --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
    --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions