ktfmt
ktfmt copied to clipboard
Parse file exception with commented import line
Came across into an issue where ktfmt would fail with an exception [ktfmt] e: Failed to parse file with a commented import line like the following
package com.mypackage
import some.package
// import some.commented.out.package
import some.other.package
Looks like it's coming from: https://github.com/facebookincubator/ktfmt/blame/58becb156c72e8d74890f5e8c057d1411205e8c2/core/src/main/java/com/facebook/ktfmt/Formatter.kt#L205
@zanesq, it should print "Error: 4:1: error: Imports not contiguous (perhaps a comment separates them?): // import some.commented.out.package"
Does it not? How do you run ktfmt?
This code does not compile on Kotlin 1.9 and 2.0 (tested), therefore ktfmt will not work either