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:
321
321
* 8. symbol is not a constructor proxy module when in type completion mode
322
322
* 9. have same term/type kind as name prefix given so far
323
323
*/
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
326
325
lazy val isEnum = sym.is(Enum ) ||
327
326
(sym.companionClass.exists && sym.companionClass.is(Enum ))
328
327
329
328
sym.exists &&
330
329
! sym.isAbsent(canForce = false ) &&
331
330
! 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) &&
333
333
(! sym.is(Package ) || sym.is(ModuleClass )) &&
334
334
! sym.isAllOf(Mutable | Accessor ) &&
335
335
! sym.isPackageObject &&
@@ -340,6 +340,9 @@ object Completion:
340
340
(completionMode.is(Mode .Term ) && (sym.isTerm || sym.is(ModuleClass ))
341
341
|| (completionMode.is(Mode .Type ) && (sym.isType || sym.isStableMember)))
342
342
)
343
+ catch
344
+ case NonFatal (ex) =>
345
+ false
343
346
end isValidCompletionSymbol
344
347
345
348
given ScopeOrdering (using Context ): Ordering [Seq [SingleDenotation ]] with
You can’t perform that action at this time.
0 commit comments