Skip to content

Commit

Permalink
Reformat with scalafmt 3.8.5
Browse files Browse the repository at this point in the history
Executed command: scalafmt --non-interactive
  • Loading branch information
scalameta-bot authored and tgodzik committed Jan 20, 2025
1 parent 5284950 commit c6e994d
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ val mtagsSettings = List(
scala3ScalametaDependency,
scala3SemanticdbDependency,
),
),
)
},
libraryDependencies ++= {
if (isCI) Nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,8 @@ class BspConnector(
.showMessageRequest(query.params)
.asScala
.map(item =>
Option(item).map(item =>
distinctServers(query.mapping(item.getTitle))
)
Option(item)
.map(item => distinctServers(query.mapping(item.getTitle)))
)
_ = tables.buildServers.chooseServer(item.getName())
_ = optSetBuildTool(item.getName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ class BuildTargetInfo(buildTargets: BuildTargets) {
output += " runtime - https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#standard-options-for-java"
output += " "
if (info.options.nonEmpty)
info.options.foreach(f =>
output += s" ${if (f.isEmpty) "[BLANK]" else f}"
)
info.options
.foreach(f => output += s" ${if (f.isEmpty) "[BLANK]" else f}")
else
output += " [BLANK]"
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ class WorkspaceFolders(
val scalaServices =
scalaProjects
.filterNot(path =>
path.optDelegatePath.exists(path =>
scalaProjects.exists(_.path == path)
) ||
path.optDelegatePath
.exists(path => scalaProjects.exists(_.path == path)) ||
knowProjectRefs(path.path)
)
.map(createService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ class OutgoingCallsFinder(
source: AbsolutePath,
doc: TextDocument,
root: Tree,
)(implicit ec: ExecutionContext): Future[List[
)(implicit
ec: ExecutionContext
): Future[List[
FindOutgoingCallsResult
]] = {
def getOutgoingCallResultFromSymbol(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ class DebugProvider(
debugParams: DebugSessionParams
)(implicit ec: ExecutionContext): Future[DebugSession] = {
for {
server <- start(debugParams),
server <- start(debugParams)
} yield {
statusBar.addMessage("Started debug server!")
DebugSession(server.sessionName, server.uri.toString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,8 @@ class MunitTestFinder(
private def filterOccurences(doc: TextDocument): Vector[SymbolOccurrence] =
doc.occurrences
.filter(occ =>
testMethodSymbols.exists(testSymbol =>
occ.symbol.startsWith(testSymbol)
)
testMethodSymbols
.exists(testSymbol => occ.symbol.startsWith(testSymbol))
)
.toVector

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,8 @@ class IndexedSymbols(
): Array[SymbolDefinition] = {
symbolsAt(path, dialect)
.filter(defn =>
defn.kind.isEmpty || !defn.kind.exists(kind =>
kind.isParameter || kind.isTypeParameter
)
defn.kind.isEmpty || !defn.kind
.exists(kind => kind.isParameter || kind.isTypeParameter)
)
.toArray
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ object ScalacpCopyPaste {
if (sym.isType && sym.isCovariant) flip(p.COVARIANT)
if (sym.isType && sym.isContravariant) flip(p.CONTRAVARIANT)
// NOTE: Scalap doesn't expose locals.
if (/*kind.isLocal ||*/ sym.isUsefulField) {
if ( /*kind.isLocal ||*/ sym.isUsefulField) {
if (sym.isMutable) flip(p.VAR)
else flip(p.VAL)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ final class InferredMethodProvider(
case errorMethod: Ident if errorMethod.isErroneous =>
val errorMethodName = Identifier.backtickWrap(errorMethod.name.decoded)
lastVisitedParentTrees match {

/**
* Works for apply with unknown name:
* ```scala
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ trait PcCollector[T] { self: WithCompilationUnit =>
this.collect(parent)(t, pos, sym)

tree match {

/**
* All indentifiers such as:
* val a = <<b>>
Expand Down Expand Up @@ -225,6 +226,7 @@ trait PcCollector[T] { self: WithCompilationUnit =>
*/
case tpe: TypeTree if tpe.original != null =>
traverse(acc, tpe.original)

/**
* Some type trees don't have symbols attached such as:
* type A = List[_ <: <<Iterable>>[Int]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ trait PcSymbolSearch { self: WithCompilationUnit =>
// might happen in type trees
// also this doesn't seem to be picked up by semanticdb
if (id.symbol == NoSymbol)
fallbackSymbol(id.name, pos).map(sym =>
(symbolAlternatives(sym), id.pos)
)
fallbackSymbol(id.name, pos)
.map(sym => (symbolAlternatives(sym), id.pos))
else {
Some(symbolAlternatives(id.symbol), id.pos)
}
Expand Down Expand Up @@ -81,6 +80,7 @@ trait PcSymbolSearch { self: WithCompilationUnit =>
case _ =>
val apply = typedTree match {
case (apply: Apply) => Some(apply)

/**
* For methods with multiple parameter lists and default args, the tree looks like this:
* Block(List(val x&1, val x&2, ...), Apply(<<method>>, List(x&1, x&2, ...)))
Expand Down
2 changes: 1 addition & 1 deletion project/Developers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ object Developers {
"[email protected]",
url("https://github.com/dos65"),
),
),
)
}
4 changes: 3 additions & 1 deletion tests/unit/src/test/scala/tests/CallHierarchyLspSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,9 @@ class CallHierarchyLspSuite extends BaseCallHierarchySuite("call-hierarchy") {
} yield ()
}

test("decl-outgoing-call") { // https://github.com/scalameta/metals/issues/4489
test(
"decl-outgoing-call"
) { // https://github.com/scalameta/metals/issues/4489
for {
_ <- assertOutgoingCalls(
"""|/a/src/main/scala/a/Demo.scala
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ScalafixProviderLspSuite extends BaseLspSuite("scalafix-provider") {
|
|}
|""".stripMargin,
),
)

} yield ()
}
Expand Down

0 comments on commit c6e994d

Please sign in to comment.