Skip to content

Commit 5e8a8ac

Browse files
committed
Add scalaSig cache in ClassEntryLookUp
1 parent cb804bc commit 5e8a8ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/core/src/main/scala/ch/epfl/scala/debugadapter/internal/ClassEntryLookUp.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ private class ClassEntryLookUp(
4242
logger: Logger
4343
) {
4444
private val sourceLineCache = mutable.Map.empty[SourceLine, Seq[ClassFile]]
45+
private val scalaSigCache = mutable.Map.empty[String, Option[ScalaSig]]
4546

4647
def sources: Iterable[SanitizedUri] = sourceUriToSourceFile.keys
4748
def fullyQualifiedNames: Iterable[String] = {
@@ -145,7 +146,7 @@ private class ClassEntryLookUp(
145146
else scalaSigs.headOption
146147
}
147148

148-
fromClass.orElse(fromSource)
149+
scalaSigCache.getOrElseUpdate(fqcn, fromClass.orElse(fromSource))
149150
}
150151
}
151152

0 commit comments

Comments
 (0)