File tree Expand file tree Collapse file tree 3 files changed +43
-1
lines changed
main/kotlin/com/sourcegraph/semanticdb_kotlinc
test/kotlin/com/sourcegraph/semanticdb_kotlinc/test Expand file tree Collapse file tree 3 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ class SemanticdbTextDocumentBuilder(
133
133
if (kdoc.isEmpty()) return kdoc
134
134
val out = StringBuilder ().append(" \n\n " ).append(" ----" ).append(" \n " )
135
135
kdoc.lineSequence().forEach { line ->
136
+ if (line.isEmpty()) return @forEach
136
137
var start = 0
137
138
while (start < line.length && line[start].isWhitespace()) {
138
139
start++
Original file line number Diff line number Diff line change 1
1
package com.sourcegraph.semanticdb_kotlinc.test
2
2
3
3
import com.sourcegraph.semanticdb_kotlinc.*
4
+ import com.sourcegraph.semanticdb_kotlinc.Semanticdb.Documentation.Format
5
+ import com.sourcegraph.semanticdb_kotlinc.Semanticdb.Language
4
6
import com.sourcegraph.semanticdb_kotlinc.Semanticdb.SymbolOccurrence.Role
5
7
import com.sourcegraph.semanticdb_kotlinc.test.ExpectedSymbols.SemanticdbData
6
8
import com.sourcegraph.semanticdb_kotlinc.test.ExpectedSymbols.SymbolCacheData
@@ -590,4 +592,44 @@ class SemanticdbSymbolsTest {
590
592
}
591
593
}))))
592
594
.mapCheckExpectedSymbols()
595
+
596
+ @TestFactory
597
+ fun kdoc () =
598
+ listOf (
599
+ ExpectedSymbols (
600
+ " empty kdoc line" ,
601
+ SourceFile .testKt(
602
+ """
603
+ |/**
604
+ |
605
+ |hello world
606
+ |* test content
607
+ |*/
608
+ |val x = ""
609
+ |""" .trimMargin()),
610
+ semanticdb = SemanticdbData (
611
+ expectedSymbols =
612
+ listOf (
613
+ SymbolInformation {
614
+ symbol = " TestKt#x."
615
+ displayName = " x"
616
+ language = Language .KOTLIN
617
+ documentation {
618
+ message = " ```kt\n public val x: kotlin.String\n ```\n\n ----\n\n\n hello world\n test content\n "
619
+ format = Format .MARKDOWN
620
+ }
621
+ },
622
+ SymbolInformation {
623
+ symbol = " TestKt#getX()."
624
+ displayName = " x"
625
+ language = Language .KOTLIN
626
+ documentation {
627
+ message = " ```kt\n public val x: kotlin.String\n ```\n\n ----\n\n\n hello world\n test content\n "
628
+ format = Format .MARKDOWN
629
+ }
630
+ }
631
+ )
632
+ )
633
+ )
634
+ ).mapCheckExpectedSymbols()
593
635
}
Original file line number Diff line number Diff line change 1
-
2
1
rootProject.name = " lsif-kotlin"
3
2
4
3
include(
You can’t perform that action at this time.
0 commit comments