Skip to content

Commit f0af0bb

Browse files
committed
Move ParsedComment to compiler project
1 parent ca5faa6 commit f0af0bb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

language-server/src/dotty/tools/languageserver/ParsedComment.scala renamed to compiler/src/dotty/tools/dotc/util/ParsedComment.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
package dotty.tools.languageserver
1+
package dotty.tools.dotc.util
22

33
import dotty.tools.dotc.core.Comments.{Comment, CommentsContext}
44
import dotty.tools.dotc.core.Contexts.Context
55
import dotty.tools.dotc.core.Names.TermName
66
import dotty.tools.dotc.core.Symbols._
7-
import dotty.tools.dotc.util.CommentParsing
87

98
import scala.collection.immutable.ListMap
109
import scala.util.matching.Regex
@@ -59,7 +58,7 @@ class ParsedComment(val comment: Comment) {
5958
for {
6059
(tag, formatter) <- ParsedComment.knownTags
6160
boundss <- groupedSections.get(tag)
62-
texts = boundss.map { (start, end) => clean(content.slice(start, end)) }
61+
texts = boundss.map { case (start, end) => clean(content.slice(start, end)) }
6362
formatted <- formatter(texts)
6463
} {
6564
buf.append(formatted)
@@ -75,7 +74,7 @@ class ParsedComment(val comment: Comment) {
7574
* @param name The parameter name whose documentation to extract.
7675
* @return The formatted documentation corresponding to `name`.
7776
*/
78-
def paramDoc(name: TermName): Option[String] = paramDocs.get(name.toString).map { (start, end) =>
77+
def paramDoc(name: TermName): Option[String] = paramDocs.get(name.toString).map { case (start, end) =>
7978
val rawContent = content.slice(start, end)
8079
val docContent = ParsedComment.prefixRegex.replaceFirstIn(rawContent, "")
8180
clean(docContent)

0 commit comments

Comments
 (0)