From 0d295b95c1164b45fc1b5aac5efec876a8eea8e2 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Mon, 17 Jul 2023 11:32:48 +0200 Subject: [PATCH] Restore `Scanner.commentSpans` to preserve source/binary compatibility in 3.3.x minor --- compiler/src/dotty/tools/dotc/parsing/Scanners.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala index fac73bfb4992..ae292d2e8b98 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala @@ -233,6 +233,10 @@ object Scanners { /** Return a list of all the comment positions */ def commentSpans: List[Span] = commentPosBuf.toList + /** Return a list of all the comment positions */ + @deprecated("Use `comments` to get rich information source comments", since = "3.3.1") + def commentSpans: List[Span] = comments.map(_.span) + private def addComment(comment: Comment): Unit = { val lookahead = lookaheadReader() def nextPos: Int = (lookahead.getc(): @switch) match {