Skip to content

Commit

Permalink
chore: Removed unused values
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Oct 9, 2024
1 parent 6550f09 commit 2c8d344
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 16 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def lintingOptions(scalaVersion: String) = {
"-Wconf:src=*.ScaladocParser.scala&msg=parameter (pos|message) in method reportError:silent",
"-Wconf:src=*.TreeViewProvider.scala&msg=parameter params in method (children|parent) is never used:silent",
"-Wconf:src=*.InheritanceContext.scala&msg=parameter ec in method getLocations is never used:silent",
"-Wconf:src=*.CompilerWrapper.scala&msg=parameter params in method compiler is never used:silent",
// silence "The outer reference in this type test cannot be checked at run time."
"-Wconf:src=.*(CompletionProvider|ArgCompletions|Completions|Keywords|IndentOnPaste).scala&msg=The outer reference:silent",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import scala.meta.internal.builds.ShellRunner
import scala.meta.internal.metals.Directories
import scala.meta.internal.metals.Messages.BspProvider
import scala.meta.internal.metals.MetalsEnrichments._
import scala.meta.internal.metals.StatusBar
import scala.meta.internal.metals.UserConfiguration
import scala.meta.internal.metals.clients.language.MetalsLanguageClient
import scala.meta.io.AbsolutePath
Expand All @@ -27,7 +26,6 @@ final class BspConfigGenerator(
workspace: AbsolutePath,
languageClient: MetalsLanguageClient,
shellRunner: ShellRunner,
statusBar: StatusBar,
userConfig: () => UserConfiguration,
)(implicit ec: ExecutionContext) {
def runUnconditionally(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ class Supermethods(
textDocument,
)
symbolInformation <- findSymbol(symbolOcc.symbol)
docText = TextDocumentWithPath(textDocument, filePath)
} yield SuperMethodProvider.getSuperMethodHierarchy(
symbolInformation
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ final class ClientConfiguration(
for {
capabilities <- clientCapabilities
textDocumentCapabilities <- Option(capabilities.getTextDocument())
inlayHintsCapabilities <- Option(textDocumentCapabilities.getInlayHint())
_ <- Option(textDocumentCapabilities.getInlayHint())
} yield true
}.getOrElse(false)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ class ProjectMetalsLspService(
folder,
languageClient,
shellRunner,
statusBar,
() => userConfig,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ final class RunTestCodeLens(
isJVM = buildTarget.asScalaBuildTarget.forall(
_.getPlatform == b.ScalaPlatform.JVM
)
connection <- buildTargets.buildServerOf(buildTargetId)
// although hasDebug is already available in BSP capabilities
// see https://github.com/build-server-protocol/build-server-protocol/pull/161
// most of the bsp servers such as bloop and sbt might not support it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class ScalatestTestFinder(
case parentSymbol if !ScalatestStyle.baseSymbols.contains(parentSymbol) =>
for {
definition <- symbolIndex.definition(mtags.Symbol(parentSymbol))
tree <- trees.get(definition.path)
doc <- semanticdbs()
.textDocument(definition.path)
.documentIncludingStale
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ class ScalaCliSuite extends BaseScalaCliSuite(V.scala3) {
_ <- debugServer.configurationDone
_ <- debugServer.disconnect
_ <- debugServer.shutdown
output <- debugServer.allOutput
_ <- debugServer.allOutput
} yield ()
}

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/main/scala/tests/TestingServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ final case class TestingServer(
root: AbsolutePath = workspace,
)(implicit loc: munit.Location): Future[Unit] = {
for {
(text, params) <- onTypeParams(
(_, params) <- onTypeParams(
filename,
query,
root,
Expand Down Expand Up @@ -1511,7 +1511,7 @@ final case class TestingServer(
root: AbsolutePath,
): Future[List[Location]] = {
for {
(text, params) <- offsetParams(filename, query, root)
(_, params) <- offsetParams(filename, query, root)
definition <- fullServer.definition(params).asScala
} yield {
definition.asScala.toList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ abstract class BaseNonCompilingLspSuite(name: String)
| def completeThisUniqueName2(): String = 42
|}""".stripMargin
}
- <-
_ <-
if (saveAfterChanges)
server.didSave("a/src/main/scala/b/B.scala")(identity)
else Future.unit
Expand Down Expand Up @@ -108,7 +108,7 @@ abstract class BaseNonCompilingLspSuite(name: String)
_ <- server.didSave("a/src/main/scala/a/A.scala") { _ =>
newText.replace("<<", "").replace(">>", "")
}
codeActions <-
_ <-
server
.assertCodeAction(
"a/src/main/scala/a/A.scala",
Expand All @@ -122,7 +122,7 @@ abstract class BaseNonCompilingLspSuite(name: String)
_ <- server.didSave("a/src/main/scala/a/A.scala") { _ =>
input.replace("UniqueObjectOther", "UniqueObject")
}
codeActions <-
_ <-
server
.assertCodeAction(
"a/src/main/scala/a/A.scala",
Expand Down Expand Up @@ -367,7 +367,7 @@ abstract class BaseNonCompilingLspSuite(name: String)
input = newText.replace("<<", "").replace(">>", "")
_ <- server.didChange("a/src/main/scala/a/A.scala")(_ => input)
_ <- server.didSave("a/src/main/scala/a/A.scala")(identity)
codeActions <-
_ <-
server
.assertCodeAction(
"a/src/main/scala/a/A.scala",
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/test/scala/tests/DidFocusLspSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class DidFocusLspSuite extends BaseLspSuite("did-focus") {
_ = assert(didCompile == Compiled)
didCompile <- server.didFocus("b/src/main/scala/b/B.scala")
_ = assert(didCompile == Compiled)
didCompile <- server.didFocus("c/src/main/scala/c/C.scala")
_ <- server.didFocus("c/src/main/scala/c/C.scala")
// fake delete the diagnostic to see that `c` won't get recompiled
_ = client.diagnostics(server.toPath("c/src/main/scala/c/C.scala")) =
Seq.empty
Expand Down Expand Up @@ -112,7 +112,7 @@ class DidFocusLspSuite extends BaseLspSuite("did-focus") {
_ <- server.didOpen("b/src/main/scala/b/B.scala")
_ = assertNoDiagnostics()
_ = fakeTime.elapseSeconds(10)
didCompile <- server.didFocus("b/src/main/scala/b/B.scala")
_ <- server.didFocus("b/src/main/scala/b/B.scala")
_ <- server.didSave("a/src/main/scala/a/A.scala")(
_.replace("val x = 1", "val x = \"string\"")
)
Expand Down

0 comments on commit 2c8d344

Please sign in to comment.