@@ -6,10 +6,12 @@ import scala.jdk.CollectionConverters._
66import dotty .tools .scaladoc .Scaladoc .CommentSyntax
77import dotty .tools .scaladoc .tasty .comments .Comment
88
9- trait ScaladocSupport { self : TastyParser =>
10- import qctx .reflect ._
9+ import scala .quoted ._
1110
12- def parseCommentString (comment : String , sym : Symbol , pos : Option [Position ]): Comment =
11+ object ScaladocSupport :
12+
13+ def parseCommentString (using Quotes , DocContext )(comment : String , sym : quotes.reflect.Symbol , pos : Option [quotes.reflect.Position ]): Comment =
14+ import quotes .reflect .report
1315 val preparsed = comments.Preparser .preparse(comments.Cleaner .clean(comment))
1416
1517 val commentSyntax =
@@ -22,22 +24,22 @@ trait ScaladocSupport { self: TastyParser =>
2224
2325 CommentSyntax .default
2426 }
25- case None => ctx .args.defaultSyntax
27+ case None => summon[ DocContext ] .args.defaultSyntax
2628 }
2729
2830 val parser = commentSyntax match {
2931 case CommentSyntax .Wiki =>
30- comments.WikiCommentParser (comments.Repr (qctx )(sym))
32+ comments.WikiCommentParser (comments.Repr (quotes )(sym))
3133 case CommentSyntax .Markdown =>
32- comments.MarkdownCommentParser (comments.Repr (qctx )(sym))
34+ comments.MarkdownCommentParser (comments.Repr (quotes )(sym))
3335 }
3436 parser.parse(preparsed)
3537
36- def parseComment (docstring : String , tree : Tree ): Comment =
38+ def parseComment (using Quotes , DocContext )( docstring : String , tree : quotes.reflect. Tree ): Comment =
3739 val commentString : String =
3840 if tree.symbol.isClassDef || tree.symbol.owner.isClassDef then
3941 import dotty .tools .dotc
40- given ctx : dotc.core.Contexts .Context = qctx .asInstanceOf [scala.quoted.runtime.impl.QuotesImpl ].ctx
42+ given ctx : dotc.core.Contexts .Context = quotes .asInstanceOf [scala.quoted.runtime.impl.QuotesImpl ].ctx
4143
4244 val sym = tree.symbol.asInstanceOf [dotc.core.Symbols .Symbol ]
4345
@@ -47,5 +49,3 @@ trait ScaladocSupport { self: TastyParser =>
4749 docstring
4850
4951 parseCommentString(commentString, tree.symbol, Some (tree.pos))
50-
51- }
0 commit comments