Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ólafur Páll Geirsson
    @olafurpg
    @ghik you may have an old version of bloop running
    we're waiting for a stable release of bloop to come out before releasing metals v0.8
    maybe best to wait until then
    Roman Janusz
    @ghik
    ok, thanks, that's probably what I will do
    but I don't understand why I'm running wrong version of bloop - isn't it set up automatically by metals?
    Tomasz Godzik
    @tgodzik
    @ghik might also be needed to reimport the build - that message usually means that some json has an unexpected structure
    Jakub Kozłowski
    @kubukoz
    I'm having trouble running scalafifx on a project (RemoveUnused) - using the sbt plugin/task. The plugin claims the files were changed but they remain unmodified...
    sbt:OrderService> scalafix RemoveUnused
    [info] Running scalafix on 10 Scala sources
    [info] Running scalafix on 6 Scala sources
    [info] Running scalafix on 3 Scala sources
    [info] Running scalafix on 50 Scala sources
    [success] Total time: 1 s, completed Dec 17, 2019 12:35:41 PM
    yet nothing changes
    I have the necessary flags on, and can see warnings on a fresh compile
    would appreciate any hints
    sandeshyapuram
    @pandareen
    Hello, can you point me to some examples? I could use some full-blown tutorials
    Bartosz Bąbol
    @BBartosz
    According to main page of scalameta: Scalameta- Library to read, analyze, transform and generate Scala programs -> how exactly scalameta is used to generate scala programs since macros are not part of scalameta anymore?
    Gabriele Petronella
    @gabro
    @BBartosz you can generate programs by constructing trees and printing them with Scalameta. Macros allow you to do roughly the same thing, except you do it during the compilation of your program
    in other words, you can do code generation with Scalameta
    (I use it for this purpose at work)
    Ólafur Páll Geirsson
    @olafurpg
    @BBartosz Scalameta does not support macros, you can use scala-reflect macros instead
    Roman Janusz
    @ghik
    Hi!
    I have an already parsed Source. I also have a Position representing some arbitrary range in that source. I would like to obtain Tokens representing tokens only from that range. How can I do this efficiently?
    Is there anything better I can do than manually implementing binary search?
    Ólafur Páll Geirsson
    @olafurpg
    You can access the underlying token array by using a package private API called “Origin”
    But you would still need to know the index in the array where your range starts
    So binary search is the best solution if you already have the token array.
    Roman Janusz
    @ghik
    Thanks
    Bartosz Bąbol
    @BBartosz

    @BBartosz you can generate programs by constructing trees and printing them with Scalameta. Macros allow you to do roughly the same thing, except you do it during the compilation of your program

    How exactly you generate them? I understand that you use quasiquotes to build your tree and then you save it to file, kinda like string?

    Roman Janusz
    @ghik
    @BBartosz yes, this way. You cannot generate programs with scalameta "on the fly", that is in compile time like macros.
    Bartosz Bąbol
    @BBartosz

    @BBartosz yes, this way. You cannot generate programs with scalameta "on the fly", that is in compile time like macros.

    yeah thx i was wondering whats the way to do it. I was using quasiquotes and macros but generating the code and saving it to file might also work for me

    sandeshyapuram
    @pandareen
    Is there a better way to kick off code generation? I am using Scala Annotations for pointing it towards scalameta to generate new codee.
    Ólafur Páll Geirsson
    @olafurpg
    @pandareen if you are generating source code as strings, I would recommend using something like treehugger instead http://eed3si9n.com/treehugger/