Skip to content

Commit 4b734bf

Browse files
committed
Partially cleanup BasicSupport
1 parent 0348d48 commit 4b734bf

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

scaladoc/src/dotty/tools/scaladoc/tasty/BasicSupport.scala

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import ScaladocSupport._
1010

1111
trait BasicSupport:
1212
self: TastyParser =>
13-
import qctx.reflect._
13+
1414
object SymOpsWithLinkCache extends SymOpsWithLinkCache
1515
export SymOpsWithLinkCache._
1616

17-
private given qctx.type = qctx
1817

19-
def parseAnnotation(annotTerm: Term): Annotation =
18+
def parseAnnotation(using Quotes)(annotTerm: quotes.reflect.Term): Annotation =
19+
import quotes.reflect._
2020
import dotty.tools.dotc.ast.Trees.{SeqLiteral}
2121
val dri = annotTerm.tpe.typeSymbol.dri
2222
def inner(t: Term): List[Annotation.AnnotationParameter] = t match {
@@ -29,18 +29,17 @@ trait BasicSupport:
2929
case other => List(Annotation.UnresolvedParameter(None, other.show))
3030
}
3131

32-
3332
val params = annotTerm match
3433
case Apply(target, appliedWith) => {
3534
appliedWith.flatMap(inner)
3635
}
3736

3837
Annotation(dri, params)
3938

40-
extension (sym: Symbol)
39+
extension (using Quotes)(sym: quotes.reflect.Symbol)
4140
def documentation = sym.docstring.map(parseComment(_, sym.tree))
4241

43-
def source(using Quotes) =
42+
def source =
4443
val path = sym.pos.map(_.sourceFile.jpath).filter(_ != null).map(_.toAbsolutePath)
4544
path.map(TastyMemberSource(_, sym.pos.get.startLine))
4645

@@ -54,5 +53,4 @@ trait BasicSupport:
5453
}.map(parseAnnotation)
5554

5655
def isLeftAssoc: Boolean = !sym.name.endsWith(":")
57-
58-
56+
end extension

scaladoc/src/dotty/tools/scaladoc/tasty/ClassLikeSupport.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ trait ClassLikeSupport:
455455
modifiers = modifiers,
456456
annotations = symbol.getAnnotations(),
457457
signature = signature,
458-
sources = symbol.source(using qctx),
458+
sources = symbol.source,
459459
origin = origin,
460460
inheritedFrom = inheritedFrom,
461461
graph = graph,

0 commit comments

Comments
 (0)