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

SemanticDB support to be used by BSP (and others) #1977

Merged
merged 11 commits into from
Aug 22, 2022

Conversation

lefou
Copy link
Member

@lefou lefou commented Jul 29, 2022

Experiments with SemanticDB generation in a dedicated target semanticDbData.

Tasks:

  • Figure out how to create SemanticDB data for Scala projects in dedicated target
  • Rebase to main branch
  • Use semanticDB data in BSP module
  • depend on fact whether client is requesting SemanticDB
  • Use SemanticDB version requested from client

Potential follow-up tasks:

  • Figure out how to create SemanticDB data for Java projects
  • Detect setups with already enabled/added SemanticDB setup and avoid extra work
  • Document, how to use SemanticDB data, as it may be useful for other consumers too, e.g. mill-scalafix, ...

@lefou lefou closed this Jul 29, 2022
@lefou lefou reopened this Jul 29, 2022
@lefou
Copy link
Member Author

lefou commented Jul 29, 2022

To generate SemanticDB data you can run:

mill __.semanticDbData

which should be much faster than a full compile with

mill __.compile

@lefou
Copy link
Member Author

lefou commented Jul 29, 2022

$ time dev-mill showNamed main.__.compile
...
real    0m49,278s
user    0m2,335s
sys     0m1,365s

$ time dev-mill showNamed main.__.semanticDbData
...
{
  "main.semanticDbData": "ref:30554a91:/home/lefou/work/opensource/mill-bsp/out/main/semanticDbData.dest/classes",
  "main.api.semanticDbData": "ref:de11efa5:/home/lefou/work/opensource/mill-bsp/out/main/api/semanticDbData.dest/classes",
  "main.core.semanticDbData": "ref:d2ffde84:/home/lefou/work/opensource/mill-bsp/out/main/core/semanticDbData.dest/classes",
  "main.core.test.semanticDbData": "ref:5c9525c2:/home/lefou/work/opensource/mill-bsp/out/main/core/test/semanticDbData.dest/classes",
  "main.graphviz.semanticDbData": "ref:5b070d40:/home/lefou/work/opensource/mill-bsp/out/main/graphviz/semanticDbData.dest/classes",
  "main.graphviz.test.semanticDbData": "ref:c984eca8:/home/lefou/work/opensource/mill-bsp/out/main/graphviz/test/semanticDbData.dest/classes",
  "main.moduledefs.semanticDbData": "ref:b0de0dbc:/home/lefou/work/opensource/mill-bsp/out/main/moduledefs/semanticDbData.dest/classes",
  "main.test.semanticDbData": "ref:53dffc49:/home/lefou/work/opensource/mill-bsp/out/main/test/semanticDbData.dest/classes",
  "main.testkit.semanticDbData": "ref:4a278b4f:/home/lefou/work/opensource/mill-bsp/out/main/testkit/semanticDbData.dest/classes",
  "main.testkit.test.semanticDbData": "ref:47673833:/home/lefou/work/opensource/mill-bsp/out/main/testkit/test/semanticDbData.dest/classes",
  "main.util.semanticDbData": "ref:363dbe03:/home/lefou/work/opensource/mill-bsp/out/main/util/semanticDbData.dest/classes"
}

real    0m10,957s
user    0m0,990s
sys     0m0,363s

@lefou
Copy link
Member Author

lefou commented Aug 10, 2022

@ckipp01 I think this branch should now produce some semanticDB data to be used by Metals. We only enable when we see that a semanticDB version is send in the client connection request (but currently ignore the version value). Also, as you predicted, Metals thinks semanticDB isn't enabled, as we don't have it's options in the normal settings.

I just ran Metals 0.11.8 doctor, which isn't showing as much details as before. It there a way to see the old but more detailed output?

@lefou
Copy link
Member Author

lefou commented Aug 10, 2022

It can be, that my change messed up with the compile progress. Also, looks like Metals has now issues with some URIs which contain query components. I think, this is someting, I added because Bloop does it too.

@lefou
Copy link
Member Author

lefou commented Aug 10, 2022

I also rebased to the main branch, so don't expect that the mill-build module is functional.

@ckipp01
Copy link
Collaborator

ckipp01 commented Aug 12, 2022

Awesome to see progress on this! I'm testing right now and I'll drop some things in here as I come across them. The first thing I notice is that something is going wrong right away when Metals is requesting scalacOptions. For example here are the logs:

[Trace - 09:10:15 am] Sending request 'buildTarget/scalacOptions - (3)'
Params: {
  "targets": [
    {
      "uri": "file:///Users/ckipp/Documents/scala-workspace/minimal/minimal?id\u003dminimal"
    },
    {
      "uri": "file:///Users/ckipp/Documents/scala-workspace/minimal/minimal/test?id\u003dminimal.test"
    },
    {
      "uri": "file:///Users/ckipp/Documents/scala-workspace/minimal?id\u003dmill-build"
    }
  ]
}


[Trace - 09:10:19 am] Received response 'buildTarget/scalacOptions - (3)' in 3807ms
Result: null
Error: {
  "code": -32603,
  "message": "Internal error.",
  "data": "java.util.concurrent.CompletionException: java.lang.Exception: Failure during task evaluation: mill.bsp.MillBuildServer.mill-build.semanticDbData Compilation failed\n\tat java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)\n\tat java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347)\n\tat java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:708)\n\tat java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)\n\tat java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)\n\tat mill.bsp.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:710)\n\tat mill.bsp.MillBuildServer.$anonfun$completable$1$adapted(MillBuildServer.scala:698)\n\tat scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)\n\tat java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)\n\tat java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)\n\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)\n\tat java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)\n\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)\n\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)\nCaused by: java.lang.Exception: Failure during task evaluation: mill.bsp.MillBuildServer.mill-build.semanticDbData Compilation failed\n\tat mill.eval.Evaluator$.$anonfun$evalOrThrow$default$2$1(Evaluator.scala:1001)\n\tat mill.eval.Evaluator$EvalOrThrow.apply(Evaluator.scala:990)\n\tat mill.bsp.MillBuildServer.targetTasks(MillBuildServer.scala:671)\n\tat mill.bsp.MillScalaBuildServer.$anonfun$buildTargetScalacOptions$1(MillScalaBuildServer.scala:35)\n\tat mill.bsp.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:701)\n\t... 8 more\n"
}

I know you mentioned the Mill build stuff won't work yet, but maybe that's the issue? Since Mill is responding that there are 3 targets with the third being mill-build, but it can't handle requests for that?

The requests for javacOptions also get the same response. I think this ends up having cascading ramifications in metals that I'm still trying to chase down. It's for sure not picking up the SemanticDB, but I think that might be twofold being that it may not know where to look, but in Metals we also scan through the scalacOptions to ensure semanticDB is enabled, and since the response for scalacOptions is an error here that's throwing things off as well.

@lefou
Copy link
Member Author

lefou commented Aug 12, 2022

@ckipp01 I can't reproduce your issues with https://github.com/ckipp01/mill-minimal.

[Trace - 10:29:21 vorm.] Received request 'build/initialize - (1)'
Params: {
  "rootUri": "file:///home/lefou/work/tmp/mill-minimal/",
  "displayName": "Metals",
  "version": "0.11.8",
  "bspVersion": "2.1.0-M1",
  "capabilities": {
    "languageIds": [
      "scala",
      "java"
    ]
  },
  "data": {
    "javaSemanticdbVersion": "0.7.4",
    "semanticdbVersion": "4.5.11",
    "supportedScalaVersions": [
      "2.13.8",
      "2.12.16",
      "2.12.15",
      "2.12.14",
      "2.12.13",
      "2.12.12",
      "2.12.11",
      "2.13.5",
      "2.13.6",
      "2.13.7",
      "2.11.12",
      "2.12.8",
      "2.12.9",
      "2.12.10",
      "2.13.1",
      "2.13.2",
      "2.13.3",
      "2.13.4"
    ]
  }
}


[Trace - 10:29:21 vorm.] Sending response 'build/initialize - (1)'. Processing request took 60ms
Result: {
  "displayName": "mill-bsp",
  "version": "0.10.5-62-6ae288",
  "bspVersion": "2.0.0",
  "capabilities": {
    "compileProvider": {
      "languageIds": [
        "java",
        "scala"
      ]
    },
    "testProvider": {
      "languageIds": [
        "java",
        "scala"
      ]
    },
    "runProvider": {
      "languageIds": [
        "java",
        "scala"
      ]
    },
    "debugProvider": {
      "languageIds": []
    },
    "inverseSourcesProvider": true,
    "dependencySourcesProvider": true,
    "dependencyModulesProvider": true,
    "resourcesProvider": true,
    "buildTargetChangedProvider": false,
    "jvmRunEnvironmentProvider": true,
    "jvmTestEnvironmentProvider": true,
    "canReload": true
  }
}


[Trace - 10:29:21 vorm.] Received notification 'build/initialized'
Params: null


[Trace - 10:29:21 vorm.] Received request 'workspace/buildTargets - (2)'
Params: null


[Trace - 10:29:22 vorm.] Sending response 'workspace/buildTargets - (2)'. Processing request took 1290ms
Result: {
  "targets": [
    {
      "id": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
      },
      "displayName": "MillMinimal",
      "baseDirectory": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal",
      "tags": [
        "library",
        "application"
      ],
      "languageIds": [
        "java",
        "scala"
      ],
      "dependencies": [],
      "capabilities": {
        "canCompile": true,
        "canTest": false,
        "canRun": true,
        "canDebug": false
      },
      "dataKind": "scala",
      "data": {
        "scalaOrganization": "org.scala-lang",
        "scalaVersion": "2.13.7",
        "scalaBinaryVersion": "2.13",
        "platform": 1,
        "jars": [
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.7/scala-compiler-2.13.7.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.7/scala-reflect-2.13.7.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.7/scala-library-2.13.7.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline/3.20.0/jline-3.20.0.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar"
        ]
      }
    },
    {
      "id": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
      },
      "displayName": "MillMinimal.test",
      "baseDirectory": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test",
      "tags": [
        "test"
      ],
      "languageIds": [
        "java",
        "scala"
      ],
      "dependencies": [
        {
          "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
        }
      ],
      "capabilities": {
        "canCompile": true,
        "canTest": true,
        "canRun": true,
        "canDebug": false
      },
      "dataKind": "scala",
      "data": {
        "scalaOrganization": "org.scala-lang",
        "scalaVersion": "2.13.7",
        "scalaBinaryVersion": "2.13",
        "platform": 1,
        "jars": [
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.7/scala-compiler-2.13.7.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.7/scala-reflect-2.13.7.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.7/scala-library-2.13.7.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline/3.20.0/jline-3.20.0.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar"
        ]
      }
    },
    {
      "id": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
      },
      "displayName": "mill-build",
      "baseDirectory": "file:///home/lefou/work/tmp/mill-minimal",
      "tags": [
        "library",
        "application"
      ],
      "languageIds": [
        "scala"
      ],
      "dependencies": [],
      "capabilities": {
        "canCompile": false,
        "canTest": false,
        "canRun": false,
        "canDebug": false
      },
      "dataKind": "scala",
      "data": {
        "scalaOrganization": "org.scala-lang",
        "scalaVersion": "2.13.8",
        "scalaBinaryVersion": "2.13",
        "platform": 1,
        "jars": [
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.8/scala-compiler-2.13.8.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.8/scala-reflect-2.13.8.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.8/scala-library-2.13.8.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline/3.21.0/jline-3.21.0.jar",
          "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.9.0/jna-5.9.0.jar"
        ]
      }
    }
  ]
}


[Trace - 10:29:22 vorm.] Received request 'buildTarget/scalacOptions - (3)'
Params: {
  "targets": [
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    }
  ]
}


[Trace - 10:29:39 vorm.] Sending response 'buildTarget/scalacOptions - (3)'. Processing request took 16694ms
Result: null


[Trace - 10:29:39 vorm.] Received request 'buildTarget/javacOptions - (4)'
Params: {
  "targets": [
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    }
  ]
}


[Trace - 10:29:40 vorm.] Sending response 'buildTarget/javacOptions - (4)'. Processing request took 1023ms
Result: null


[Trace - 10:29:40 vorm.] Received request 'buildTarget/sources - (5)'
Params: {
  "targets": [
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    }
  ]
}


[Trace - 10:29:40 vorm.] Sending response 'buildTarget/sources - (5)'. Processing request took 25ms
Result: {
  "items": [
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
      },
      "sources": [
        {
          "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/src",
          "kind": 2,
          "generated": false
        }
      ]
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
      },
      "sources": [
        {
          "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test/src",
          "kind": 2,
          "generated": false
        }
      ]
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
      },
      "sources": [
        {
          "uri": "file:///home/lefou/work/tmp/mill-minimal/build.sc",
          "kind": 1,
          "generated": false
        }
      ]
    }
  ]
}


[Trace - 10:29:40 vorm.] Received request 'buildTarget/dependencySources - (6)'
Params: {
  "targets": [
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    }
  ]
}


[Trace - 10:29:40 vorm.] Sending response 'buildTarget/dependencySources - (6)'. Processing request took 471ms
Result: {
  "items": [
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
      },
      "sources": [
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.7/scala-library-2.13.7-sources.jar"
      ]
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
      },
      "sources": [
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/munit_2.13/0.7.29/munit_2.13-0.7.29-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.7/scala-library-2.13.7-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/junit-interface/0.7.29/junit-interface-0.7.29-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar"
      ]
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
      },
      "sources": [
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-scalalib_2.13/0.10.5-62-6ae288/srcs/mill-scalalib_2.13-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-scalajslib_2.13/0.10.5-62-6ae288/srcs/mill-scalajslib_2.13-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-scalanativelib_2.13/0.10.5-62-6ae288/srcs/mill-scalanativelib_2.13-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-bsp_2.13/0.10.5-62-6ae288/srcs/mill-bsp_2.13-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.8/scala-library-2.13.8-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/scalafmt-dynamic_2.13/3.5.8/scalafmt-dynamic_2.13-3.5.8-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-main_2.13/0.10.5-62-6ae288/srcs/mill-main_2.13-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-scalalib-api_2.13/0.10.5-62-6ae288/srcs/mill-scalalib-api_2.13-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-testrunner_2.13/0.10.5-62-6ae288/srcs/mill-testrunner_2.13-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-scalajslib-worker-api_2.13/0.10.5-62-6ae288/srcs/mill-scalajslib-worker-api_2.13-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-scalanativelib-api/0.10.5-62-6ae288/srcs/mill-scalanativelib-api-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/ch/epfl/scala/bsp4j/2.1.0-M1/bsp4j-2.1.0-M1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/scalafmt-interfaces/3.5.8/scalafmt-interfaces-3.5.8-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/interface/0.0.21/interface-0.0.21-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/typesafe/config/1.4.2/config-1.4.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/io/github/alexarchambault/windows-ansi/windows-ansi/0.0.3/windows-ansi-0.0.3-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-main-core_2.13/0.10.5-62-6ae288/srcs/mill-main-core_2.13-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-main-client/0.10.5-62-6ae288/srcs/mill-main-client-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-main-api_2.13/0.10.5-62-6ae288/srcs/mill-main-api_2.13-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-main-util_2.13/0.10.5-62-6ae288/srcs/mill-main-util_2.13-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/eclipse/lsp4j/org.eclipse.lsp4j.generator/0.12.0/org.eclipse.lsp4j.generator-0.12.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.12.0/org.eclipse.lsp4j.jsonrpc-0.12.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.18/jansi-1.18-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ammonite_2.13.8/2.5.4/ammonite_2.13.8-2.5.4-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/trees_2.13/4.5.11/trees_2.13-4.5.11-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier_2.13/2.1.0-M6/coursier_2.13-2.1.0-M6-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.12.1/jna-5.12.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna-platform/5.12.1/jna-platform-5.12.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/jarjarabrams/jarjar-abrams-core_2.13/1.8.1/jarjar-abrams-core_2.13-1.8.1-sources.jar",
        "file:///home/lefou/.ivy2/local/com.lihaoyi/mill-main-moduledefs_2.13/0.10.5-62-6ae288/srcs/mill-main-moduledefs_2.13-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/os-lib_2.13/0.8.1/os-lib_2.13-0.8.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/upickle_2.13/2.0.0/upickle_2.13-2.0.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ammonite-terminal_2.13/2.5.4/ammonite-terminal_2.13-2.5.4-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/fansi_2.13/0.4.0/fansi_2.13-0.4.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/eclipse/xtend/org.eclipse.xtend.lib/2.24.0/org.eclipse.xtend.lib-2.24.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/google/code/gson/gson/2.8.9/gson-2.8.9-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ammonite-util_2.13/2.5.4/ammonite-util_2.13-2.5.4-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ammonite-runtime_2.13.8/2.5.4/ammonite-runtime_2.13.8-2.5.4-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ammonite-interp-api_2.13.8/2.5.4/ammonite-interp-api_2.13.8-2.5.4-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ammonite-repl-api_2.13.8/2.5.4/ammonite-repl-api_2.13.8-2.5.4-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ammonite-interp_2.13.8/2.5.4/ammonite-interp_2.13.8-2.5.4-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ammonite-repl_2.13.8/2.5.4/ammonite-repl_2.13.8-2.5.4-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ammonite-compiler_2.13.8/2.5.4/ammonite-compiler_2.13.8-2.5.4-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/common_2.13/4.5.11/common_2.13-4.5.11-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/fastparse-v2_2.13/2.3.1/fastparse-v2_2.13-2.3.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/github/plokhotnyuk/jsoniter-scala/jsoniter-scala-core_2.13/2.12.1/jsoniter-scala-core_2.13-2.12.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/github/plokhotnyuk/jsoniter-scala/jsoniter-scala-macros_2.13/2.12.1/jsoniter-scala-macros_2.13-2.12.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.8/scala-reflect-2.13.8-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-core_2.13/2.1.0-M6/coursier-core_2.13-2.1.0-M6-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-cache_2.13/2.1.0-M6/coursier-cache_2.13-2.1.0-M6-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/jarjar/jarjar/1.8.1/jarjar-1.8.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.8/scala-compiler-2.13.8-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.3.0/sourcecode_2.13-0.3.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/kohlschutter/junixsocket/junixsocket-native-common/2.5.1/junixsocket-native-common-2.5.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/kohlschutter/junixsocket/junixsocket-common/2.5.1/junixsocket-common-2.5.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/geny_2.13/0.7.1/geny_2.13-0.7.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ujson_2.13/2.0.0/ujson_2.13-2.0.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/upack_2.13/2.0.0/upack_2.13-2.0.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/upickle-implicits_2.13/2.0.0/upickle-implicits_2.13-2.0.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/eclipse/xtext/org.eclipse.xtext.xbase.lib/2.24.0/org.eclipse.xtext.xbase.lib-2.24.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/eclipse/xtend/org.eclipse.xtend.lib.macro/2.24.0/org.eclipse.xtend.lib.macro-2.24.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.7.0/scala-collection-compat_2.13-2.7.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/pprint_2.13/0.7.1/pprint_2.13-0.7.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/requests_2.13/0.7.0/requests_2.13-0.7.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mainargs_2.13/0.2.2/mainargs_2.13-0.2.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ammonite-compiler-interface_2.13.8/2.5.4/ammonite-compiler-interface_2.13.8-2.5.4-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/fastparse_2.13/2.3.0/fastparse_2.13-2.3.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.13/2.0.1/scala-xml_2.13-2.0.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.14.1/jline-terminal-3.14.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.14.1/jline-terminal-jna-3.14.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.14.1/jline-reader-3.14.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/scalaparse_2.13/2.3.0/scalaparse_2.13-2.3.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/github/javaparser/javaparser-core/3.2.5/javaparser-core-3.2.5-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.13/0.11.11/scalapb-runtime_2.13-0.11.11-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/io/github/alexarchambault/concurrent-reference-hash-map/1.1.0/concurrent-reference-hash-map-1.1.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-util_2.13/2.1.0-M6/coursier-util_2.13-2.1.0-M6-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/jniutils/windows-jni-utils/0.3.2/windows-jni-utils-0.3.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-archiver/4.2.7/plexus-archiver-4.2.7-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-container-default/2.1.1/plexus-container-default-2.1.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm/9.2/asm-9.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-commons/9.2/asm-commons-9.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/apache/ant/ant/1.9.9/ant-1.9.9-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/3.3.9/maven-plugin-api-3.3.9-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline/3.21.0/jline-3.21.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/upickle-core_2.13/2.0.0/upickle-core_2.13-2.0.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/google/guava/guava/27.1-jre/guava-27.1-jre-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/thesamet/scalapb/lenses_2.13/0.11.11/lenses_2.13-0.11.11-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.19.2/protobuf-java-3.19.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/3.4.1/plexus-utils-3.4.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-io/3.2.0/plexus-io-3.2.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/apache/commons/commons-compress/1.21/commons-compress-1.21-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/tukaani/xz/1.9/xz-1.9-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-classworlds/2.6.0/plexus-classworlds-2.6.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/apache/xbean/xbean-reflect/3.7/xbean-reflect-3.7-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.2/asm-tree-9.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/apache/ant/ant-launcher/1.9.9/ant-launcher-1.9.9-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/apache/maven/maven-model/3.3.9/maven-model-3.3.9-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/apache/maven/maven-artifact/3.3.9/maven-artifact-3.3.9-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.2/org.eclipse.sisu.plexus-0.3.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/checkerframework/checker-qual/2.5.2/checker-qual-2.5.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.2.0/error_prone_annotations-2.2.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/codehaus/mojo/animal-sniffer-annotations/1.17/animal-sniffer-annotations-1.17-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/commons-io/commons-io/2.6/commons-io-2.6-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/javax/enterprise/cdi-api/1.0/cdi-api-1.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.2/org.eclipse.sisu.inject-0.3.2-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-sources.jar",
        "file:///home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1-sources.jar",
        "file:///opt/src.zip"
      ]
    }
  ]
}


[Trace - 10:29:44 vorm.] Received request 'buildTarget/scalaMainClasses - (7)'
Params: {
  "targets": [
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    }
  ]
}


[Trace - 10:29:44 vorm.] Received request 'buildTarget/scalaTestClasses - (8)'
Params: {
  "targets": [
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    }
  ]
}


[Trace - 10:29:44 vorm.] Sending response 'buildTarget/scalaTestClasses - (8)'. Processing request took 183ms
Result: {
  "items": [
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
      },
      "classes": [
        "example.HelloSuite"
      ],
      "framework": "munit"
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
      },
      "classes": []
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
      },
      "classes": []
    }
  ]
}


[Trace - 10:29:45 vorm.] Sending response 'buildTarget/scalaMainClasses - (7)'. Processing request took 299ms
Result: {
  "items": [
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
      },
      "classes": []
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
      },
      "classes": []
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
      },
      "classes": [
        {
          "class": "example.Hello",
          "arguments": [],
          "jvmOptions": [],
          "environmentVariables": [
          ...
          ]
        }
      ]
    }
  ]
}


[Trace - 10:30:10 vorm.] Received request 'buildTarget/cleanCache - (9)'
Params: {
  "targets": [
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    }
  ]
}


[Trace - 10:30:10 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "1673734966"
  },
  "eventTime": 1660293010798,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [1/1] mill.bsp.MillBuildServer.$anon.clean ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:10 vorm.] Sending notification 'build/showMessage'
Params: {
  "type": 4,
  "message": "Cleaning 3 paths ..."
}


[Trace - 10:30:10 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "1458012743"
  },
  "eventTime": 1660293010845,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [1/1] mill.bsp.MillBuildServer.$anon.clean ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:10 vorm.] Sending notification 'build/showMessage'
Params: {
  "type": 4,
  "message": "Cleaning 3 paths ..."
}


[Trace - 10:30:10 vorm.] Sending response 'buildTarget/cleanCache - (9)'. Processing request took 66ms
Result: {
  "message": "Some(MillMinimal.test) cleaned \nSome(MillMinimal) cleaned \n",
  "cleaned": true
}


[Trace - 10:30:10 vorm.] Received request 'buildTarget/compile - (10)'
Params: {
  "targets": [
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    }
  ]
}


[Trace - 10:30:10 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293010874,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [4/109] mill.scalalib.ZincWorkerModule.zincLogDebug ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:10 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293010877,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [7/109] MillMinimal.sources ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:10 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293010880,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [12/109] MillMinimal.resources ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:10 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293010895,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [33/109] MillMinimal.compile ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:10 vorm.] Sending notification 'build/taskStart'
Params: {
  "taskId": {
    "id": "1882206690"
  },
  "eventTime": 1660293010904,
  "message": "Compiling target MillMinimal",
  "dataKind": "compile-task",
  "data": {
    "target": {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    }
  }
}


[Trace - 10:30:12 vorm.] Sending notification 'build/publishDiagnostics'
Params: {
  "textDocument": {
    "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/src/example/Hello.scala"
  },
  "buildTarget": {
    "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
  },
  "diagnostics": [],
  "reset": true
}


[Trace - 10:30:13 vorm.] Sending notification 'build/taskFinish'
Params: {
  "taskId": {
    "id": "1882206690"
  },
  "eventTime": 1660293013393,
  "message": "Compiled MillMinimal",
  "status": 1,
  "dataKind": "compile-report",
  "data": {
    "target": {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    },
    "errors": 0,
    "warnings": 0
  }
}


[Trace - 10:30:13 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293013464,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [35/109] MillMinimal.test.sources ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:13 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293013467,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [41/109] MillMinimal.test.resources ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:13 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293013472,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [57/109] MillMinimal.test.compile ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:13 vorm.] Sending notification 'build/taskStart'
Params: {
  "taskId": {
    "id": "2132245745"
  },
  "eventTime": 1660293013473,
  "message": "Compiling target MillMinimal.test",
  "dataKind": "compile-task",
  "data": {
    "target": {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    }
  }
}


[Trace - 10:30:13 vorm.] Sending notification 'build/publishDiagnostics'
Params: {
  "textDocument": {
    "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test/src/example/HelloSuite.scala"
  },
  "buildTarget": {
    "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
  },
  "diagnostics": [],
  "reset": true
}


[Trace - 10:30:14 vorm.] Sending notification 'build/taskFinish'
Params: {
  "taskId": {
    "id": "2132245745"
  },
  "eventTime": 1660293014179,
  "message": "Compiled MillMinimal.test",
  "status": 1,
  "dataKind": "compile-report",
  "data": {
    "target": {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    },
    "errors": 0,
    "warnings": 0
  }
}


[Trace - 10:30:14 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293014192,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [59/109] MillMinimal.test.semanticDbVersion ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:14 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293014198,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [76/109] mill.bsp.MillBuildServer.mill-build.semanticDbVersion ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:14 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293014201,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [81/109] mill.bsp.MillBuildServer.mill-build.sources ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:14 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293014205,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [84/109] mill.bsp.MillBuildServer.mill-build.resources ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:14 vorm.] Sending notification 'build/taskProgress'
Params: {
  "taskId": {
    "id": "373776608"
  },
  "eventTime": 1660293014216,
  "message": "[1/1] mill.bsp.BSP.startSession \u003e [100/109] mill.bsp.MillBuildServer.mill-build.semanticDbData ",
  "total": 1,
  "progress": 1,
  "unit": "mill.bsp.BSP.startSession"
}


[Trace - 10:30:14 vorm.] Sending notification 'build/showMessage'
Params: {
  "type": 4,
  "message": "effective scalac options: List(-Xplugin:/home/lefou/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/semanticdb-scalac_2.13.8/4.5.11/semanticdb-scalac_2.13.8-4.5.11.jar, -Yrangepos, -P:semanticdb:sourceroot:/home/lefou/work/tmp/mill-minimal, -Ystop-after:semanticdb-typer)"
}


[Trace - 10:30:14 vorm.] Sending notification 'build/taskStart'
Params: {
  "taskId": {
    "id": "1585866214"
  },
  "eventTime": 1660293014219,
  "message": "Compiling target mill-build",
  "dataKind": "compile-task",
  "data": {
    "target": {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    }
  }
}


[Trace - 10:30:14 vorm.] Sending notification 'build/publishDiagnostics'
Params: {
  "textDocument": {
    "uri": "file:///home/lefou/work/tmp/mill-minimal/build.sc"
  },
  "buildTarget": {
    "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
  },
  "diagnostics": [],
  "reset": true
}


[Trace - 10:30:14 vorm.] Sending notification 'build/publishDiagnostics'
Params: {
  "textDocument": {
    "uri": "file:/home/lefou/work/tmp/mill-minimal/build.sc"
  },
  "buildTarget": {
    "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
  },
  "diagnostics": [
    {
      "range": {
        "start": {
          "line": 3,
          "character": 27
        },
        "end": {
          "line": 3,
          "character": 27
        }
      },
      "severity": 1,
      "code": "object MillMinimal extends ScalaModule {",
      "source": "mill",
      "message": "Modules, Targets and Commands can only be defined within a mill Module"
    }
  ],
  "reset": true
}


[Trace - 10:30:14 vorm.] Sending notification 'build/taskFinish'
Params: {
  "taskId": {
    "id": "1585866214"
  },
  "eventTime": 1660293014875,
  "message": "Compiled mill-build",
  "status": 2,
  "dataKind": "compile-report",
  "data": {
    "target": {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    },
    "errors": 1,
    "warnings": 0
  }
}


[Trace - 10:30:14 vorm.] Sending response 'buildTarget/compile - (10)'. Processing request took 4018ms
Result: {
  "statusCode": 2
}


[Trace - 10:30:14 vorm.] Received request 'buildTarget/scalaMainClasses - (11)'
Params: {
  "targets": [
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    }
  ]
}


[Trace - 10:30:14 vorm.] Received request 'buildTarget/scalaTestClasses - (12)'
Params: {
  "targets": [
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
    },
    {
      "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
    }
  ]
}


[Trace - 10:30:14 vorm.] Sending response 'buildTarget/scalaMainClasses - (11)'. Processing request took 64ms
Result: {
  "items": [
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
      },
      "classes": []
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
      },
      "classes": []
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
      },
      "classes": [
        {
          "class": "example.Hello",
          "arguments": [],
          "jvmOptions": [],
          "environmentVariables": [
          ...
          ]
        }
      ]
    }
  ]
}


[Trace - 10:30:14 vorm.] Sending response 'buildTarget/scalaTestClasses - (12)'. Processing request took 97ms
Result: {
  "items": [
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal/test?id\u003dMillMinimal.test"
      },
      "classes": [
        "example.HelloSuite"
      ],
      "framework": "munit"
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal?id\u003dmill-build"
      },
      "classes": []
    },
    {
      "target": {
        "uri": "file:///home/lefou/work/tmp/mill-minimal/MillMinimal?id\u003dMillMinimal"
      },
      "classes": []
    }
  ]
}

@lefou
Copy link
Member Author

lefou commented Aug 12, 2022

Also, this is what the new Metals Doctor displays:


Build server currently being used is mill-bsp v0.10.5-62-6ae288. (Reset)

Metals Java: 11.0.15 from Eclipse Adoptium located at /opt/openjdk-bin-11.0.15_p10

Metals Server version: 0.11.8

These are the installed build targets for this workspace. One build target corresponds to one classpath. For example, normally one sbt project maps to two build targets: main and test.

Build target Type Compilation status Diagnostics Interactive Semanticdb Debugging Java support Recommendation
Compilation status:

✅ - code is compiling
Diagnostics:

✅ - diagnostics correctly being reported by the build server
Interactive features (completions, hover):

✅ - supported Scala version
Semanticdb features (references, renames, go to implementation):

✅ - build tool automatically creating needed semanticdb files
Debugging (run/test, breakpoints, evaluation):

✅ - users can run or test their code with debugging capabilities
Java Support:

✅ - working non-interactive features (references, rename etc.)

@lefou
Copy link
Member Author

lefou commented Aug 12, 2022

I fixed the issue with failed compilation in mill-build. Looks like Metals is trying to compile it, even though we say it does not support compilation via BSP. (BspCompileTarget.canCompile=false)

@lefou
Copy link
Member Author

lefou commented Aug 12, 2022

Now I see, that the Metals Doctor is still the same, but it was simply not displaying the modules it already knows about. And the rendering doesn't make it obvious. With my latest change, I again see the status for each module.

@lefou
Copy link
Member Author

lefou commented Aug 12, 2022

Maybe Metals could use semanticDB files it finds in the classpath, and only, if there are none, it could inspect the scalacOptions as a hint, whether the user (or the tool) can improve something. Ideally, we could give some feedback while we finish the BSP initialization request. We already parse client specific data, e.g. the semanticDB version. But there is no way to send free data to the client, only a fixed set of hardcoded capabilities.

@ckipp01
Copy link
Collaborator

ckipp01 commented Aug 12, 2022

2022-08-12 12 23 52

Amazing, it's finding the SemanticDB and navigation is working :D

I fixed the issue with failed compilation in mill-build. Looks like Metals is trying to compile it, even though we say it does not support compilation via BSP. (BspCompileTarget.canCompile=false)

I'll double-check this on the Metals side.

Maybe Metals could use semanticDB files it finds in the classpath, and only, if there are none, it could inspect the scalacOptions as a hint, whether the user (or the tool) can improve something.

Yea I'll need to play around with this. We can try to detect it in another way probably instead of only looking in the scalacOptions.

@lefou
Copy link
Member Author

lefou commented Aug 12, 2022

@ckipp01 Thanks for testing. Can you say anything about the perceived performance?

@lefou lefou marked this pull request as ready for review August 12, 2022 12:02
@lefou lefou changed the title SemanticDB BSP experiments SemanticDB support to be used by BSP (and others) Aug 12, 2022
@lefou
Copy link
Member Author

lefou commented Aug 18, 2022

Any review would be nice. @ckipp01, @lolgab

@lefou
Copy link
Member Author

lefou commented Aug 18, 2022

@ckipp01 Is there already some ticket in Metals that list or tracks the changes needed to support this new way of providing SemanticDB data in Mill?

@ckipp01
Copy link
Collaborator

ckipp01 commented Aug 18, 2022

@ckipp01 Is there already some ticket in Metals that list or tracks the changes needed to support this new way of providing SemanticDB data in Mill?

Not yet. I'll probably first have time this weekend to really dig into this, figure out exactly what would be needed, and then I'll create a ticket outlining it.

@lefou
Copy link
Member Author

lefou commented Aug 18, 2022

In case someone is interested in my experiments to also support Java modules, I pushed them to branch https://github.com/com-lihaoyi/mill/tree/semantic-db-task-java

@lefou
Copy link
Member Author

lefou commented Aug 22, 2022

I updated the documentation and deprecated the experimental ScalaMetalsSupport trait. I plan to merge this now, unless there are any concerns.

@lefou lefou linked an issue Aug 22, 2022 that may be closed by this pull request
@lefou lefou merged commit 6204569 into com-lihaoyi:main Aug 22, 2022
@lefou lefou deleted the semantic-db-task branch August 22, 2022 15:01
@lefou lefou added this to the 0.10.6 milestone Aug 22, 2022
@lefou
Copy link
Member Author

lefou commented Aug 23, 2022

@lefou
Copy link
Member Author

lefou commented Sep 3, 2022

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.

Better Metals support - Automatic SemanticDB enablement (RFC)
2 participants