-
Notifications
You must be signed in to change notification settings - Fork 414
Add .mill
extension to Scala language support
#666
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
Conversation
I'm having trouble testing this on my laptop, with the readme's packaging instructions giving me the following error
|
@lihaoyi
I notice you use JDK 22
Please try using JDK 17 according to this part of the readme
If you have some suggestions how make the readme more clear we are happy to do listen to them. |
A proper way to do it would be to not directly piggy-back on the "ScalaFileType" but to register a dedicated mill file type and mill language, which would be a dialect of the scala. You can see some examples:
I would suggest creating a separate module mill similar to sbt near |
Thanks for the review @unkarjedy ! will give it a shot |
@unkarjedy I got the local build working and tried your suggested approach. It mostly works, except for one issue where the package declarations don't seem to be parsing properly: ![]() I did some investigating, and found that Another follow up question: is there some way to ensure we inherit all of |
@lihaoyi |
You can look at these classes usages for exampeles: Pretty much all the features from You also need to ensure that Also, for SBT files we do some hacks in |
@azdrojowa123 here's a zip: You can see the documentation for this new Mill multi-file build layout here https://mill-build.org/mill/Structuring_Large_Builds.html#_multi_file_builds @unkarjedy the approach is trying and be as compatible as possible with normal Scala, to minimize special casing in the IDE. So as of now the feature asks that users write I will take a look at the classes you mentioned and get back to you. Thank you for the pointers! |
@unkarjedy I did some further investigation, and my current lead is that this call to Line 28 in 77d7e7f
It seems that we're trying to look up Apart from instrumenting to find runtime behavioral differences, I also tried to add What do you suggest as the next avenues of investigation? It seems to me that there is only one possibility: one of the arguments to |
@lihaoyi @unkarjedy wrote
But I see that |
@azdrojowa123 I tried setting the SDK via the prompt in the main editor, but it still doesn't seem to be resolving packages correctly. How did you set the SDK? ![]() |
I am testing the plugin via the |
I set it in the same way, but I was setting a Scala 3 version. Yesterday we had a conversation in the team about supporting According to the |
Registering |
@azdrojowa123 We expect to keep as compatible with Scala as possible, to minimize the maintenance burden of maintaining a fork of the language, so hopefully that would apply inside IntelliJ as well where we would be able to be treated like vanilla Scala files just with a different extension |
@lihaoyi |
@azdrojowa123 I tried checking out your branch
But I'm not seeing the files being picked up as Scala files: ![]() |
@azdrojowa123 tried that, no luck. |
tried invalidate caches and restart on both the intellij-scala IDE and on the spawned test IDE, neither helped. Is there anything I can look at to help debug? |
Yes. Please type in the project root if that doesn't work we can call :) |
@lihaoyi |
I pushed the fix, you can check now. |
@azdrojowa123 I tried it out. IntelliJ now correctly identifies the ![]() Notably, if I go to |
That's strange because for me, the packages work anyway. |
When I open the project I did not see the |
No I also don't see it. |
Maybe try getting someone else on your team to try? At least then we'll know if the problem is in my setup or yours and can proceed to investigate from there |
@lihaoyi |
I definitey did add and remove and file type multiple times. I did try |
Unfortunately Then you can try the code again (please pull the latest changes, because I have added some logic). Does this solution suit you? |
@azdrojowa123 I just tried The remaining highlighting issues are expected: Mill files do differ in minor ways from normal Scala: e.g. the I think the next steps are as follows:
|
Closing for now in favor of #667 |
The Mill Scala build tool recently moved its file format extension from
.sc
to.mill
(com-lihaoyi/mill#3426) to better differentiate it from other Scala scripts (Ammonite, Scala-CLI, IntelliJ/VSCode worksheets). This updates intellij to understand that.mill
files should be highlighted as Scala