Skip to content

In intellij, commit format can't be filtered by file type #1647

Closed

Description

@abel-rodriguez-wallee

I reported this problem to Intellij team a few weeks ago.
Basically, when I commit and the IDE format the files, it format .properties files even if they are excluded.
Investigating the case, I realized that the problem is only when Quarkus Tools/LSP4IJ plugins are active. The reason looks like is caused because these plugins change the file type or similar.
https://intellij-support.jetbrains.com/hc/en-us/requests/9071054#request_comment_38385256204178
They suggested that I report the incident here.
Please, let me know if you need any additional information about the problem.

Activity

  1. angelozerr commented on Aug 27, 2026

    @angelozerr
    Contributor

    When I try to open your link I have an 404 error?

  2. abel-rodriguez-wallee commented on Aug 27, 2026

    @abel-rodriguez-wallee
    Author

    Hello Angel
    Thanks for the fast answer. It might be because it is not public or you need an account there, I'm not familiar with their policy.
    In that case, I will try to document it here again.

    They provided a way to exclude certain files when formatting the code when committing.
    In my particular case, I want to exclude any no-Java file.

    It can be done by adding in Settings | Editor | Code Style | Formatter to Do no format:

    *.{adoc,bat,bin,class,cnf,config,css,csv,cur,diff,dylib,eot,gif,gitignore,gitkeep,gradle,html,icc,ico,jar,jj,jks,jpg,js,json,launch,less,lock,md,npmignore,odg,orc,otf,pdf,pe,pem,png,po,prefs,properties,sh,sql,svg,tcss,ts,ttf,twig,txt,webp,woff,woff2,xml,xsd,yaml,yml}
    

    It was working, but then I realized that for one of the projects it was formatting *.properties even though they are in the pattern to be excluded.
    When I reported it to them, they tested it and it was working fine in a test project they created. Then I tested it myself with the same result.

    It took me a few days of testing when I had time to figure out what was the problem. I'll summarize my findings.

    Environment:

    • IntelliJ IDEA 2026.2.1 (Build #IU-262.9437.185)
    • Plugins:
      • Quarkus Tools (com.redhat.devtools.intellij.quarkus) 2.5.0
      • LSP4IJ (com.redhat.devtools.lsp4ij) 0.20.1

    Root cause:
    The affected file, application.properties, sits in a Quarkus module. Quarkus Tools registers a language server ("Tools for MicroProfile") via LSP4IJ that maps the Properties language to a custom language ID, microprofile-properties (visible under Settings | Languages & Frameworks | Language Servers | Tools for MicroProfile | Mappings). This mapping is not user-editable: the row is grayed out/non-interactive, and I found no way to remove, disable, or scope it via the Settings UI (checked the Server and Workspace Folders tabs on the same page too, no enable/disable toggle there either).

    Because the file is reclassified to microprofile-properties, none of the generic Properties settings apply to it:

    • Settings | Editor | Code Style | Properties | Keep Blank Lines has no effect.\
    • Settings | Editor | Code Style | Formatter | Do not format already includes *.properties in the glob exclusion list, and it's still ignored. This proves whatever formats this file bypasses that exclusion check entirely, rather than the pattern being wrong or incomplete.

    Tests performed:

    • Disabled the Quarkus Tools and LSP4IJ plugins, restarted, committed application.properties with blank lines → blank lines preserved. Re-enabled the plugins → blank lines stripped again on the next commit. Confirms the plugin pairing is the direct cause.
    • Downgraded Quarkus Tools from 2.5.0 to 2.4.1 (LSP4IJ left at 0.20.1) → bug still reproduces.
    • Downgraded further to Quarkus Tools 2.3.0, and separately tested LSP4IJ 1.19.4 and 1.19.0 → bug still reproduces in all combinations. That said, I don't believe the bug is in the plugins themselves, since this setup was working correctly some months ago with older versions of both IntelliJ and these plugins. So pinning an old plugin version isn't a real fix, and I'd rather understand what actually changed.
    • This rules out a Quarkus-Tools-only regression tied to a specific version, and points to either LSP4IJ's handling of formatting requests in general, or a shared MicroProfile/properties language-server component bundled independently of both plugins' version numbers, or possibly something in how the IDE itself dispatches formatting to third-party language servers.
    • Confirmed a plain non-Quarkus test project does not reproduce the issue, its .properties files stay on the generic Properties language, unaffected.
    • I also tried with previous versions of Intellij with the same results.

    I hope this information can help you find the root cause of the problem.

  3. angelozerr commented on Oct 12, 2026

    @angelozerr
    Contributor

    @abel-rodriguez-wallee I have tried to define your pattern *.{adoc,bat,bin,class,cnf,config,css,csv,cur,diff,dylib,eot,gif,gitignore,gitkeep,gradle,html,icc,ico,jar,jj,jks,jpg,js,json,launch,less,lock,md,npmignore,odg,orc,otf,pdf,pe,pem,png,po,prefs,properties,sh,sql,svg,tcss,ts,ttf,twig,txt,webp,woff,woff2,xml,xsd,yaml,yml}

    and execute Reformat Code menu action and it doesn't format my application.properties.

  4. abelrodriguez-wallee commented on Oct 20, 2026

    @abelrodriguez-wallee

    Good morning
    Thanks for taking the time to test the case.
    Unfortunately, I did it too, and it is still failing.
    Did you test it in a Quarkus project with the Quarkus Tool plugin enabled?
    Also, it only happens when the format is done during the commit.

  5. added a commit that references this issue on Nov 3, 2026
    20cf6c6
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions