Skip to content

Commit c959b1a

Browse files
nicolas-guichardantonsviridov-src
authored andcommitted
Sort occurences by (startLine, startCharacter)
Down to 2 failing tests.
1 parent 502fee3 commit c959b1a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

semanticdb-kotlinc/src/main/kotlin/com/sourcegraph/semanticdb_kotlinc/SemanticdbTextDocumentBuilder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class SemanticdbTextDocumentBuilder(
3737
this.md5 = semanticMd5
3838
this.schema = Semanticdb.Schema.SEMANTICDB4
3939
this.language = Semanticdb.Language.KOTLIN
40+
occurrences.sortWith(compareBy({ it.range.startLine }, { it.range.startCharacter }))
4041
this.addAllOccurrences(occurrences)
4142
this.addAllSymbols(symbols)
4243
}

semanticdb-kotlinc/src/test/kotlin/com/sourcegraph/semanticdb_kotlinc/test/SemanticdbSymbolsTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ class SemanticdbSymbolsTest {
390390
listOf(
391391
SymbolOccurrence {
392392
role = Role.DEFINITION
393-
symbol = "Test#sample."
393+
symbol = "Test#`<init>`().(sample)"
394394
range {
395395
startLine = 0
396396
startCharacter = 15
@@ -400,7 +400,7 @@ class SemanticdbSymbolsTest {
400400
},
401401
SymbolOccurrence {
402402
role = Role.DEFINITION
403-
symbol = "Test#getSample()."
403+
symbol = "Test#sample."
404404
range {
405405
startLine = 0
406406
startCharacter = 15
@@ -410,7 +410,7 @@ class SemanticdbSymbolsTest {
410410
},
411411
SymbolOccurrence {
412412
role = Role.DEFINITION
413-
symbol = "Test#setSample()."
413+
symbol = "Test#getSample()."
414414
range {
415415
startLine = 0
416416
startCharacter = 15
@@ -420,7 +420,7 @@ class SemanticdbSymbolsTest {
420420
},
421421
SymbolOccurrence {
422422
role = Role.DEFINITION
423-
symbol = "Test#`<init>`().(sample)"
423+
symbol = "Test#setSample()."
424424
range {
425425
startLine = 0
426426
startCharacter = 15

0 commit comments

Comments
 (0)