diff --git a/metals/src/main/scala/scala/meta/internal/implementation/ImplementationProvider.scala b/metals/src/main/scala/scala/meta/internal/implementation/ImplementationProvider.scala index 28f9c8dd510..35ac7069da4 100644 --- a/metals/src/main/scala/scala/meta/internal/implementation/ImplementationProvider.scala +++ b/metals/src/main/scala/scala/meta/internal/implementation/ImplementationProvider.scala @@ -185,7 +185,6 @@ final class ImplementationProvider( .toGlobal( compilers, implementationsInDependencySources.asScala.toMap, - source, ) symbolLocationsFromContext( diff --git a/metals/src/main/scala/scala/meta/internal/implementation/InheritanceContext.scala b/metals/src/main/scala/scala/meta/internal/implementation/InheritanceContext.scala index acfa9cf54be..58609c3d172 100644 --- a/metals/src/main/scala/scala/meta/internal/implementation/InheritanceContext.scala +++ b/metals/src/main/scala/scala/meta/internal/implementation/InheritanceContext.scala @@ -25,12 +25,10 @@ class InheritanceContext(inheritance: Map[String, Set[ClassLocation]]) { def toGlobal( compilers: Compilers, implementationsInDependencySources: Map[String, Set[ClassLocation]], - source: AbsolutePath, ) = new GlobalInheritanceContext( compilers, implementationsInDependencySources, inheritance, - source, ) } @@ -38,7 +36,6 @@ class GlobalInheritanceContext( compilers: Compilers, implementationsInDependencySources: Map[String, Set[ClassLocation]], localInheritance: Map[String, Set[ClassLocation]], - source: AbsolutePath, ) extends InheritanceContext(localInheritance) { override def getLocations( symbol: String @@ -51,8 +48,8 @@ class GlobalInheritanceContext( val resolveGlobal = implementationsInDependencySources .getOrElse(shortName, Set.empty) - .collect { case loc @ ClassLocation(sym, _) => - compilers.info(source, sym).map { + .map { case loc @ ClassLocation(symbol, Some(path)) => + compilers.info(AbsolutePath(path), loc.symbol).map { case Some(symInfo) if symInfo.parents.contains(symbol) => Some(loc) case Some(symInfo) if symInfo.dealisedSymbol == symbol && symInfo.symbol != symbol => diff --git a/mtags/src/main/scala/scala/meta/internal/mtags/ScalaToplevelMtags.scala b/mtags/src/main/scala/scala/meta/internal/mtags/ScalaToplevelMtags.scala index a584e850a57..2e7484e05ed 100644 --- a/mtags/src/main/scala/scala/meta/internal/mtags/ScalaToplevelMtags.scala +++ b/mtags/src/main/scala/scala/meta/internal/mtags/ScalaToplevelMtags.scala @@ -297,7 +297,7 @@ class ScalaToplevelMtags( } else scanner.nextToken() loop(indent, isAfterNewline = false, currRegion, newExpectIgnoreBody) case TYPE if expectTemplate.map(!_.isExtension).getOrElse(true) => - if (needEmitMember(currRegion)) { + if (needEmitMember(currRegion) && !prevWasDot) { withOwner(currRegion.termOwner) { emitType(needEmitTermMember()) }