Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for mill BSP #3308

Merged
merged 2 commits into from
Nov 29, 2021
Merged

Better support for mill BSP #3308

merged 2 commits into from
Nov 29, 2021

Conversation

ckipp01
Copy link
Member

@ckipp01 ckipp01 commented Nov 22, 2021

This adds the same type of functionality that we have with sbt where Mill can now also be a build server meaning that metals.generate-bsp-config and also metals.bsp-switch will apply to it. This also cleans up a few things that I did in #3304, fixes a bug in Semver, and also introduces a few small changes in BuildServerProvider.scala that are needed if a build tool and the name they use as a build server don't match.

Relates to com-lihaoyi/mill#1546 and also closes #3307

@ckipp01 ckipp01 marked this pull request as ready for review November 28, 2021 10:34
@@ -334,7 +328,3 @@ class BspConnector(
}
}
}

object BspConnector {
final val BLOOP_SELECTED = "BLOOP"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized we probably don't even need this, so I ripped it out of all the places and now just use Bloop from BloopServers.name. It simplifies it a bit.

@@ -282,14 +281,8 @@ class BspConnector(
args => bspConfigGenerator.runUnconditionally(buildTool, args)
)
.map(status => handleGenerationStatus(buildTool, status))
case Right(connectionDetails)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may have been what @dos65 was hinting at in my previous pr, but I realized this also isn't needed here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's it!

this.major > that.major ||
(this.major == that.major && this.minor > that.minor) ||
(this.major == that.major && this.minor == that.minor && this.patch > that.patch) ||
// 3.0.0-RC1 > 3.0.0-M1
this.releaseCandidate.isDefined && that.milestone.isDefined ||
baseVersionEqual && this.releaseCandidate.isDefined && that.milestone.isDefined ||
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I realized the logic here was missing a bit since previously it was showing that SemVer.isCompatibleVersion("0.10.0-M4", "0.9.10") was true since it wasn't correctly handling the cases where there was a major/minor/patch different plus one was a milestone or release candidate. You. can see what I mean more clearly in the tests I added for this.

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I have a very tiny, tiny comment - also thinking that we don't actually use those suite names and maybe we should remove them?

tests/slow/src/test/scala/tests/mill/MillServerSuite.scala Outdated Show resolved Hide resolved
Copy link
Member

@dos65 dos65 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrated support for Mill BSP Server
3 participants