File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
compiler/src/dotty/tools/dotc/interactive Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -321,15 +321,15 @@ object Completion:
321321 * 8. symbol is not a constructor proxy module when in type completion mode
322322 * 9. have same term/type kind as name prefix given so far
323323 */
324- def isValidCompletionSymbol (sym : Symbol , completionMode : Mode , isNew : Boolean )(using Context ): Boolean =
325-
324+ def isValidCompletionSymbol (sym : Symbol , completionMode : Mode , isNew : Boolean )(using Context ): Boolean = try
326325 lazy val isEnum = sym.is(Enum ) ||
327326 (sym.companionClass.exists && sym.companionClass.is(Enum ))
328327
329328 sym.exists &&
330329 ! sym.isAbsent(canForce = false ) &&
331330 ! sym.isPrimaryConstructor &&
332- sym.sourceSymbol.exists &&
331+ // running sourceSymbol on ExportedTerm will force a lot of computation from collectSubTrees
332+ (sym.is(ExportedTerm ) || sym.sourceSymbol.exists) &&
333333 (! sym.is(Package ) || sym.is(ModuleClass )) &&
334334 ! sym.isAllOf(Mutable | Accessor ) &&
335335 ! sym.isPackageObject &&
@@ -340,6 +340,9 @@ object Completion:
340340 (completionMode.is(Mode .Term ) && (sym.isTerm || sym.is(ModuleClass ))
341341 || (completionMode.is(Mode .Type ) && (sym.isType || sym.isStableMember)))
342342 )
343+ catch
344+ case NonFatal (ex) =>
345+ false
343346 end isValidCompletionSymbol
344347
345348 given ScopeOrdering (using Context ): Ordering [Seq [SingleDenotation ]] with
You can’t perform that action at this time.
0 commit comments