Skip to content

Support ij_kotlin_continuation_indent_size in editorconfig#600

Closed
Goooler wants to merge 1 commit intofacebook:mainfrom
Goooler:ij_kotlin_continuation_indent_size
Closed

Support ij_kotlin_continuation_indent_size in editorconfig#600
Goooler wants to merge 1 commit intofacebook:mainfrom
Goooler:ij_kotlin_continuation_indent_size

Conversation

@Goooler
Copy link
Contributor

@Goooler Goooler commented Mar 8, 2026

ktfmt only recognized the generic ij_continuation_indent_size editorconfig property, ignoring the Kotlin-specific ij_kotlin_continuation_indent_size that IntelliJ IDEA actually writes for Kotlin files.

Changes

  • EditorConfigResolver: Add ij_kotlin_continuation_indent_size as a recognized property type; resolve it with precedence over ij_continuation_indent_size. Uses Property.isValid() + getValueAs() directly so invalid values fall through to the generic property rather than short-circuiting to the default.
  • Tests: Cover standalone ij_kotlin_continuation_indent_size usage and precedence over ij_continuation_indent_size.
  • Example editorconfig files: Add ij_kotlin_continuation_indent_size alongside
    ij_continuation_indent_size in all bundled style templates.

Precedence

ij_kotlin_continuation_indent_size  (highest — Kotlin-specific)
  ↓ fallback if absent or invalid
ij_continuation_indent_size
  ↓ fallback if absent
baseOptions.continuationIndent

ktfmt only recognized the generic `ij_continuation_indent_size`
editorconfig property, ignoring the Kotlin-specific
`ij_kotlin_continuation_indent_size` that IntelliJ IDEA actually writes
for Kotlin files.

## Changes

- **`EditorConfigResolver`**: Add `ij_kotlin_continuation_indent_size`
as a recognized property type; resolve it with precedence over
`ij_continuation_indent_size`. Uses `Property.isValid()` +
`getValueAs()` directly so invalid values fall through to the generic
property rather than short-circuiting to the default.
- **Tests**: Cover standalone `ij_kotlin_continuation_indent_size` usage
and precedence over `ij_continuation_indent_size`.
- **Example editorconfig files**: Add
`ij_kotlin_continuation_indent_size` alongside
`ij_continuation_indent_size` in all bundled style templates.

### Precedence

```
ij_kotlin_continuation_indent_size  (highest — Kotlin-specific)
  ↓ fallback if absent or invalid
ij_continuation_indent_size
  ↓ fallback if absent
baseOptions.continuationIndent
```

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>
Co-authored-by: Goooler <wangzongler@gmail.com>
@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 8, 2026
@Goooler
Copy link
Contributor Author

Goooler commented Mar 8, 2026

Follow up #570.

@meta-codesync
Copy link

meta-codesync bot commented Mar 9, 2026

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

@meta-codesync meta-codesync bot closed this in 203ed1f Mar 10, 2026
@meta-codesync
Copy link

meta-codesync bot commented Mar 10, 2026

@hick209 merged this pull request in 203ed1f.

@Goooler Goooler deleted the ij_kotlin_continuation_indent_size branch March 10, 2026 02:27
@hick209 hick209 linked an issue Mar 17, 2026 that may be closed by this pull request
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

4 participants