Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Megan Wachs
    @mwachs5
    does mdoc command-line support pulling in resources from .jar files?
    1 reply
    Tomasz Godzik
    @tgodzik
    https://discord.gg/JSUjmTeG <- you can ask here
    people are more responsiive on discord currently
    Aaron Pritzlaff
    @aaronp
    Good morning all! Quick noob (hopefully) question - is scala3 supported? Couldn't see anything in open issues, but following the steps in my project, I see:
    sbt.librarymanagement.ResolveException: Error downloading my-org:my-project_2.12:abc123-SNAPSHOT
    where 'my-project' is a scala3 project
    It just struck me odd that it was looking for _2.12
    asaadza
    @asaadza
    @aaronp try adding the scalaVersion in the docs project settings too.
    val scala3Version = "3.1.0"
    lazy val docs = project       // new documentation project
      .in(file("aaa-docs"))       // important: it must not be docs/
      .dependsOn(root)
      .enablePlugins(MdocPlugin)
      .settings(
        scalaVersion := scala3Version,
      )
    1 reply
    asaadza
    @asaadza
    Docs say: Run mdoc to generate markdown sources. Supports arguments like --watch to start the file watcher with livereload.
    This is nice, but how does "reload" work? Can mdoc create HTML files from the markdown it generates? Does it then open a tab in the system default browser when sbt task docs \ mdoc is run with --watch and refresh on compile?
    Ólafur Páll Geirsson
    @olafurpg
    The --watch flag starts a static web server that renders markdown files as HTML
    asaadza
    @asaadza
    woah!
    Ólafur Páll Geirsson
    @olafurpg
    It doesn't launch your browser, it only prints the URL to the terminal and you can open the link if you like
    asaadza
    @asaadza
    how do I open them?
    Ólafur Páll Geirsson
    @olafurpg
    asaadza
    @asaadza
    ok - I'll try right now
    Ólafur Páll Geirsson
    @olafurpg
    the HTML preview is bare-bones, but often enough to focus on the content
    HTML rendering is intentionally not included with mdoc because there are so many ways to generate static sites
    asaadza
    @asaadza
    this is just what I wanted, thank you!
    Ólafur Páll Geirsson
    @olafurpg

    refresh on compile?

    It won't recompile if you change Scala sources, only markdown sources. You need to cmd-c or press Enter to stop the mdoc --watch task to recompile

    asaadza
    @asaadza
    yes, that is normal
    PS I never get an answer to "why can't we search for finer grained symbols in metals?"
    Ólafur Páll Geirsson
    @olafurpg
    the mdoc task runs a JVM process that has no knowledge of sbt compilation
    asaadza
    @asaadza
    OK
    Ólafur Páll Geirsson
    @olafurpg
    Is there an issue for that? I can leave a comment why
    It's an implementation detail, and I guess it's worth reconsidering with toplevel symbols in Scala 3
    asaadza
    @asaadza
    I think the issue said it would be too resource intensive
    Ólafur Páll Geirsson
    @olafurpg
    it's more expensive to index methods because you need to read classfiles or parse sources
    it's still cheap
    current indexing is super cheap
    asaadza
    @asaadza
    yes, it's really fast
    I hope you guys realise how useful the stuff you create and let us use is!
    Ólafur Páll Geirsson
    @olafurpg
    I'm glad to hear :D
    asaadza
    @asaadza
    thanks
    Ólafur Páll Geirsson
    @olafurpg
    I'm still working full-time on indexing and devtool stuff, just not scala right now. Been looking into trigram indexing for text search this week https://docs.google.com/document/d/1KY-CK0kDw6PNEBuOpslh_wbDOgelRfSfYpTg1SotFDg/edit#
    some tricks there would be helpful for the new Metals feature to search in resource files, turns out you can index text files very quickly with int64 bit fiddling
    ascii is only 7 bits and unicode 21 bits
    asaadza
    @asaadza
    interesting
    do you use IJ any more?
    Ólafur Páll Geirsson
    @olafurpg
    I use goland for go
    and IJ for Java
    asaadza
    @asaadza
    OK
    Ólafur Páll Geirsson
    @olafurpg
    but still VS Code for scala
    asaadza
    @asaadza
    the search for symbol in IJ is probably one of the only features I still miss
    Ólafur Páll Geirsson
    @olafurpg
    IJ has very slow completions, I regularly press enter before the completions load
    I agree
    the LSP api makes it difficult to implement proper symbol search
    asaadza
    @asaadza
    I thought of another thing that would be good to have in metals, but can't remember it now :)
    Ólafur Páll Geirsson
    @olafurpg
    need to load the exact location for every search result (filename on disk and line number)
    that's like >95% of the overhead
    asaadza
    @asaadza
    have you seen the haskell extension for metals?
    Ólafur Páll Geirsson
    @olafurpg
    o.O
    I have not