intellij-community
intellij-community copied to clipboard
TOML: add option to indent table keys
(I moved this PR from https://github.com/intellij-rust/intellij-rust/pull/5970.)
This PR adds an option to TOML indent code style settings to indent table and array table keys.
If I understand it correctly, indent style options need to be provided via IndentOptionsEditor
and not via LanguageCodeStyleSettingsProvider::customizeSettings
, therefore I extended SmartIndentOptionsEditor
with a new checkbox.
Some of the changes also modify indentation (4 -> 2 spaces), because this repository uses 2 spaces (intellij-rust uses four). Let me know if I should keep the changes.
Fixes: https://github.com/intellij-rust/intellij-rust/issues/5969
:shipit:
Why not merge this?
@avrong Could you take a look please?
Hi! What's the status of this PR?
Hi @Undin - please consider merging this PR. Indentation is widely used in toml files, and it's annoying when the editor undoes it.
Fastly Compute@Edge apps in particular tend to use deeply nested tables, and it's hard to visually parse the structure without indentation. For example:
[setup]
[setup.dictionaries]
[setup.dictionaries.service_config]
description = "Configuration data for my service"
[setup.dictionaries.service_config.items]
[setup.dictionaries.service_config.items.s3-primary-host]
value = "eu-west-2"
[setup.dictionaries.service_config.items.s3-fallback-host]
value = "us-west-1"
vs
[setup]
[setup.dictionaries]
[setup.dictionaries.service_config]
description = "Configuration data for my service"
[setup.dictionaries.service_config.items]
[setup.dictionaries.service_config.items.s3-primary-host]
value = "eu-west-2"
[setup.dictionaries.service_config.items.s3-fallback-host]
value = "us-west-1"
Any update on this?
Would be so nice to have this.
@Undin Is there still interest in merging this? Let me know if I should rebase it.