You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In intellij, commit format can't be filtered by file type #1647
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:
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.
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.
@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.
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.
Activity
angelozerr commentedon Aug 27, 2026
When I try to open your link I have an 404 error?
abel-rodriguez-wallee commentedon Aug 27, 2026
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 | FormattertoDo no format:It was working, but then I realized that for one of the projects it was formatting
*.propertieseven 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:
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 Lineshas no effect.\Settings | Editor | Code Style | Formatter | Do not formatalready 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:
Quarkus ToolsandLSP4IJplugins, 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.Quarkus Toolsfrom 2.5.0 to 2.4.1 (LSP4IJleft at 0.20.1) → bug still reproduces.Quarkus Tools2.3.0, and separately testedLSP4IJ1.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.I hope this information can help you find the root cause of the problem.
angelozerr commentedon Oct 12, 2026
@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 Codemenu action and it doesn't format my application.properties.abelrodriguez-wallee commentedon Oct 20, 2026
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.
fix: don't format a file which is excluded from formatting