diff --git a/mtags/src/main/scala-3.3.3/scala/meta/internal/pc/printer/RefinedDotcPrinter.scala b/mtags/src/main/scala-3.3.3/scala/meta/internal/pc/printer/RefinedDotcPrinter.scala index af306b68149..608c798caed 100644 --- a/mtags/src/main/scala-3.3.3/scala/meta/internal/pc/printer/RefinedDotcPrinter.scala +++ b/mtags/src/main/scala-3.3.3/scala/meta/internal/pc/printer/RefinedDotcPrinter.scala @@ -15,7 +15,7 @@ import dotty.tools.dotc.printing.Texts.Text but haven't managed to port all of them yet to the LTS */ abstract class RefinedDotcPrinter(_ctx: Context) extends RefinedPrinter(_ctx): - def toTextPrefix(tp: Type) = + def toTextPrefix(tp: Type): Text = tp match case tp: NamedType => super.toTextPrefixOf(tp) case tp => Text() diff --git a/mtags/src/main/scala-3.3/scala/meta/internal/pc/MetalsNavigateAST.scala b/mtags/src/main/scala-3.3/scala/meta/internal/pc/MetalsNavigateAST.scala index 82d9bf7bd14..43816f08fe3 100644 --- a/mtags/src/main/scala-3.3/scala/meta/internal/pc/MetalsNavigateAST.scala +++ b/mtags/src/main/scala-3.3/scala/meta/internal/pc/MetalsNavigateAST.scala @@ -4,7 +4,8 @@ import dotty.tools.dotc.ast.NavigateAST import dotty.tools.dotc.ast.untpd.ExtMethods import dotty.tools.dotc.core.Contexts.Context import dotty.tools.dotc.util.Spans.Span +import dotty.tools.dotc.ast.Positioned object MetalsNavigateAST: - def pathToExtensionParam(span: Span, methods: ExtMethods)(using Context) = + def pathToExtensionParam(span: Span, methods: ExtMethods)(using Context): List[Positioned] = NavigateAST.pathTo(span, methods.paramss.flatten) diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/HoverProvider.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/HoverProvider.scala index 94e0b894f2c..260c04c3268 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/HoverProvider.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/HoverProvider.scala @@ -22,6 +22,7 @@ import dotty.tools.dotc.core.Types.* import dotty.tools.dotc.interactive.Interactive import dotty.tools.dotc.interactive.InteractiveDriver import dotty.tools.dotc.util.SourcePosition +import dotty.tools.dotc.ast.Trees.Tree object HoverProvider: @@ -208,7 +209,7 @@ object HoverProvider: end HoverProvider object SelectDynamicExtractor: - def unapply(path: List[Tree])(using Context) = + def unapply(path: List[Tree])(using Context): Option[(Tree[Type | Null], Name, String)] = path match // the same tests as below, since 3.3.1-RC1 path starts with Select case Select(_, _) :: Apply( diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/PcCollector.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/PcCollector.scala index a86e7bff308..00a5a96a374 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/PcCollector.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/PcCollector.scala @@ -314,7 +314,7 @@ object PcCollector: // Folds over the tree as `DeepFolder` but `f` takes also the parent. class DeepFolderWithParent[X](f: (X, Tree, Option[Tree]) => X): private val traverser = WithParentTraverser[X](f) - def apply(x: X, tree: Tree)(using Context) = + def apply(x: X, tree: Tree)(using Context): X = traverser.traverse(x, tree, None) end PcCollector diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/PcInlayHintsProvider.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/PcInlayHintsProvider.scala index 20d23aa75d5..f47e6bfa044 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/PcInlayHintsProvider.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/PcInlayHintsProvider.scala @@ -28,6 +28,10 @@ import dotty.tools.dotc.util.Spans.Span import org.eclipse.lsp4j as l import org.eclipse.lsp4j.InlayHint import org.eclipse.lsp4j.InlayHintKind +import java.net.URI +import java.nio.file.Path +import dotty.tools.dotc.ast.Trees.Tree +import dotty.tools.dotc.ast.Trees.Untyped class PcInlayHintsProvider( driver: InteractiveDriver, @@ -35,17 +39,17 @@ class PcInlayHintsProvider( symbolSearch: SymbolSearch, )(using ReportContext): - val uri = params.uri() - val filePath = Paths.get(uri) + val uri: URI = params.uri() + val filePath: Path = Paths.get(uri) val sourceText = params.text - val text = sourceText.toCharArray() - val source = + val text: Array[Char] = sourceText.toCharArray() + val source: SourceFile = SourceFile.virtual(filePath.toString, sourceText) driver.run(uri, source) given ctx: Context = driver.currentCtx val unit = driver.latestRun given InferredType.Text = InferredType.Text(text) - val pos = driver.sourcePosition(params) + val pos: SourcePosition = driver.sourcePosition(params) given InlayHintsParams = params def provide(): List[InlayHint] = @@ -193,7 +197,7 @@ class PcInlayHintsProvider( end PcInlayHintsProvider object ImplicitConversion: - def unapply(tree: Tree)(using params: InlayHintsParams, ctx: Context) = + def unapply(tree: Tree)(using params: InlayHintsParams, ctx: Context): Option[(Symbol, SourcePosition)] = if (params.implicitConversions()) { tree match case Apply(fun: Ident, args) if isSynthetic(fun) && args.exists(!_.span.isZeroExtent) => @@ -216,7 +220,7 @@ object ImplicitConversion: end ImplicitConversion object ImplicitParameters: - def unapply(tree: Tree)(using params: InlayHintsParams, ctx: Context) = + def unapply(tree: Tree)(using params: InlayHintsParams, ctx: Context): Option[(List[Symbol], SourcePosition, Boolean)] = if (params.implicitParameters()) { tree match case Apply(fun, args) @@ -246,7 +250,7 @@ object ImplicitParameters: end ImplicitParameters object ValueOf: - def unapply(tree: Tree)(using params: InlayHintsParams, ctx: Context) = + def unapply(tree: Tree)(using params: InlayHintsParams, ctx: Context): Option[(String, SourcePosition)] = if (params.implicitParameters()) { tree match case Apply(ta @ TypeApply(fun, _), _) @@ -263,7 +267,7 @@ object ValueOf: end ValueOf object TypeParameters: - def unapply(tree: Tree)(using params: InlayHintsParams, ctx: Context) = + def unapply(tree: Tree)(using params: InlayHintsParams, ctx: Context): Option[(List[Type], SourcePosition, Tree[Type | Null])] = if (params.typeParameters()) { tree match case TypeApply(sel: Select, _) @@ -287,7 +291,7 @@ object InferredType: object Text: def apply(text: Array[Char]): Text = text - def unapply(tree: Tree)(using params: InlayHintsParams, text: Text, ctx: Context) = + def unapply(tree: Tree)(using params: InlayHintsParams, text: Text, ctx: Context): Option[(Untyped, SourcePosition, dotty.tools.dotc.ast.Trees.ValDef[Untyped]) | ((Untyped, SourcePosition, dotty.tools.dotc.ast.Trees.DefDef[Untyped]) | (Type, SourcePosition, dotty.tools.dotc.ast.Trees.Bind[Untyped]))] = if (params.inferredTypes()) { tree match case vd @ ValDef(_, tpe, _) @@ -325,7 +329,7 @@ object InferredType: /* If is left part of val definition bind: * val <> @ ... = */ - def isValDefBind(text: Text, vd: ValDef)(using Context) = + def isValDefBind(text: Text, vd: ValDef)(using Context): Boolean = val afterDef = text.drop(vd.nameSpan.end) val index = indexAfterSpacesAndComments(afterDef) index >= 0 && index < afterDef.size && afterDef(index) == '@' diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/PcInlineValueProviderImpl.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/PcInlineValueProviderImpl.scala index fd8510d7bcb..6cfa8cb7ecf 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/PcInlineValueProviderImpl.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/PcInlineValueProviderImpl.scala @@ -193,7 +193,7 @@ final class PcInlineValueProviderImpl( end PcInlineValueProviderImpl case class Occurence(tree: Tree, parent: Option[Tree], pos: SourcePosition): - def isDefn = + def isDefn: Boolean = tree match case _: ValDef => true case _ => false diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/PcRenameProvider.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/PcRenameProvider.scala index d4c006b68a0..b5c48a8e47d 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/PcRenameProvider.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/PcRenameProvider.scala @@ -29,7 +29,7 @@ final class PcRenameProvider( else None ) - val newName = name.map(_.stripBackticks.backticked).getOrElse("newName") + val newName: String = name.map(_.stripBackticks.backticked).getOrElse("newName") def collect( parent: Option[Tree] diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/PcSymbolSearch.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/PcSymbolSearch.scala index 0ab8bdce569..30b41499f43 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/PcSymbolSearch.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/PcSymbolSearch.scala @@ -20,13 +20,15 @@ import dotty.tools.dotc.core.Types.* import dotty.tools.dotc.interactive.Interactive import dotty.tools.dotc.util.SourcePosition import dotty.tools.dotc.util.Spans.Span +import dotty.tools.dotc.ast.Trees.Tree +import dotty.tools.dotc.ast.Trees.Tree trait PcSymbolSearch: self: WithCompilationUnit => private val caseClassSynthetics: Set[Name] = Set(nme.apply, nme.copy) - lazy val rawPath = + lazy val rawPath: List[Tree[Type]] = Interactive .pathTo(driver.openedTrees(uri), pos)(using driver.currentCtx) .dropWhile(t => // NamedArg anyway doesn't have symbol @@ -35,12 +37,12 @@ trait PcSymbolSearch: t.isInstanceOf[TypeTree] ) - lazy val extensionMethods = + lazy val extensionMethods: Option[ExtMethods] = NavigateAST .untypedPath(pos.span)(using compilatonUnitContext) .collectFirst { case em @ ExtMethods(_, _) => em } - lazy val path = rawPath match + lazy val path: List[Tree[Type]] = rawPath match // For type it will sometimes go into the wrong tree since TypeTree also contains the same span // https://github.com/lampepfl/dotty/issues/15937 case TypeApply(sel: Select, _) :: tail if sel.span.contains(pos.span) => @@ -274,7 +276,7 @@ object PcSymbolSearch: case sel: Select => sel.sourcePos.withSpan(selectNameSpan(sel)) case _ => tree.sourcePos - def isGeneratedGiven(df: NamedDefTree, sourceText: String)(using Context) = + def isGeneratedGiven(df: NamedDefTree, sourceText: String)(using Context): Boolean = val nameSpan = df.nameSpan df.symbol.is(Flags.Given) && sourceText.substring( nameSpan.start, diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/Scala3CompilerWrapper.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/Scala3CompilerWrapper.scala index fc2ecbfb3a4..aed46140c3c 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/Scala3CompilerWrapper.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/Scala3CompilerWrapper.scala @@ -13,7 +13,7 @@ class Scala3CompilerWrapper(driver: MetalsDriver) override def reporterAccess: ReporterAccess[StoreReporter] = new ReporterAccess[StoreReporter]: - def reporter = driver.currentCtx.reporter.asInstanceOf[StoreReporter] + def reporter: StoreReporter = driver.currentCtx.reporter.asInstanceOf[StoreReporter] override def askShutdown(): Unit = () diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala index 41ecb44f786..61677646605 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala @@ -57,7 +57,7 @@ case class ScalaPresentationCompiler( .map(StdReportContext(_, _ => buildTargetName, reportsLevel)) .getOrElse(EmptyReportContext) - override def withBuildTargetName(buildTargetName: String) = + override def withBuildTargetName(buildTargetName: String): PresentationCompiler = copy(buildTargetName = Some(buildTargetName)) override def withReportsLoggerLevel(level: String): PresentationCompiler = @@ -468,7 +468,7 @@ case class ScalaPresentationCompiler( def withWorkspace(workspace: Path): PresentationCompiler = copy(folderPath = Some(workspace)) - override def isLoaded() = compilerAccess.isLoaded() + override def isLoaded(): Boolean = compilerAccess.isLoaded() override def buildTargetId(): String = buildTargetIdentifier diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/SignatureHelpProvider.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/SignatureHelpProvider.scala index 800266ec6e8..d964c2559e6 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/SignatureHelpProvider.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/SignatureHelpProvider.scala @@ -34,7 +34,7 @@ object SignatureHelpProvider: driver: InteractiveDriver, params: OffsetParams, search: SymbolSearch, - ) = + ): l.SignatureHelp = val uri = params.uri val sourceFile = CompilerInterfaces.toSource(params.uri, params.text) driver.run(uri, sourceFile) diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/WithCompilationUnit.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/WithCompilationUnit.scala index 8ce0fd390be..338686f238b 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/WithCompilationUnit.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/WithCompilationUnit.scala @@ -14,34 +14,37 @@ import dotty.tools.dotc.core.NameOps.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.interactive.InteractiveDriver import dotty.tools.dotc.util.SourceFile +import java.net.URI +import java.nio.file.Path +import dotty.tools.dotc.util.SourcePosition class WithCompilationUnit( val driver: InteractiveDriver, params: VirtualFileParams, ): - val uri = params.uri() - val filePath = Paths.get(uri) + val uri: URI = params.uri() + val filePath: Path = Paths.get(uri) val sourceText = params.text - val text = sourceText.toCharArray() - val source = + val text: Array[Char] = sourceText.toCharArray() + val source: SourceFile = SourceFile.virtual(filePath.toString, sourceText) driver.run(uri, source) given ctx: Context = driver.currentCtx val unit = driver.latestRun - val compilatonUnitContext = ctx.fresh.setCompilationUnit(unit) - val offset = params match + val compilatonUnitContext: FreshContext = ctx.fresh.setCompilationUnit(unit) + val offset: Int = params match case op: OffsetParams => op.offset() case _ => 0 - val offsetParams = + val offsetParams: OffsetParams = params match case op: OffsetParams => op case _ => CompilerOffsetParams(params.uri(), params.text(), 0, params.token()) - val pos = driver.sourcePosition(offsetParams) + val pos: SourcePosition = driver.sourcePosition(offsetParams) // First identify the symbol we are at, comments identify @@ as current cursor position - def symbolAlternatives(sym: Symbol)(using Context) = + def symbolAlternatives(sym: Symbol)(using Context): Set[Symbol] = def member(parent: Symbol) = parent.info.member(sym.name).symbol def primaryConstructorTypeParam(owner: Symbol) = for diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/CompletionSuffix.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/CompletionSuffix.scala index 4886ce17c24..04a81371faf 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/CompletionSuffix.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/CompletionSuffix.scala @@ -8,12 +8,12 @@ case class CompletionSuffix( suffixes: Set[SuffixKind], snippet: SuffixKind, ): - def addLabelSnippet = suffixes.contains(SuffixKind.Bracket) - def hasSnippet = snippet != SuffixKind.NoSuffix - def chain(copyFn: CompletionSuffix => CompletionSuffix) = copyFn(this) - def withNewSuffix(kind: SuffixKind) = + def addLabelSnippet: Boolean = suffixes.contains(SuffixKind.Bracket) + def hasSnippet: Boolean = snippet != SuffixKind.NoSuffix + def chain(copyFn: CompletionSuffix => CompletionSuffix): CompletionSuffix = copyFn(this) + def withNewSuffix(kind: SuffixKind): CompletionSuffix = CompletionSuffix(suffixes + kind, snippet) - def withNewSuffixSnippet(kind: SuffixKind) = + def withNewSuffixSnippet(kind: SuffixKind): CompletionSuffix = CompletionSuffix(suffixes + kind, kind) def toEdit: String = def loop(suffixes: List[SuffixKind]): String = @@ -30,7 +30,7 @@ case class CompletionSuffix( end CompletionSuffix object CompletionSuffix: - val empty = CompletionSuffix( + val empty: CompletionSuffix = CompletionSuffix( suffixes = Set.empty, snippet = SuffixKind.NoSuffix, ) diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/Completions.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/Completions.scala index eb69e0ce9c7..f59d8078fd1 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/Completions.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/Completions.scala @@ -57,7 +57,7 @@ class Completions( val coursierComplete = new CoursierComplete(BuildInfo.scalaCompilerVersion) // versions prior to 3.1.0 sometimes didn't manage to detect properly Java objects - val canDetectJavaObjectsCorrectly = + val canDetectJavaObjectsCorrectly: Boolean = SemVer.isLaterVersion("3.1.0", BuildInfo.scalaCompilerVersion) private lazy val shouldAddSnippet = @@ -843,7 +843,7 @@ class Completions( def postProcess(items: List[CompletionValue]): List[CompletionValue] object CompletionApplication: - val empty = new CompletionApplication: + val empty: CompletionApplication = new CompletionApplication: def isImplicitConversion(symbol: Symbol): Boolean = false def isMember(symbol: Symbol): Boolean = false def isInherited(symbol: Symbol): Boolean = false @@ -892,8 +892,8 @@ class Completions( cursorPos: CursorPos, ): Ordering[CompletionValue] = new Ordering[CompletionValue]: - val queryLower = completionPos.query.toLowerCase() - val fuzzyCache = mutable.Map.empty[CompletionValue, Int] + val queryLower: String = completionPos.query.toLowerCase() + val fuzzyCache: scala.collection.mutable.Map[CompletionValue, Int] = mutable.Map.empty[CompletionValue, Int] def compareLocalSymbols(s1: Symbol, s2: Symbol): Int = if s1.isLocal && s2.isLocal && s1.sourcePos.exists && s2.sourcePos.exists diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/InterpolatorCompletions.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/InterpolatorCompletions.scala index e2859fc444c..7aca1aced26 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/InterpolatorCompletions.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/InterpolatorCompletions.scala @@ -34,7 +34,7 @@ object InterpolatorCompletions: search: SymbolSearch, config: PresentationCompilerConfig, buildTargetIdentifier: String, - )(using Context, ReportContext) = + )(using Context, ReportContext): List[CompletionValue] = InterpolationSplice(pos.span.point, text.toCharArray(), text) match case Some(interpolator) => InterpolatorCompletions.contributeScope( diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/MatchCaseCompletions.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/MatchCaseCompletions.scala index a343effd7a7..9f88ec81ae6 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/MatchCaseCompletions.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/MatchCaseCompletions.scala @@ -32,6 +32,9 @@ import dotty.tools.dotc.core.Types.Type import dotty.tools.dotc.core.Types.TypeRef import dotty.tools.dotc.util.SourcePosition import org.eclipse.lsp4j as l +import dotty.tools.dotc.ast.Trees.Tree +import dotty.tools.dotc.ast.Trees.Tree +import dotty.tools.dotc.ast.Trees.Tree object CaseKeywordCompletion: @@ -390,7 +393,7 @@ class CompletionValueGenerator( patternOnly: Option[String] = None, hasBind: Boolean = false, ): - def fuzzyMatches(name: String) = + def fuzzyMatches(name: String): Boolean = patternOnly match case None => true case Some("") => true @@ -525,7 +528,7 @@ class MatchCaseExtractor( completionPos: CompletionPos, ): object MatchExtractor: - def unapply(path: List[Tree]) = + def unapply(path: List[Tree]): Option[Tree[Type | Null]] = path match // foo mat@@ case (sel @ Select(qualifier, name)) :: _ @@ -594,7 +597,7 @@ class MatchCaseExtractor( end CaseExtractor object CasePatternExtractor: - def unapply(path: List[Tree])(using Context) = + def unapply(path: List[Tree])(using Context): Option[(Tree[Type], Tree[Type], String)] = path match // case @@ case (c @ CaseDef( @@ -621,7 +624,7 @@ class MatchCaseExtractor( end CasePatternExtractor object TypedCasePatternExtractor: - def unapply(path: List[Tree])(using Context) = + def unapply(path: List[Tree])(using Context): Option[(Tree[Type], Tree[Type], String)] = path match // case _: Som@@ => case Ident(name) :: Typed(_, _) :: CaseExtractor(selector, parent, _) => diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/NamedArgCompletions.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/NamedArgCompletions.scala index c6750f44c75..e7765599a18 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/NamedArgCompletions.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/NamedArgCompletions.scala @@ -386,7 +386,7 @@ class FuzzyArgMatcher(tparams: List[Symbols.Symbol])(using Context): */ def doMatch( allArgsProvided: Boolean - )(expectedArgs: List[Symbols.Symbol], actualArgs: List[Tree]) = + )(expectedArgs: List[Symbols.Symbol], actualArgs: List[Tree]): Boolean = (expectedArgs.length == actualArgs.length || (!allArgsProvided && expectedArgs.length >= actualArgs.length)) && actualArgs.zipWithIndex.forall { diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/OverrideCompletions.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/OverrideCompletions.scala index 93db885653b..0565d456b41 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/OverrideCompletions.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/OverrideCompletions.scala @@ -31,6 +31,7 @@ import dotty.tools.dotc.interactive.InteractiveDriver import dotty.tools.dotc.util.SourceFile import dotty.tools.dotc.util.SourcePosition import org.eclipse.lsp4j as l +import dotty.tools.dotc.ast.tpd object OverrideCompletions: private type TargetDef = TypeDef | DefDef @@ -531,7 +532,7 @@ object OverrideCompletions: }) object OverrideExtractor: - def unapply(path: List[Tree])(using Context) = + def unapply(path: List[Tree])(using Context): Option[(tpd.TypeDef, Option[Symbol], Int, Boolean, None.type) | (tpd.TypeDef, None.type, Int, Boolean, Some[String])] = path match // class FooImpl extends Foo: // def x| diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/ScalaCliCompletions.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/ScalaCliCompletions.scala index 22363e361fd..23b26b9c08d 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/completions/ScalaCliCompletions.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/completions/ScalaCliCompletions.scala @@ -5,13 +5,14 @@ import scala.meta.internal.mtags.MtagsEnrichments.* import dotty.tools.dotc.ast.tpd.* import dotty.tools.dotc.util.SourcePosition +import scala.meta.internal.pc.completions.CompletionValue.IvyImport class ScalaCliCompletions( coursierComplete: CoursierComplete, pos: SourcePosition, text: String, ): - def unapply(path: List[Tree]) = + def unapply(path: List[Tree]): Option[String] = def scalaCliDep = CoursierComplete.isScalaCliDep( pos.lineContent.take(pos.column).stripPrefix("/*