-
Notifications
You must be signed in to change notification settings - Fork 50
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
SPIKE: Replacements for scalameta-based macros #539
Comments
@diesalbla writing a separate intellij plugin is not difficult. I did it already for The code has changed a little bit since then (for the better). You can also look at simulacrum and monocle for inspiration. |
Another proposal is to rely entirely in codegen since our additions are mostly implicits and companion extensions and to do that we don't need macros we can just codegen our expansion as other projects do https://github.com/olafurpg/scalameta-sbt-codegen. Codegen expansions should work fine in IDEA |
I'm not sure codegen works for companions... a companion must be in the same file. |
(unless the companion extends from some trait that you define in the codegen) |
We can potentially skip companions since they are used now to add the trait MyAlgebra[F[_]]
//codegen
trait MyAlgebraHandler The other reason they are in use too is to get automatic resolution of implicit factories but those could be added to an |
Is there anything we can do to help with this? We made a big bet on |
@ngbinh, It looks like paradise has been published for |
@mwz freestyle is using https://github.com/scalameta/paradise/, a different project that has been abandoned |
I think that scalameta paradise is also getting released against |
Would be awesome if it's happening. Thanks, will be tracking that ticket |
My recommendation would be to use scalamacros/paradise and implement custom support for IntelliJ. scalamacros/paradise are on track to be included by default in the Scala compiler scala/scala#6606 (no more need for addCompilerPlugin) and @mutcianm had a great presentation at ScalaSphere about how to add support for custom macros in IntelliJ, it's easier than most people think. |
Is there an online link for this talk? |
I don't think the recordings are available yet. Typically the talks are uploaded to YT a couple months later, so I'd expect them to be public soon. |
FWIW, scalameta/paradise for 2.12.6 is on it's way to Maven Central. Note that scalameta/paradise is no longer under development and will not support 2.13, please migrate to https://docs.scala-lang.org/overviews/macros/annotations.html those macro annotations will be supported natively by the compiler in 2.13 under the scalac option -Ymacro-annotations scala/scala#6606 |
Just curious if this issue is still progressing. |
Issue #73, carried out in PR #344, replaced the first version of
@free
and@module
, based on the Scala Macro annotations with the macro annotations provided by the Scalameta-Paradise project. That is the basis for the current implementations of@free
,@module
,@tagless
, as well as those macros from thefreestyle-rpc
project.However, the development of macros and macro annotations in Scala Meta was closed, as explained here.
Recently, It has come to our attention that the earliest release of Scala,
2.12.5
, can not be used with Freestyle. Thus, we need to find out a replacement for those macro annotations.Requirements
Given that
freestyle
is intended to help as many Scala developers as possible, many of whom use IntelliJ-Idea, the replacement should inter-operate fairly with IDEA. In particular, spurious errors should be avoided as far as fairly possible.Proposals
scalaz-deriving
project, `@fommil has recently developed a helper class for writing code-generation annotations.Note: this issue will be extended, as the discussion progress.
The text was updated successfully, but these errors were encountered: