diff --git a/metals-bench/src/main/scala/bench/MetalsBench.scala b/metals-bench/src/main/scala/bench/MetalsBench.scala index aac04d8fcdf..726a934d377 100644 --- a/metals-bench/src/main/scala/bench/MetalsBench.scala +++ b/metals-bench/src/main/scala/bench/MetalsBench.scala @@ -105,7 +105,7 @@ class MetalsBench { @Benchmark @BenchmarkMode(Array(Mode.SingleShotTime)) def typeHierarchyIndex(): Unit = { - scalaDependencySources.inputs.foreach { input => + scalaDependencySources.inputs.foreach { case (input, _) => implicit val rc: ReportContext = EmptyReportContext new ScalaToplevelMtags( input, diff --git a/metals/src/main/scala/scala/meta/internal/metals/Compilers.scala b/metals/src/main/scala/scala/meta/internal/metals/Compilers.scala index 81addc30a37..2acd4c530ed 100644 --- a/metals/src/main/scala/scala/meta/internal/metals/Compilers.scala +++ b/metals/src/main/scala/scala/meta/internal/metals/Compilers.scala @@ -38,8 +38,7 @@ import scala.meta.pc.OffsetParams import scala.meta.pc.PresentationCompiler import scala.meta.pc.SymbolSearch import scala.meta.pc.SyntheticDecorationsParams -import scala.meta.pc.SyntheticDecoration -import scala.meta.pc.VirtualFileParams + import ch.epfl.scala.bsp4j.BuildTargetIdentifier import ch.epfl.scala.bsp4j.CompileReport import org.eclipse.lsp4j.CompletionItem diff --git a/metals/src/main/scala/scala/meta/internal/metals/MetalsLspService.scala b/metals/src/main/scala/scala/meta/internal/metals/MetalsLspService.scala index ebf942e17f0..4d3a7bcd8ef 100644 --- a/metals/src/main/scala/scala/meta/internal/metals/MetalsLspService.scala +++ b/metals/src/main/scala/scala/meta/internal/metals/MetalsLspService.scala @@ -517,16 +517,6 @@ class MetalsLspService( ) } - private val referencesProvider: ReferenceProvider = new ReferenceProvider( - folder, - semanticdbs, - buffers, - definitionProvider, - trees, - buildTargets, - compilers, - ) - private val formattingProvider: FormattingProvider = new FormattingProvider( folder, buffers, @@ -545,26 +535,6 @@ class MetalsLspService( semanticdbs, ) - private val packageProvider: PackageProvider = - new PackageProvider( - buildTargets, - trees, - referencesProvider, - buffers, - definitionProvider, - ) - - private val newFileProvider: NewFileProvider = new NewFileProvider( - languageClient, - packageProvider, - scalaVersionSelector, - clientConfig.icons, - onCreate = path => { - buildTargets.onCreate(path) - onChange(List(path)) - }, - ) - private val symbolSearch: MetalsSymbolSearch = new MetalsSymbolSearch( symbolDocs, workspaceSymbols, @@ -597,7 +567,7 @@ class MetalsLspService( ) } - private val compilers: Compilers = register( + val compilers: Compilers = register( new Compilers( folder, clientConfig, @@ -618,6 +588,37 @@ class MetalsLspService( ) ) + private val referencesProvider: ReferenceProvider = new ReferenceProvider( + folder, + semanticdbs, + buffers, + definitionProvider, + trees, + buildTargets, + compilers, + scalaVersionSelector, + ) + + private val packageProvider: PackageProvider = + new PackageProvider( + buildTargets, + trees, + referencesProvider, + buffers, + definitionProvider, + ) + + private val newFileProvider: NewFileProvider = new NewFileProvider( + languageClient, + packageProvider, + scalaVersionSelector, + clientConfig.icons, + onCreate = path => { + buildTargets.onCreate(path) + onChange(List(path)) + }, + ) + private val javaFormattingProvider: JavaFormattingProvider = new JavaFormattingProvider( buffers, diff --git a/mtags/src/main/scala-3-wrapper/ScalaPresentationCompiler.scala b/mtags/src/main/scala-3-wrapper/ScalaPresentationCompiler.scala index d7ed65a71d5..74053eb964d 100644 --- a/mtags/src/main/scala-3-wrapper/ScalaPresentationCompiler.scala +++ b/mtags/src/main/scala-3-wrapper/ScalaPresentationCompiler.scala @@ -14,7 +14,7 @@ import scala.concurrent.ExecutionContextExecutor import scala.jdk.CollectionConverters._ import scala.meta.internal.metals.ReportLevel -import scala.meta.internal.mtags.CommonMtagsEnrichments.* +import scala.meta.internal.mtags.CommonMtagsEnrichments._ import scala.meta.pc.AutoImportsResult import scala.meta.pc.Buffers import scala.meta.pc.DefinitionResult @@ -22,8 +22,8 @@ import scala.meta.pc.HoverSignature import scala.meta.pc.InlayHintsParams import scala.meta.pc.Node import scala.meta.pc.OffsetParams -import scala.meta.pc.PcSymbolInformation import scala.meta.pc.PcAdjustFileParams +import scala.meta.pc.PcSymbolInformation import scala.meta.pc.PresentationCompiler import scala.meta.pc.PresentationCompilerConfig import scala.meta.pc.RangeParams