Skip to content

Add parser support for --lines, --offset, --length - #627

Closed
ZacSweers wants to merge 17 commits into
Kotlin:mainfrom
ZacSweers:z/lines
Closed

ZacSweers wants to merge 17 commits into
Kotlin:mainfrom
ZacSweers:z/lines

Conversation

@ZacSweers

Copy link
Copy Markdown
Contributor

Resolves #218 and includes IDE support as well.

Note that I opted to match GJF's current behavior and allow statement-level boundaries (the issue described function-level granularity only, but that's not what I see GJF do).

@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 Jun 13, 2026

@hick209 hick209 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just haven't finished core/src/main/java/com/facebook/ktfmt/format/Formatter.kt, but here's the start.

I'll resume tomorrow

Comment thread core/src/main/java/com/facebook/ktfmt/cli/ParsedArgs.kt Outdated
Comment thread core/src/main/java/com/facebook/ktfmt/cli/ParsedArgs.kt Outdated
Comment thread core/src/main/java/com/facebook/ktfmt/cli/ParsedArgs.kt Outdated
Comment thread core/src/test/java/com/facebook/ktfmt/cli/ParsedArgsTest.kt Outdated
Comment thread core/src/test/java/com/facebook/ktfmt/cli/ParsedArgsTest.kt Outdated
Comment thread core/src/test/java/com/facebook/ktfmt/cli/ParsedArgsTest.kt Outdated
@meta-codesync

meta-codesync Bot commented Jun 22, 2026

Copy link
Copy Markdown

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

@meta-codesync meta-codesync Bot closed this in 7595094 Jun 29, 2026
@meta-codesync meta-codesync Bot added the Merged label Jun 29, 2026
@meta-codesync

meta-codesync Bot commented Jun 29, 2026

Copy link
Copy Markdown

@hick209 merged this pull request in 7595094.

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.

Reformat before commit and partial reformat is not supported from IntelliJ plugin Support formatting of specific line ranges

2 participants