@@ -6,10 +6,12 @@ import scala.jdk.CollectionConverters._
6
6
import dotty .tools .scaladoc .Scaladoc .CommentSyntax
7
7
import dotty .tools .scaladoc .tasty .comments .Comment
8
8
9
- trait ScaladocSupport { self : TastyParser =>
10
- import qctx .reflect ._
9
+ import scala .quoted ._
11
10
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
13
15
val preparsed = comments.Preparser .preparse(comments.Cleaner .clean(comment))
14
16
15
17
val commentSyntax =
@@ -22,22 +24,22 @@ trait ScaladocSupport { self: TastyParser =>
22
24
23
25
CommentSyntax .default
24
26
}
25
- case None => ctx .args.defaultSyntax
27
+ case None => summon[ DocContext ] .args.defaultSyntax
26
28
}
27
29
28
30
val parser = commentSyntax match {
29
31
case CommentSyntax .Wiki =>
30
- comments.WikiCommentParser (comments.Repr (qctx )(sym))
32
+ comments.WikiCommentParser (comments.Repr (quotes )(sym))
31
33
case CommentSyntax .Markdown =>
32
- comments.MarkdownCommentParser (comments.Repr (qctx )(sym))
34
+ comments.MarkdownCommentParser (comments.Repr (quotes )(sym))
33
35
}
34
36
parser.parse(preparsed)
35
37
36
- def parseComment (docstring : String , tree : Tree ): Comment =
38
+ def parseComment (using Quotes , DocContext )( docstring : String , tree : quotes.reflect. Tree ): Comment =
37
39
val commentString : String =
38
40
if tree.symbol.isClassDef || tree.symbol.owner.isClassDef then
39
41
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
41
43
42
44
val sym = tree.symbol.asInstanceOf [dotc.core.Symbols .Symbol ]
43
45
@@ -47,5 +49,3 @@ trait ScaladocSupport { self: TastyParser =>
47
49
docstring
48
50
49
51
parseCommentString(commentString, tree.symbol, Some (tree.pos))
50
-
51
- }
0 commit comments