Skip to content

Instantly share code, notes, and snippets.

@olafurpg
Created April 28, 2020 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olafurpg/23c9628481b9f008bdc581164938b42c to your computer and use it in GitHub Desktop.
Save olafurpg/23c9628481b9f008bdc581164938b42c to your computer and use it in GitHub Desktop.
@ import $ivy.`org.scalameta:::mtags:0.8.4`, scala.meta.internal.mtags._, scala.meta.internal.metals._
iimport $ivy.$ , scala.meta.internal.mtags._, scala.meta.internal.metals._
@ import scala.collection.JavaConverters._
import scala.collection.JavaConverters._
@
val sources = coursierapi.Fetch.create().withClassifiers(Set("sources").asJava).addDependencies(coursierapi.Dependency.of("org.scala-lang", "scala-library", "2.13.2")).fetch().asScala.map(_.toPath).map(scala.meta.AbsolutePath(_))
sources: collection.mutable.Buffer[scala.meta.io.AbsolutePath] = ArrayBuffer(
AbsolutePath(
/Users/lgeirsson/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2-sources.jar
)
)
@ val index = OnDemandSymbolIndex()
index: OnDemandSymbolIndex = scala.meta.internal.mtags.OnDemandSymbolIndex@4a44cfc0
@ sources.foreach(jar => index.addSourceJar(jar))
@ val docstrings = new Docstrings(index)
docstrings: Docstrings = scala.meta.internal.metals.Docstrings@1e495414
@ docstrings.documentation("scala/Option#map().").get()
res6: scala.meta.pc.SymbolDocumentation = MetalsSymbolDocumentation(
"scala/Option#map().",
"map",
"""Returns a [scala.Some](scala.Some) containing the result of applying `f` to this [scala.Option](scala.Option)'s
value if this [scala.Option](scala.Option) is nonempty.
Otherwise return `None`.
This is equivalent to:
```
option match {
case Some(x) => Some(f(x))
case None => None
}
```
**Notes**
- This is similar to `flatMap` except here,
`f` does not need to wrap its result in an [scala.Option](scala.Option).
**Parameters**
- `f`: the function to apply
**See**
- [flatMap](flatMap)
- [foreach](foreach)""",
"",
SeqWrapper(List(MetalsSymbolDocumentation("scala/Option#(B)", "B", "", "", SeqWrapper(List()), SeqWrapper(List())))),
SeqWrapper(
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment