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