Skip to content

Support ij_kotlin_indent_size in editorconfig#604

Closed
Goooler wants to merge 1 commit intofacebook:mainfrom
Goooler:support-ij-kotlin-indent-size
Closed

Support ij_kotlin_indent_size in editorconfig#604
Goooler wants to merge 1 commit intofacebook:mainfrom
Goooler:support-ij-kotlin-indent-size

Conversation

@Goooler
Copy link
Contributor

@Goooler Goooler commented Mar 10, 2026

ij_kotlin_indent_size is an IntelliJ-specific Kotlin language override for indent_size, but ktfmt ignored it entirely. Users who configure indentation via ij_kotlin_indent_size saw no effect on ktfmt formatting.

Changes

  • EditorConfigResolver: Register ij_kotlin_indent_size as a recognized property and use it as the highest-priority source for blockIndent, falling back to indent_sizetab_width as before:
    ij_kotlin_indent_size  (new, highest priority)
      → indent_size
      → tab_width (when indent_size = tab)
    
  • EditorConfigResolverTest: Two new tests — ij_kotlin_indent_size sets blockIndent, and takes priority over indent_size when both are present.
  • docs/editorconfig/: Added ij_kotlin_indent_size to all three example .editorconfig files alongside the existing indent_size.

@Goooler
Copy link
Contributor Author

Goooler commented Mar 10, 2026

Follow up #570.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 10, 2026
@Goooler Goooler force-pushed the support-ij-kotlin-indent-size branch 2 times, most recently from 67a3413 to 6886a26 Compare March 10, 2026 02:43
Copy link
Contributor

@hick209 hick209 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, dang it! I'm sorry that I ended up missing this one, else it would have made into the most recent release (0.62 from today).

I must have cleared it up from my notifications thinking it was similar to the previous PR.

Changes look good, but need to be rebased before I can pull them in.

@hick209 hick209 linked an issue Mar 17, 2026 that may be closed by this pull request
`ij_kotlin_indent_size` is an IntelliJ-specific Kotlin language override for `indent_size`, but ktfmt ignored it entirely. Users who configure indentation via `ij_kotlin_indent_size` saw no effect on ktfmt formatting.

## Changes

- **`EditorConfigResolver`**: Register `ij_kotlin_indent_size` as a recognized property and use it as the highest-priority source for `blockIndent`, falling back to `indent_size` → `tab_width` as before:
  ```
  ij_kotlin_indent_size  (new, highest priority)
    → indent_size
    → tab_width (when indent_size = tab)
  ```
- **`EditorConfigResolverTest`**: Two new tests — `ij_kotlin_indent_size` sets `blockIndent`, and takes priority over `indent_size` when both are present.
- **`docs/editorconfig/`**: Added `ij_kotlin_indent_size` to all three example `.editorconfig` files alongside the existing `indent_size`.
@Goooler Goooler force-pushed the support-ij-kotlin-indent-size branch from 6886a26 to 3c2c4dd Compare March 18, 2026 01:45
@meta-codesync
Copy link

meta-codesync bot commented Mar 19, 2026

@hick209 has imported this pull request. If you are a Meta employee, you can view this in D97334408.

Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync
Copy link

meta-codesync bot commented Mar 20, 2026

@hick209 merged this pull request in 0d11f49.

@Goooler Goooler deleted the support-ij-kotlin-indent-size branch March 20, 2026 23:27
meta-codesync bot pushed a commit that referenced this pull request Mar 22, 2026
Summary:
A minor cleanup for

- #600
- #604

Pull Request resolved: #608

Reviewed By: cgrushko

Differential Revision: D97635017

Pulled By: hick209

fbshipit-source-id: ac7c6e5ed74a8b161fb0432223da3ffe4db77c13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align configuration options between CLI, IDE plugin and Gradle

3 participants