Skip to content

Wrong paths inside diagnostics sent from bsp-server #5028

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions integration/ide/bsp-server/src/BspServerTestUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ object BspServerTestUtil {

def withBspServer[T](
workspacePath: os.Path,
millTestSuiteEnv: Map[String, String]
millTestSuiteEnv: Map[String, String],
client: b.BuildClient = DummyBuildClient
)(f: (MillBuildServer, b.InitializeBuildResult) => T): T = {

val bspMetadataFile = workspacePath / Constants.bspDir / s"${Constants.serverName}.json"
Expand All @@ -139,8 +140,6 @@ object BspServerTestUtil {
env = millTestSuiteEnv
)

val client: b.BuildClient = DummyBuildClient

var success = false
try {
val launcher = new l.jsonrpc.Launcher.Builder[MillBuildServer]
Expand Down
27 changes: 27 additions & 0 deletions integration/ide/bsp-server/src/BspServerTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,33 @@ object BspServerTests extends UtestIntegrationTestSuite {
}

def tests: Tests = Tests {
test("diagnostics test") - integrationTest { tester =>
import tester._
eval(
"--bsp-install",
stdout = os.Inherit,
stderr = os.Inherit,
check = true,
env = Map("MILL_MAIN_CLI" -> tester.millExecutable.toString)
)

val client = new DummyBuildClient {
override def onBuildPublishDiagnostics(params: b.PublishDiagnosticsParams): Unit =
// 4. assert that received params are correct and they contain correct paths
()
}

withBspServer(
workspacePath,
millTestSuiteEnv,
client
) { (buildServer, initRes) =>
// 1. Trigger build to compile current build.mill file
val result = buildServer.workspaceBuildTargets().get()
// 2. adjust file to have typo in module trait name e.g BazeModule instead of BaseModule
// 3. rerun build
}
}
test("requestSnapshots") - integrationTest { tester =>
import tester._
eval(
Expand Down