Scratch: take into account only lines with expressions calculating inlay insert offset
This commit is contained in:
+3
-3
@@ -96,10 +96,10 @@ object InlayScratchOutputHandler : ScratchOutputHandler {
|
||||
|
||||
private fun maxLineLength(file: ScratchFile): Int {
|
||||
val doc = file.editor.editor.document
|
||||
return (0 until doc.lineCount)
|
||||
return file.getExpressions()
|
||||
.flatMap { it.lineStart..it.lineEnd }
|
||||
.map { doc.getLineEndOffset(it) - doc.getLineStartOffset(it) }
|
||||
.max()
|
||||
?: -1
|
||||
.max() ?: 0
|
||||
}
|
||||
|
||||
private fun clearInlays(editor: TextEditor) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
foo() // ERROR: error: unresolved reference: foo...
|
||||
foo() // ERROR: error: unresolved reference: foo...
|
||||
/** unresolved.kts:1 error: unresolved reference: foo
|
||||
|
||||
foo()
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
foo.forEach { // ERROR: error: unresolved reference: foo...
|
||||
foo.forEach { // ERROR: error: unresolved reference: foo...
|
||||
1 + 1
|
||||
}
|
||||
|
||||
fun goo(a: String) { // ERROR: error: unresolved reference: goo...
|
||||
fun goo(a: String) { // ERROR: error: unresolved reference: goo...
|
||||
super.goo(a)
|
||||
}
|
||||
/** unresolvedMultiline.kts:1 error: unresolved reference: foo
|
||||
|
||||
Reference in New Issue
Block a user