Write correct lineNumbers for properties with comments

This commit is contained in:
Natalia Ukhorskaya
2015-05-26 18:31:19 +03:00
parent ffb7027680
commit 2d509b3211
4 changed files with 12 additions and 15 deletions
@@ -224,7 +224,6 @@ public class CodegenUtil {
} }
} }
Document document = file.getViewProvider().getDocument(); Document document = file.getViewProvider().getDocument();
TextRange textRange = statement.getTextRange(); return document != null ? document.getLineNumber(markEndOffset ? statement.getTextRange().getEndOffset() : statement.getTextOffset()) + 1 : null;
return document != null ? document.getLineNumber(markEndOffset ? textRange.getEndOffset() : textRange.getStartOffset()) + 1 : null;
} }
} }
@@ -32,11 +32,11 @@ fieldWatchpoints.kt:62
fieldWatchpoints.kt:45 fieldWatchpoints.kt:45
fieldWatchpoints.kt:48 fieldWatchpoints.kt:48
fieldWatchpoints.kt:62 fieldWatchpoints.kt:62
fieldWatchpoints.kt:44 fieldWatchpoints.kt:45
fieldWatchpoints.kt:51 fieldWatchpoints.kt:51
fieldWatchpoints.kt:47 fieldWatchpoints.kt:48
fieldWatchpoints.kt:52 fieldWatchpoints.kt:52
fieldWatchpoints.kt:47 fieldWatchpoints.kt:48
fieldWatchpoints.kt:54 fieldWatchpoints.kt:54
fieldWatchpoints.kt:63 fieldWatchpoints.kt:63
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
@@ -3,8 +3,8 @@ LineBreakpoint created at withoutBodyProperties.kt:13
LineBreakpoint created at withoutBodyProperties.kt:18 LineBreakpoint created at withoutBodyProperties.kt:18
LineBreakpoint created at withoutBodyProperties.kt:23 LineBreakpoint created at withoutBodyProperties.kt:23
LineBreakpoint created at withoutBodyProperties.kt:28 LineBreakpoint created at withoutBodyProperties.kt:28
LineBreakpoint created at withoutBodyProperties.kt:39 LineBreakpoint created at withoutBodyProperties.kt:36
LineBreakpoint created at withoutBodyProperties.kt:46 LineBreakpoint created at withoutBodyProperties.kt:43
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! withoutBodyProperties.WithoutBodyPropertiesPackage !JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! withoutBodyProperties.WithoutBodyPropertiesPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
withoutBodyProperties.kt:8 withoutBodyProperties.kt:8
@@ -17,10 +17,9 @@ withoutBodyProperties.kt:23
Compile bytecode for 1 + 4 Compile bytecode for 1 + 4
withoutBodyProperties.kt:28 withoutBodyProperties.kt:28
Compile bytecode for 1 + 5 Compile bytecode for 1 + 5
withoutBodyProperties.kt:39 withoutBodyProperties.kt:36
Compile bytecode for i Compile bytecode for i
withoutBodyProperties.kt:39 withoutBodyProperties.kt:43
withoutBodyProperties.kt:46
Compile bytecode for 1 + 6 Compile bytecode for 1 + 6
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
@@ -31,10 +31,7 @@ class A {
init { init {
// EXPRESSION: i // EXPRESSION: i
// RESULT: 1: I // RESULT: 1: I
for (i in 1..1) {
// EXPRESSION: i
// RESULT: 2: I
for (i in 1..2) {
//Breakpoint! //Breakpoint!
val a = 1 val a = 1
} }
@@ -44,6 +41,8 @@ class A {
// RESULT: 7: I // RESULT: 7: I
//Breakpoint! //Breakpoint!
val prop = 1 val prop = 1
fun test()= prop
} }
fun main(args: Array<String>) { fun main(args: Array<String>) {
@@ -53,5 +52,5 @@ fun main(args: Array<String>) {
aWoBody aWoBody
aWoBody2 aWoBody2
A().prop A().test()
} }