com-lihaoyi / mill

Mill is a fast JVM build tool that supports Java and Scala. 2-4x faster than Gradle and 4-10x faster than Maven for common workflows, Mill aims to make your project’s build process performant, maintainable, and flexible
https://mill-build.org/
MIT License
2.22k stars 356 forks source link

installation-ide.adoc: mill.bsp.BSP/install #3976

Closed sideeffffect closed 3 days ago

sideeffffect commented 6 days ago

Instructions to run mill.bsp.BSP/install. Without it, IntelliJ won't pick up the BSP model -- it won't show it as one of the possible ways how to import the project.

lihaoyi commented 6 days ago

I havent needed to do this for a clean checkout for maybe a year now

lihaoyi commented 6 days ago

do you have a repro i can look at where running this command is necessary?

sideeffffect commented 6 days ago

When you open the project as just a mere directory, IntelliJ doesn't prompt you to import -- regardless of whether with BSP or Maven or anything. You just see this and nothing happens. scala-mill-experiment.zip image image

lihaoyi commented 6 days ago

The issue seems to be that IntelliJ uses the presence a ./mill bootstrap script in order to detect it as a Mill build. After adding such a bootstrap script the intellij auto import seems to work

lihaoyi commented 6 days ago

We can probably send a patch upstream to intellij-scala to make it a bit more flexible. In the meantime, this command may be useful to fix some of the misbehaviors I've seen when intellij gets into a bad state. Let me try to reproduce them to see

sideeffffect commented 6 days ago

presence [of] a ./mill bootstrap script in order to detect it as a Mill build

Would you say it is more robust to rather detect Mill via detecting

lihaoyi commented 5 days ago

@sideeffffect should be these cases

Maybe ./millw or ./millw.bat from https://github.com/lefou/millw?

sideeffffect commented 4 days ago

We may not need this PR if this gets merged

lefou commented 3 days ago

Superseded by #3989