Skip to content

Formatter on/off config disregarded by Palentir IntelliJ's plugin #1303

@mfillon

Description

@mfillon

IntelliJ's version: 2025.1.1.1 (Ultimate Edition)
Plugin version: 2.67.0

Issue

Given formatter off/on comment is enabled in IntelliJ's configuration (Settings>Editor > Code Style > Formatter tab):

Image

With a code as follow (Spring security config is a good example where we don't want any auto-formatting):

        // @formatter:off
        return http.csrf(CsrfConfigurer::disable)
            .authorizeHttpRequests(authz -> authz.requestMatchers(
                    "/actuator/**", 
                    "/error")
                        .permitAll()
                    .anyRequest().authenticated())
                .sessionManagement(sm -> sm.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
            .build();
        // @formatter:on

Expected behaviour

Code between formatter off/on comments should not be formatted by Palentir formatter.

Actual behaviour

Code is formatted by Palentir formatter. But it is properly ignored by IntelliJ's default formatter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions