Skip to content

Commit

Permalink
chore: Remove Pants specific checks
Browse files Browse the repository at this point in the history
Since scalameta#5791 Pants can be used as custom BSP.
This should be more reliable, since most of the support was alredy removed.
  • Loading branch information
jkciesluk committed Dec 21, 2023
1 parent 6b9babd commit 4b78234
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ final class BuildTools(
_.resolve("pom.xml").isFile
)
def isMaven: Boolean = mavenProject.isDefined
def pantsProject: Option[AbsolutePath] = searchForBuildTool(
_.resolve("pants.ini").isFile
)
def isPants: Boolean = pantsProject.isDefined
def bazelProject: Option[AbsolutePath] = searchForBuildTool(
_.resolve("WORKSPACE").isFile
)
Expand Down Expand Up @@ -190,7 +186,6 @@ final class BuildTools(
if (isMill) buf += "Mill"
if (isGradle) buf += "Gradle"
if (isMaven) buf += "Maven"
if (isPants) buf += "Pants"
if (isBazel) buf += "Bazel"
buf.result()
}
Expand Down
2 changes: 0 additions & 2 deletions metals/src/main/scala/scala/meta/internal/builds/Digest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ object Digest {
digestGeneralJvm(path, digest)
} else if (isXml) {
digestXml(path, digest)
} else if (path.isBuild) {
digestFileBytes(path, digest)
} else {
true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ class MetalsLspService(
*/
private def fileWatchFilter(path: Path): Boolean = {
val abs = AbsolutePath(path)
abs.isScalaOrJava || abs.isSemanticdb || abs.isBuild ||
abs.isScalaOrJava || abs.isSemanticdb ||
abs.isInBspDirectory(folder)
}

Expand Down Expand Up @@ -1366,8 +1366,6 @@ class MetalsLspService(
semanticDBIndexer.onOverflow(semanticdbPath)
}
}.asJava
} else if (path.isBuild) {
onBuildChanged(List(path)).asJava
} else {
CompletableFuture.completedFuture(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,6 @@ trait ScalametaCommonEnrichments extends CommonMtagsEnrichments {
case None =>
path.toURI.toString
}
def isBuild: Boolean =
path.filename.startsWith("BUILD")

def isInBspDirectory(workspace: AbsolutePath): Boolean =
path.toNIO.startsWith(workspace.resolve(".bsp").toNIO)
Expand Down
22 changes: 9 additions & 13 deletions project/TestGroups.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ object TestGroups {
"tests.MtagsSuite", "tests.ChosenBuildServerSuite",
"tests.SemanticdbSuite", "tests.digest.MillDigestSuite",
"tests.DocumentSymbolSuite", "tests.FoldingRangeSuite",
"tests.pants.PantsSuite", "tests.JavadocSuite",
"tests.MtagsEnrichmentsSuite", "tests.FuzzySuite",
"tests.JavadocSuite", "tests.MtagsEnrichmentsSuite",
"tests.CreateDirectoriesSuite", "tests.SbtOptsSuite",
"tests.LineListenerSuite", "tests.debug.MessageIdAdapterSuite",
"tests.MetalsEnrichmentsSuite", "tests.DefinitionDirectorySuite",
Expand All @@ -36,7 +35,7 @@ object TestGroups {
"tests.codeactions.RewriteBracesParensLspSuite",
"tests.debug.CompletionDapSuite", "tests.debug.EvaluationDapSuite",
"tests.FindTextInDependencyJarsSuite", "tests.TestSuitesProviderSuite",
"tests.classFinder.FindAllClassesSuite",
"tests.classFinder.FindAllClassesSuite", "tests.FuzzySuite",
"tests.codeactions.ExtractValueLspSuite", "tests.clients.CommandSuite",
"tests.JavaInteractiveSemanticdbSuite", "tests.SemVerSuite",
"tests.codeactions.CompanionObjectSuite",
Expand All @@ -55,9 +54,8 @@ object TestGroups {
"tests.codeactions.StringActionsLspSuite", "tests.RangeFormattingSuite",
"tests.CodeLensesLspSuite", "tests.DefinitionLspSuite",
"tests.RelatedSuite", "tests.DocumentHighlightLspSuite",
"tests.NewProjectLspSuite",
"tests.NewProjectLspSuite", "tests.WorkspaceSymbolLspSuite",
"tests.codeactions.ImplementAbstractMembersLspSuite",
"tests.WorkspaceSymbolLspSuite",
"tests.RangeFormattingWhenSelectingSuite", "tests.AddPackageLspSuite",
"tests.WarningsLspSuite", "tests.BspSwitchLspSuite",
"tests.codeactions.CreateNewSymbolLspSuite",
Expand All @@ -70,21 +68,19 @@ object TestGroups {
"tests.JdkSourcesSuite", "tests.digest.SbtDigestSuite",
"tests.digest.MavenDigestSuite", "tests.UserConfigurationSuite",
"tests.digest.GradleDigestSuite", "tests.DetectionSuite",
"tests.digest.PantsDigestSuite", "tests.NewFileTemplateSuite",
"tests.ScalaVersionsSuite", "tests.HttpServerSuite",
"tests.BatchedFunctionSuite", "tests.SbtVersionSuite",
"tests.MessagesSuite", "tests.pants.PantsGlobsSuite",
"tests.SelectBspServerSuite", "tests.InverseDependenciesSuite",
"tests.pantsbuild.PantsProjectNameSuite", "tests.TrigramSubstringsSuite",
"tests.TimerSuite", "tests.FoldingRangesSuite",
"tests.NewFileTemplateSuite", "tests.ScalaVersionsSuite",
"tests.HttpServerSuite", "tests.BatchedFunctionSuite",
"tests.SbtVersionSuite", "tests.MessagesSuite",
"tests.TrigramSubstringsSuite", "tests.SelectBspServerSuite",
"tests.InverseDependenciesSuite", "tests.TimerSuite",
"tests.FoldingRangesSuite", "tests.SelectionRangeLspSuite",
"tests.rangeFormatting.MultilineStringRangeFormattingWhenPastingSuite",
"tests.codeactions.ConvertPatternMatchLspSuite",
"tests.ScalaToplevelLibrarySuite",
"tests.decorations.SyntheticHoverLspSuite",
"tests.rangeFormatting.MultilineStringRangeFormattingWhenSelectingSuite",
"tests.rangeFormatting.IndentWhenPastingSuite",
"tests.DebugDiscoverySuite", "tests.SemanticdbScala2Suite",
"tests.SelectionRangeLspSuite",
"tests.codeactions.OrganizeImportsLspSuite",
"tests.codeactions.InsertInferredTypeLspSuite",
"tests.FoldingRangeScala2Suite", "tests.SystemProcessSuite",
Expand Down

0 comments on commit 4b78234

Please sign in to comment.