Skip to content

Commit

Permalink
Update ktfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Mar 18, 2022
1 parent 493be5d commit 740cc4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies {
implementation "org.jetbrains.exposed:exposed-dao:$exposedVersion"
implementation "org.jetbrains.exposed:exposed-jdbc:$exposedVersion"
implementation 'com.h2database:h2:1.4.200'
implementation 'com.github.fwcd.ktfmt:ktfmt:8ef3ee752a'
implementation 'com.github.fwcd.ktfmt:ktfmt:b5d31d1'
implementation 'com.beust:jcommander:1.78'

testImplementation 'org.hamcrest:hamcrest-all:1.3'
Expand Down
6 changes: 3 additions & 3 deletions server/src/main/kotlin/org/javacs/kt/formatting/Formatter.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.javacs.kt.formatting

import com.facebook.ktfmt.format
import com.facebook.ktfmt.FormattingOptions as KtfmtOptions
import com.facebook.ktfmt.format.Formatter
import com.facebook.ktfmt.format.FormattingOptions as KtfmtOptions
import org.eclipse.lsp4j.FormattingOptions

fun formatKotlinCode(
code: String,
options: FormattingOptions = FormattingOptions(4, true)
): String = format(KtfmtOptions(
): String = Formatter.format(KtfmtOptions(
style = KtfmtOptions.Style.GOOGLE,
blockIndent = options.tabSize,
continuationIndent = 2 * options.tabSize
Expand Down

0 comments on commit 740cc4e

Please sign in to comment.