-
Notifications
You must be signed in to change notification settings - Fork 53
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
Support for IntelliJ IDEA? #33
Comments
Quicklens macros are "blackbox", which means they return precise types, so this should be already IDE-friendly, with autocomplete etc., as long as there's the import Could you maybe give an example of what is incorrectly highlighted by IntelliJ? |
Using your own examples (street, address, person),
The last statement yields errors at It executes perfectly and without issue, but IntelliJ does NOT like the syntax. The issue has also been added to IntelliJ's bug tracker. |
Ah true, thanks! Though the issue is with IntelliJ's type checker, doesn't really involve macros. |
The problem is not with the macro but rather with the implicit resolution. When we use
instead of
then Intellij is happy to. I will file an according bug with JetBrains. If a quicklens user adds my function to his code, the user has to be more specific with the imports. Because if the compiler sees two implicits which could be used, it cannot choose which one to use and fails. For a basic example the following imports should be fine.
|
was this ever implemented in intellij? |
Came here with that question too... |
Here https://youtrack.jetbrains.com/issue/SCL-14526 you can find the bug which I opened. It wasn't resolved yet. If you can upgrade to Scala 2.13 the problem will most probably go away. The reason is, that the collection implementation is more straight forward (i.e. CanBuildFrom isn't used anymore). At least we could remove our workaround in our code base after upgrading to 2.13. |
Thank you, @DaniRey. I figured out what the problem was: these was another trait ModifyMacroFunctorSupport {
implicit class ModifyEach[F[_], T](t: F[T])(implicit f: ModifyFunctor[F, T]) {
@compileTimeOnly(canOnlyBeUsedInsideModify("each"))
def each: T = sys.error("")
}
trait ModifyFunctor[F[_], A] {
@compileTimeOnly(canOnlyBeUsedInsideModify("each"))
def each(fa: F[A])(f: A => A): F[A] = sys.error("")
}
implicit def optionModifyFunctor[A]: ModifyFunctor[Option, A] =
new ModifyFunctor[Option, A] {}
private[tapir] def canOnlyBeUsedInsideModify(method: String) =
s"$method can only be used inside ignore"
} |
Hi,
This truly is a fantastic library which enables some really removes a bunch of boilerplate code! I was wondering if there was any plan (now or later) to support IntellIJ IDEA support so we don't see those squiggly error lines (cannot resolve symbol)?
IntelliJ added support for plugins using Macros to write their own plugins: https://blog.jetbrains.com/scala/2015/10/14/intellij-api-to-build-scala-macros-support/
Thanks!
The text was updated successfully, but these errors were encountered: