keys are non-trivial toplevel symbols and values are the file the symbols are defined in.
keys are global symbols and the values are the files the symbols are defined in. Difference between toplevels and definitions is that toplevels contains only symbols generated by ScalaToplevelMtags while definitions contains only symbols generated by ScalaMtags.
The same as addSourceJar
except for directories
The same as addSourceJar
except for directories
Add an individual Java or Scala source file to the index.
Add an individual Java or Scala source file to the index.
the enclosing project source directory if
file is on disk, used to relativize file
.
Can be None if file is inside a zip file
assuming the file path is already relativized
by that point.
Exception
in case of problems processing the source file
such as tokenization failure due to an unclosed
literal.
Index a jar or zip file containing Scala and Java source files.
Index a jar or zip file containing Scala and Java source files.
Published artifacts typically have accompanying sources.jar files that include the project sources.
Sources of a published library can be fetched from the command-line with coursier using the --sources flag:
$ coursier fetch com.thoughtworks.qdox:qdox:2.0-M9 --sources $HOME/.coursier/cache/v1/https/repo1.maven.org/maven2/com/thoughtworks/qdox/qdox/2.0-M9/qdox-2.0-M9-sources.jar.coursier/cache/v1/https/repo1.maven.org/maven2/com/thoughtworks/qdox/qdox/2.0-M9/qdox-2.0-M9-sources.jar
Sources can be fetched from an sbt build through the updateClassifiers
task:
val sourceJars = for { configurationReport <- updateClassifiers.in(input).value.configurations moduleReport <- configurationReport.modules (artifact, file) <- moduleReport.artifacts if artifact.classifier.contains("sources") } yield file
the path to a single jar or zip file.
Exception
in case of problems processing the source file
such as tokenization failure due to an unclosed
literal.
Lookup the definition of a global symbol.
Lookup the definition of a global symbol. * Returns the path of the file that defines the symbol but does not include the exact position of the definition. Computing the range position of the definition is not handled by this method, it is left for the user and can be done using the mtags module.
a global SemanticDB symbol. For comprehensive documentation of how a symbol is formatted consule the specification: https://scalameta.org/docs/semanticdb/specification.html#symbol Examples:
"scala/Option#" // Option class "scala/Option." // Option companion object "scala/Option#.get()." // `get` method for Option "scala/Predef.String#" // String type alias in Predef "java/lang/String#format(+1)." // Static `format` method for strings "java/util/Map#Entry#" // Static inner interface.
the definition of the symbol, if any.
keys are global symbols and the values are the files the symbols are defined in.
keys are global symbols and the values are the files the symbols are defined in. Difference between toplevels and definitions is that toplevels contains only symbols generated by ScalaToplevelMtags while definitions contains only symbols generated by ScalaMtags.
keys are non-trivial toplevel symbols and values are the file the symbols are defined in.
An implementation of GlobalSymbolIndex with fast indexing and low memory usage.
Fast indexing is enabled by ScalaToplevelMtags, a custom parser that extracts only toplevel symbols from a Scala source file. Java source files don't need indexing because their file location can be inferred from the symbol with the limitation that it doesn't work for Java source files with multiple package-private top-level classes.
Low memory usage is enabled by only storing "non-trivial toplevel" symbols. A symbol is "toplevel" when its owner is a package. A symbol is "non-trivial" when it doesn't match the path of the file it's defined in, for example
Some#
in Option.scala is non-trivial whileOption#
in Option.scala is trivial.keys are non-trivial toplevel symbols and values are the file the symbols are defined in.
keys are global symbols and the values are the files the symbols are defined in. Difference between toplevels and definitions is that toplevels contains only symbols generated by ScalaToplevelMtags while definitions contains only symbols generated by ScalaMtags.