intellij-community icon indicating copy to clipboard operation
intellij-community copied to clipboard

TOML: add option to indent table keys

Open Kobzol opened this issue 3 years ago • 9 comments

(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.

indent

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

Kobzol avatar Sep 19 '21 14:09 Kobzol

:shipit:

dima-vm avatar Feb 10 '22 16:02 dima-vm

Why not merge this?

2minchul avatar Mar 22 '22 09:03 2minchul

@avrong Could you take a look please?

Kobzol avatar Mar 22 '22 10:03 Kobzol

Hi! What's the status of this PR?

icamys avatar Jan 24 '23 07:01 icamys

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"

metadaddy avatar Mar 03 '23 18:03 metadaddy

Any update on this?

westito avatar Nov 15 '23 08:11 westito

Would be so nice to have this.

Jonomir avatar Dec 11 '23 11:12 Jonomir

@Undin Is there still interest in merging this? Let me know if I should rebase it.

Kobzol avatar Dec 13 '23 06:12 Kobzol