diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-02-01 19:37:39 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2017-02-01 19:37:39 +0100 |
commit | e64c2e2d01cf30fe843fa3d4eff977c8b1ecccc4 (patch) | |
tree | 666cddc172ff213008e5841ace6dc62acf7e26b0 /doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala | |
parent | dbbb7a3d9a668bbb8b62bec38f065f2444dacb91 (diff) | |
download | dotty-e64c2e2d01cf30fe843fa3d4eff977c8b1ecccc4.tar.gz dotty-e64c2e2d01cf30fe843fa3d4eff977c8b1ecccc4.tar.bz2 dotty-e64c2e2d01cf30fe843fa3d4eff977c8b1ecccc4.zip |
Add position based error reporting to dottydoc
Diffstat (limited to 'doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala')
-rw-r--r-- | doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala b/doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala index 1d98ff3f6..5b6c34de8 100644 --- a/doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala +++ b/doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala @@ -11,6 +11,8 @@ import com.vladsch.flexmark.ast.{ Node => MarkdownNode } import HtmlParsers._ import util.MemberLookup +import dotc.util.SourceFile + case class Comment ( body: String, short: String, @@ -73,7 +75,10 @@ trait MarkupConversion[T] extends MemberLookup { private def single(annot: String, xs: List[String], filter: Boolean = true)(implicit ctx: Context): Option[T] = (if (filter) filterEmpty(xs) else xs.map(stringToMarkup)) match { case x :: xs => - if (xs.nonEmpty) dottydoc.println(s"Only allowed to have a single annotation for $annot") + if (xs.nonEmpty) ctx.docbase.warn( + s"Only allowed to have a single annotation for $annot", + ent.symbol.sourcePosition(pos) + ) Some(x) case _ => None } |