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/CommentParser.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/CommentParser.scala')
-rw-r--r-- | doc-tool/src/dotty/tools/dottydoc/model/comment/CommentParser.scala | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentParser.scala b/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentParser.scala index 3c389af1e..b7a33a7ef 100644 --- a/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentParser.scala +++ b/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentParser.scala @@ -195,8 +195,14 @@ trait CommentParser extends util.MemberLookup { shortDescription = allTags(SimpleTagKey("shortDescription")) ) - for ((key, _) <- bodyTags) - dottydoc.println(s"$pos: Tag '@${key.name}' is not recognised") + for ((key, _) <- bodyTags) ctx.docbase.warn( + s"Tag '@${key.name}' is not recognised", + // FIXME: here the position is stretched out over the entire comment, + // with the point being at the very end. This ensures that the entire + // comment will be visible in error reporting. A more fine-grained + // reporting would be amazing here. + entity.symbol.sourcePosition(Position(pos.start, pos.end, pos.end)) + ) cmt } |