WTH -- Why aren't YAML indentations colored?

Given that YAML indentation and syntax are vital, WTH don’t we have the option to turn on color-coded indentation (like this vs-code plugin)? We could indicate tabs vs spaces, indent depth, etc.
image

Currently, the editor has some indication of your current line, and seems to replace tabs with spaces, but coloring would be a nice toggle option:
image


This goes along with several other code editor WTHs. Maybe we should consider embedding a different code editor that has these features (like Zed.dev or VSCode).

There is likely a trade-off between size and functionality, however I have been bitten by YAML indentation in the usual config files. Some complex ESPhome projects have even required external YAML linters to find indentation and block formatting issues.

vim on the HA command line can be useful with syntax colouring, but it seems vim is unable to offer indentation guides. This was fine for 30 years of C programming, but both YAML and Python benefit from indentation guides with their less visually obvious syntax…

The File editor also sadly inserts 4x spaces on a TAB, which is PITA when the files use 2x spaces for an indentation level (and no config option I can see).

It’s a shame, as the tool is otherwise close to being all you need to develop with the very useful menu of tools at hand.

(guessing there are several different tools here - File editor != text editor used in the GUI automation editor?)

Ha! After seeing your WTH title I was going to mention indent-rainbow for VSCOde.

This would be a great addition to the internal code editor.

However this is an upstream request.

HA uses the “Codeblocks” editor (I think) and changing its behaviour is beyond the developers control, unless this feature is already available to configure.

Would changing the editor ever be considered? Or is that too lofty a dream?

1 Like

No idea sorry. It would be a pretty big change though. And there have been multiple issues with it in the past that did not prompt a move to an alternative.

1 Like

Not Codemirror?

BTW, adding these rainbow-plugin-like colors could be possible (I recall recent changes to add vertical “block” lines).

1 Like

yes it’s codemirror

1 Like

Memory like a sieve strikes again.

1 Like