Source code parameters for Scala libraries #16859
Replies: 1 comment 1 reply
-
As these metadata about the compiler version, scalac options, plugins, etc. would be good to have also for artifacts which have already been published, would it make sense to set up and external service which would crawl scala repositories, extract metadata from their builds (for new and historical revisions) and then expose the obtained information so that IDEs and other tools could use it? The crawler part seems similar inits mechanism to what we already have in our Open Community Build (CC: @WojciechMazur) so I assume some of the logic (maybe even infrastructure?) from there could be reused. In terms of storing and exposing metadata, maybe we could extend scaladex to handle that? @julienrf what do you think? |
Beta Was this translation helpful? Give feedback.
-
I am not sure if this should be better off as a open discussion, or as an issue, or a feature request. Please advise.
This topic was raised during the last Tooling Sync Meeting. When the user navigates to a symbol defined in a library, and the source code of that library is unavailable, IntelliJ Scala Plugin decompiles the bytecode. But currently the bytecode does not provide information if it's compiled from Scala 3, Scala 2, or Scala 2 compiled with
-Xsource:3
. And on top of that, for example in case of Scala 3, there is no information if the original source code used indentation or braces syntax. For now we can only guess from the library's name if it's Scala 2 or 3 - but not the other things.We discussed if it's possible a) for the sbt team to put this information in META-INF in the library jar file; or b) for the compiler team to do this in class or tasty files. The solution (a) was ruled out based on that some jar files consist of many modules/dependencies that can be written both in Scala 2 or 3, so one common metadata wouldn't be enough. Probably a better solution is to put the metadata in the tasty files.
More details
Beta Was this translation helpful? Give feedback.
All reactions