Skip to content

Commit 618f826

Browse files
authored
Merge pull request #2810 from dotty-staging/fix-ide-refs-external
Fix "Find all references" in the IDE with external projects
2 parents 45e4030 + d010f84 commit 618f826

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/interactive/SourceTree.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ case class SourceTree(tree: tpd.NameTree, source: SourceFile) {
3939
}
4040
object SourceTree {
4141
def fromSymbol(sym: ClassSymbol)(implicit ctx: Context): Option[SourceTree] = {
42-
if (sym == defn.SourceFileAnnot) None // FIXME: No SourceFile annotation on SourceFile itself
42+
if (sym == defn.SourceFileAnnot || // FIXME: No SourceFile annotation on SourceFile itself
43+
sym.sourceFile == null) // FIXME: We cannot deal with external projects yet
44+
None
4345
else {
4446
sym.tree match {
4547
case tree: tpd.TypeDef =>

0 commit comments

Comments
 (0)