-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
mill-bsp: language features lacking/incorrect #2304
Comments
I think, you experience an issue with multi-stage scripts. I think they are not well supported by editors in general, and in Mill I remember that they were often the initial cause for trouble. You should try to avoid them, and in your particular example, you can completely remove the line with the |
yeah, this is a very simplified multi-stage script though - my real usecase requires us to set up an extra Resolver for dependencies used by the build, I'm not sure how we could get rid of that... more context: we put our artifacts in AWS CodeArtifact. The build requires some private dependencies from there, and we configure the resolver by fetching a temporary token using AWS's SDK (also caching it in a file). I think we could remove this and have Coursier credentials for CodeArtifact set up in a global config file, but that'd require changing this file daily (the tokens are short-lived) + it'd be a change in the workflows of about a hundred people running scripts in that repository. edit: I guess we could have a custom Mill launcher that would deal with the creds... perhaps it's worth exploring. |
Maybe, you can move all the early initialization stuff into a separate file (e.g. |
That early init stuff would still have to be imported somehow in an earlier stage I think... my second stage has some
otherwise it's too late |
I case you haven't tried it, I think you should. A line Given the following file: // project/init.sc
println("early stuff")
import coursierapi.{Credentials, MavenRepository}
@
interp.repositories() ++= Seq(
MavenRepository
.of("https://localhost:8080/content/repositories/releases")
.withCredentials(Credentials.of("user", "pass"))
)
println(interp.repositories.live()().mkString(",")) and // build.sc
import $file.project.init
println("define our project")
object demo extends Module {
def thing: T[Thing] = T {
"aa": Thing
}
} When we run:
|
I think you can even get rid of the multi-stage scripting by just splitting up into multiple files. |
I did try before, but this definitely helped! I had to play around with my magic import order too, scalafmt was sorting them and that clearly can affect things. I got rid of all my the only hint I see in the logs:
I can only assume 0.10.9 is Metals's version of a Mill interface or something, as I tried 0.10.11 and the snapshot mentioned above. However, Metals did work fine in the updated example thanks to your suggestions. I'll get back to this in the workweek and try to minimize my project's problems with that new setup (without multi-module scripts). |
Closing this, as it is releated to multi-stage script which we no longer support since Mill 0.11.0-M8. In fact, we no longer use Ammonite at all. |
Hi! I talked about these issues briefly with @lefou before, managed to minimize a reproduction of some of these.
Here's my build:
project/model.sc
:build.sc
:What happens:
demo
module), I'm seeing no completions forThing
ordoThing
For the completions, LSP returns an empty list. For the definitions, this is what the server returns:
Additionally, if I add a reference to something that doesn't exist, that has the same behavior - completions not working and go-to-definition sends me to the end of the file. Example:
Mill version: 0.11.0-M3-22-ac0ea4 / 0.10.11, I'm using mill-bsp. Full repro here.
The text was updated successfully, but these errors were encountered: