IDEA ignoring tab expansion options on .properties files

Answered

Using IDEA 2020.1.3 Community Edition on Windows.

Trying to edit some property files (i.e., the ".property" file format), and IDEA is forcibly expanding tabs into spaces no matter how much I fight with it.  As an example, we have properties entries like this:

    some_key_name = Long lines of text, wrapped by escaping \

            the newline \

            and continuing with a leading indent.  The sequence of \

            backslash-newline-leading-whitespace will be collapsed into a \

            single space by the Properties parser.

We typically use a single <TAB> character as the indentation on the wrapped lines, which causes no problems with any .properties parser, and no problems with any editor except IDEA.

When typing such a wrapped line (i.e., typing "\<newline>"), IDEA only indents by 2 space characters.  If our users backspace over that and type a <TAB> character, IDEA expands it to spaces instead.

Settings -> Editor -> Code Style -> Properties doesn't *have* any options about tab-vs-spaces or number of indentation characters.  The sibling Other File Types panel for "text files and unsupported file types" has "Use tab character" checked, and both "Tab size" and "Indent" are 4.  None of these settings are being used.  The only file type even listed with an Indent of 2 is JSON, but we have "use tab character" checked there anyhow.

Editing any .properties file outside of IDEA to use the characters we actually type, then opening the file in IDEA, doesn't seem to trigger any different behavior.  The existing <TAB>s are left alone, at least, but typing anything new ignores the existing indents and does its own thing instead.

The files do seem to be properly detected as Properties format.  The icon on the editor tab is correct, the syntax coloring is all correct.  I don't know how to temporarily change the "type" of an opened file, to try forcing it to re-load as Properties.

It's rather frustrating at having no control over basic editing.  For now our team's solution is to not use IDEA when editing those files.

 

 

 

 

0
2 comments
Avatar
Yaroslav Bedrov

Hello,

I reported issue on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-246072

Please follow it for updates.

0

Will do, and thank you!

 

0

Please sign in to leave a comment.