-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Add stub mill.define.Ctx
to trick IntelliJ into not erroring
#3856
Conversation
assert(e.msg.contains( | ||
"Modules and Tasks can only be defined within a mill Module" | ||
"Task{} members must be defs defined in a Cacher class/trait/object body" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Cacher
never surfaces in our docs (and API), we probably should list the most likely candidate Module
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Task{} members must be defs defined in a Cacher class/trait/object body" | |
"Task{} members must be defs defined in a Cacher class/trait/object body like Module" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually comes from the mill-moduledefs repo, so we'll need to fix it upstream there https://github.com/com-lihaoyi/mill-moduledefs/blob/33a27d470a8f27a1cb2ad9e71d8c25b24294eee8/moduledefs/src-2/Cacher.scala#L29
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as #3558, but for
mill.define.Ctx
rather thanmill.main.RootModule.Info
. Because it's provided by the enclosing code-generation, we need to trick IntelliJ into thinking there is something it can use, and so I define a low priority implicit to fall back upon if the maindef make
doesn't work (but@compileTimeOnly
to show an error message if it ends up being needed)I moved the bulk of the cacher logic from
mill-moduledefs
tomill.define
. We just need a marker trait inmill-moduledefs
, and having the rest of the logic in Mill itself simplifies maintenance and evolution of the codeBefore
After