Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Chris Kipp
    @ckipp:matrix.org
    [m]
    @tpolecat: odd. I just tried with that same version of graal, but I have mine installed not with coursier, but I don't assume that should matter
    Rob Norris
    @tpolecat
    hmmmmmmmmmmm
    Chris Kipp
    @ckipp:matrix.org
    [m]
    right, I'm not crazy?
    ❯ java -version
    openjdk version "11.0.11" 2021-04-20
    OpenJDK Runtime Environment GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05)
    OpenJDK 64-Bit Server VM GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05, mixed mode, sharing)
    Rob Norris
    @tpolecat
    Curious.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    o wait, this is 21.1
    one sec
    Rob Norris
    @tpolecat
    Scala$ java -version
    openjdk version "11.0.10" 2021-01-19
    OpenJDK Runtime Environment GraalVM CE 21.0.0 (build 11.0.10+8-jvmci-21.0-b06)
    OpenJDK 64-Bit Server VM GraalVM CE 21.0.0 (build 11.0.10+8-jvmci-21.0-b06, mixed mode, sharing)
    I'm a version behind, looks like. It's the one cs picks when I just ask for graalvm-java11
    Chris Kipp
    @ckipp:matrix.org
    [m]
    ok mine works fine with 21.0 as well
    it's odd that it can't find main even
    Rob Norris
    @tpolecat
    Yeah!
    Nutty. Nothing else in the logs.
    Feel free to close if you can't reproduce. If nobody else runs into it I'm fine working around it.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    no we'll for sure keep it open for a bit in case someone else hits on it, but I'm afraid I don't even know what to recommend
    Rob Norris
    @tpolecat
    No worries at all. It's written down now, I have a workaround, all is well.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    👍️ I'll play around a bit more and see if I can reproduce
    @Sciss: keep in mind semantic highlighting isn't yet implemented in Metals
    however if you do want that, you could also consider tree-sitter
    Hanns Holger Rutz
    @Sciss
    So no. I think I'm happy with what I get from Metals for now. Just wondering where I get my syntax highlight (parser/lexer) from? Preferably with synchronous code.
    well it sort of depends on how your editor does syntax highlighting
    Hanns Holger Rutz
    @Sciss
    Currently, it just runs the lexer on the whole buffer when you edit, since that is so far a pretty fast operation. Then I get like a token iterator, and that's mapped to font attributes. I already do one extra mapping from scalariform tokens to my own, so that wouldn't be the problem.
    But ideally I could distinguish whether a symbol is a class, an object, refers to a local variable or a class variable, etc. I thought that was called semantic highlight.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    and then that's how you do highlighting currently? mapping the scalariform tokens to your own?
    Hanns Holger Rutz
    @Sciss
    Yes. And on top I do the compiler error highlighting coming from (Scala 2 presentation compiler / now Metals)
    Can I do the highlighting entirely through Metals?
    Chris Kipp
    @ckipp:matrix.org
    [m]
    gotcha
    not currently, no
    out of total curiosity, do you have like a good link explaining your project goals or something? I'd be curious to read more about it
    Hanns Holger Rutz
    @Sciss
    Hmmm. And do you happen to know a good Scala library that would help me here, that supports both Scala 2 and 3?
    Like, are the VIM people writing that lexer in vim-script or whatever it's called? Or is there some Scala code for it?
    Chris Kipp
    @ckipp:matrix.org
    [m]
    I don't know of anything in scala
    I think semantic tokens could really help you here
    sicne then it'd be handled over LSP as well
    Hanns Holger Rutz
    @Sciss
    Yeah. But you say that is not yet implemented?
    Chris Kipp
    @ckipp:matrix.org
    [m]
    have you by chance looked at all into NeoVim and how they've implemented tree-sitter?
    it's quite impressive and incredible fast
    however the Scala grammar is also not complete for it
    Hanns Holger Rutz
    @Sciss
    No. I have refrained so far from looking into scary projects like Vim, Emacs
    Chris Kipp
    @ckipp:matrix.org
    [m]
    and no, but we do have a feature request for it scalameta/metals-feature-requests#57
    scary projects like Vim, Emacs.... You're literally writing your own editor 😆
    Hanns Holger Rutz
    @Sciss
    So how does VS Code do it? With some grammer file and a typescript library?
    Yeah, but it's scope is far more limited than Vim or Emacs :)
    Chris Kipp
    @ckipp:matrix.org
    [m]
    Hanns Holger Rutz
    @Sciss
    thanks, I will look into that. It says it's both Scala 2 and 3, so that's great.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    yea plus this is regex based
    so it's not semantic
    Hanns Holger Rutz
    @Sciss
    Ok. This is why IMHO the Scala 2 presentation compiler was such a great project (in concept). It's a shame that it didn't live on as a public and official API.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    The Scala 3 compiler is also very impressive and imo probably way easier even to work with