Created
April 28, 2020 10:32
-
-
Save olafurpg/23c9628481b9f008bdc581164938b42c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ 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