Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Brent Gracey
    @myFree

    Hi all;

    Is there a plugin which can generate SemanticDb files for a Java project?

    From https://scalameta.org/docs/semanticdb/guide.html#example
    SemanticDB producers provide full Scala support and partial Java support

    Is this support only for when a Scala project calls to Java files?

    Thanks

    mtes3
    @mtes3
    Hello.
    I tried to move from scala-macros to meta.
    But I still do not understand the next things:
    meta v4.2.0 is library for analyze scala code (read file -> transform to tokens, ans so on)
    but meta contain inline definition for make macros, is it right? and for macro purposes I should use 1.8.0 + meta/paradise compiler plugin, is it correct?
    thanks in advance
    Gabriele Petronella
    @gabro
    @mtes3 scalameta macros is a dead unmaintained project, that won’t be published for Scala 2.13. You should stick with macro paradise, which has been moved into the compiler under a flag
    mtes3
    @mtes3
    @gabro thanks for explanation. under macro paradise did you mean base macros (white/black context)?
    Gabriele Petronella
    @gabro
    I also mean macro annotations
    mtes3
    @mtes3
    I understood, thanks
    Dariusz Marynowski
    @driuzz

    Hi all,
    I'm trying to use scalameta to get type information for very simple piece of code, like this:

    object X {
      val a = List(1,2,3).head
    }

    the problem is with head method and its type, which is always A, but should be Int in this case. Also synthetic information is not generated for this method, so there is no way to retrieve real type.
    I checked scalameta code and it looks like toTextDocument method in implicit class XtensionCompilationUnitDocument doesn't support such situation at all. Synthetic data are generated for only small amount of hardcoded methods, like apply, map etc.
    Also type (tpe field) from Trees#Selectis not read at all what causes that there is no way to retrieve return type for head method from SemanticDocument.
    Can someone advice how to handle this problem?

    Ólafur Páll Geirsson
    @olafurpg
    @driuzz getting the type of a term is not supported with SemanticDB
    Dariusz Marynowski
    @driuzz
    @olafurpg thanks for info, and that's what I thought. However it is a little unfortunate for us, especially that original tree has these types. Do you plan to support this in future? Or do you see any way to hack this around?
    Ólafur Páll Geirsson
    @olafurpg
    @driuzz we have an idea how to reasonably implement it but it’s not on the near roadmap.
    A workaround is to write a custom compiler plugin.
    Loïc Girault
    @lgirault
    Hi. Is it possible, using scalameta only, to generate code with comments ? I understand it's not possible using quasiquotes ( https://scalameta.org/docs/trees/guide.html#with-quasiquotes ), but maybe by instanciating directly the AST ?
    how does scalafmt does ? it does not use the scalameta AST ?
    Siddhant Sanyam
    @siddhant3s
    I have a runtime.universe.Symbol for object Foo which is a companion object of a case class. Is it possible to get the object Foo so that I can call a field from it ?
    Dmytro Mitin
    @DmytroMitin
    @lgirault You can use tokens.
    @siddhant3s I guess it's not about Scalameta. https://gitter.im/scala/scala
    Loïc Girault
    @lgirault
    thanks @DmytroMitin
    Luciano
    @lJoublanc
    Hey @lgirault how did you manage this? Which term did you use?
    Loïc Girault
    @lgirault
    haha It was something nice to have but not required so I have not taken the time to try it yet
    James Koch
    @jameskoch
    First-time contributor looking for some feedback - scalameta/scalameta#1886
    vito-c
    @vito-c
    I'm writing some macros for an annotation. Is there an example project somewhere I can take a look at that uses scalameta?
    Gabriele Petronella
    @gabro
    @vito-c scalameta macros are an abandoned project. You should use regular macro annotations instead
    vito-c
    @vito-c
    @gabro ah thank you for letting me know so quasiquotes?
    finding examples of macros at all has been tough :(
    Gabriele Petronella
    @gabro
    you can use quasiquotes in Scala macros
    as per examples, yeah, I know. There's a project that uses macro annotations that I maintain called enumero
    and also cats-tagless is a good starting point
    vito-c
    @vito-c
    @gabro thanks! :)
    Tomasz Godzik
    @tgodzik
    Hi, should we release for Scala 2.12.9? Seems that every dependency is already released, but I am not sure how to release for just 2.12.9
    and people are pinging us already in Metals :O
    Gabriele Petronella
    @gabro
    I’ll take a look
    Tomasz Godzik
    @tgodzik
    @gabro thanks!
    Gabriele Petronella
    @gabro
    @tgodzik the fix is more involved than expected, due to a change in scalap scalameta/scalameta#1893
    Tomasz Godzik
    @tgodzik
    @gabro damn, I was hoping it would just be a matter of updating the version, will try to take a look, but I know nothing, so my help might not be helpful :O
    Martijn Hoekstra
    @martijnhoekstra
    scala/scala#8282 may have an impact on scalameta (hopefully making your life easier, but...)
    should I ping anyone for that?
    Lorenzo Testa
    @kklorenzotesta
    Hi, I can't find anything in the doc about metacp, I understood that generate semanticdb files from libraries, is it correct?
    Ilya Kachalsky
    @IlyaHalsky
    Hi, I'm just starting with scalameta and I'm trying to build code analyzer, is there a way to get current line number from original file while traversing structure?
    Dmytro Mitin
    @DmytroMitin
    @kklorenzotesta now we have compiler plugin https://scalameta.org/docs/semanticdb/guide.html#sbt
    Dmytro Mitin
    @DmytroMitin
    @IlyaHalsky SymbolOccurrence includes range (start_line, start_character, end_line, end_character) https://scalameta.org/docs/semanticdb/specification.html#symboloccurrence
    Lorenzo Testa
    @kklorenzotesta
    @DmytroMitin with the compiler plugin if I want to generate the semanticdb files from a jar I should use InteractiveSemanticdb to get a compiler and then use the compiler api, right? And this is preferred over using metacp?
    Dmytro Mitin
    @DmytroMitin
    Lorenzo Testa
    @kklorenzotesta
    thank you very much, this is perfect
    Ilya Kachalsky
    @IlyaHalsky
    @DmytroMitin thank you very much!
    Siddhant Sanyam
    @siddhant3s
    Can IntelliJ expand macro-paradise macros (annotation macros) without me having to write a plugin?
    Actually, I should probably ask this in scala
    P. Oscar Boykin
    @johnynek
    hi all, does anyone know if the scaladocs are published anywhere? I can't seem to find them.
    there is a trick to get sonatype to serve it.
    P. Oscar Boykin
    @johnynek
    although, it doesn't seem to have types like Source, Defn, etc...