Merge pull request #10759 from igfoo/igfoo/numlines2

kotlin: Populate numlines
This commit is contained in:
Ian Lynagh
2022-10-14 15:39:40 +01:00
committed by GitHub
14 changed files with 190 additions and 8 deletions

View File

@@ -4,13 +4,13 @@ open class TestKt {
}
interface ParentIf {
interface ParentIfK {
fun inheritedInterfaceMethodK()
}
interface ChildIf : ParentIf {
interface ChildIfK : ParentIfK {
}
@@ -24,7 +24,7 @@ class ChildKt : TestKt() {
c.equals(c)
c.hashCode()
c.inheritMe()
val c2: ParentIf? = null
val c2: ParentIfK? = null
c2?.inheritedInterfaceMethodK()
}

View File

@@ -7,4 +7,4 @@
| Test.kt:24:7:24:15 | equals(...) | equals | Object |
| Test.kt:25:7:25:16 | hashCode(...) | hashCode | Object |
| Test.kt:26:7:26:17 | inheritMe(...) | inheritMe | TestKt |
| Test.kt:28:9:28:35 | inheritedInterfaceMethodK(...) | inheritedInterfaceMethodK | ParentIf |
| Test.kt:28:9:28:35 | inheritedInterfaceMethodK(...) | inheritedInterfaceMethodK | ParentIfK |

View File

@@ -0,0 +1,6 @@
| test.kt:2:1:4:1 | foo | 3 | 3 | 0 |
| test.kt:8:1:8:9 | getX | 1 | 1 | 0 |
| test.kt:18:1:18:17 | getY | 5 | 1 | 4 |
| test.kt:20:1:26:1 | Foo | 7 | 6 | 1 |
| test.kt:21:5:24:5 | bar | 4 | 3 | 1 |
| test.kt:25:5:25:21 | getSomeField | 1 | 1 | 0 |

View File

@@ -0,0 +1,4 @@
import java
from Callable c
select c, c.getTotalNumberOfLines(), c.getNumberOfLinesOfCode(), c.getNumberOfCommentLines()

View File

@@ -0,0 +1 @@
| test.kt:20:1:26:1 | Foo | 7 | 6 | 1 |

View File

@@ -0,0 +1,4 @@
import java
from Class c
select c, c.getTotalNumberOfLines(), c.getNumberOfLinesOfCode(), c.getNumberOfCommentLines()

View File

@@ -0,0 +1 @@
| test.kt:0:0:0:0 | test | 28 | 11 | 9 |

View File

@@ -0,0 +1,4 @@
import java
from File f
select f, f.getTotalNumberOfLines(), f.getNumberOfLinesOfCode(), f.getNumberOfCommentLines()

View File

@@ -0,0 +1,27 @@
fun foo ( x : Int ) {
val y = ( x + 1 )
}
// test
val x = 4
/*
test
*/
/**
test
*/
val y = 5 // test
class Foo {
fun bar() {
// comment
return
}
val someField = 3
}