Package

scala.meta.internal

metals

Permalink

package metals

Visibility
  1. Public
  2. All

Type Members

  1. case class Classfile(pkg: String, filename: String) extends Product with Serializable

    Permalink
  2. class ClassfileComparator extends Comparator[Classfile]

    Permalink
  3. case class ClassfileElementPart(name: String) extends ClasspathElementPart with Product with Serializable

    Permalink
  4. sealed abstract class ClasspathElementPart extends AnyRef

    Permalink
  5. class ClasspathSearch extends AnyRef

    Permalink
  6. case class CompilerOffsetParams(filename: String, text: String, offset: Int, token: CancelToken = EmptyCancelToken) extends OffsetParams with Product with Serializable

    Permalink
  7. case class CompressedPackageIndex(packages: Array[String], bloom: StringBloomFilter, memberBytes: Array[Byte]) extends Product with Serializable

    Permalink

    The memory-compressed version of PackageIndex.

    The memory-compressed version of PackageIndex.

    bloom

    the fuzzy search bloom filter for all members of this package.

    memberBytes

    the GZIP compressed bytes representing Array[String] for all members of this package. The members are compressed because the strings consume a lot of memory and most queries only require looking at a few packages. We decompress the members only when a search query matches the bloom filter for this package.

  8. class ConcatSequence extends CharSequence

    Permalink

    A CharSequence which is the concatenation of two strings.

    A CharSequence which is the concatenation of two strings.

    This class is the equivalent of doing string1 + string2 but in constant time and with no copying.

  9. class Docstrings extends AnyRef

    Permalink

    Implementation of the documentation(symbol: String): Option[SymbolDocumentation] method in SymbolSearch.

    Implementation of the documentation(symbol: String): Option[SymbolDocumentation] method in SymbolSearch.

    Handles both javadoc and scaladoc.

  10. case class ExactCharSequence(value: CharSequence) extends CharSequence with Product with Serializable

    Permalink

    A char sequence that represents an exact symbol search.

    A char sequence that represents an exact symbol search.

    For example, ExactSymbolSearch("S") is added to a bloom filter to indicate a souce file has a symbol with the exact name "S".

  11. class Fuzzy extends AnyRef

    Permalink
  12. class JavadocIndexer extends JavaMtags

    Permalink

    Extracts Javadoc from Java source code.

  13. case class MetalsSymbolDocumentation(symbol: String, displayName: String, docstring: String, defaultValue: String = "", typeParameters: java.util.List[SymbolDocumentation] = Nil.asJava, parameters: java.util.List[SymbolDocumentation] = Nil.asJava) extends SymbolDocumentation with Product with Serializable

    Permalink
  14. case class PackageElementPart(name: String) extends ClasspathElementPart with Product with Serializable

    Permalink
  15. class PackageIndex extends AnyRef

    Permalink

    An index to lookup classfiles contained in a given classpath.

  16. class ScaladocIndexer extends ScalaMtags

    Permalink

    Extracts Scaladoc from Scala source code.

  17. case class SemanticdbDefinition(info: SymbolInformation, occ: SymbolOccurrence, owner: String) extends Product with Serializable

    Permalink

    A definition of a global symbol produced by mtags.

  18. class StringBloomFilter extends AnyRef

    Permalink

    A wrapper around a bloom filter that is optimized for fast insertions of strings with shared prefixes.

    A wrapper around a bloom filter that is optimized for fast insertions of strings with shared prefixes.

    To index a classpath, Metals walks through all possible prefixes of a given classfile path. For example, given the string "InputStream.class" Metals builds a bloom filter containing the set of the following strings: I, In, Inp, Inpu, Input, S, St, Str, Stre, Strea and Stream.

    The naive approach to construct a bloom filter of all those prefix strings is to create a BloomFilter[CharSequence] and insert all those prefixes. This approach has sub-optimal performance because it requires a quadratic number of iterations on the characters of the classfile path.

    This class implements an optimized approach to build that bloom filter in a way that requires only a linear pass on the characters of the classfile path. The trick is to construct a BloomFilter[Long] instead of BloomFilter[CharSequence] and incrementally build the hashcode of each prefix string as we iterate over each character in the string.

    Additionally, this class exposes a mightContain(Long) method that speeds up search queries by allowing the client to pre-compute the hash of the query string and re-use mightContain calls to multiple bloom filters. For every single fuzzy symbol search (which happens on every single scope completion request) we usually perform several thousant bloom filter mightContain calls so should also help avoid a non-trivial amount of unnecessary hashing.

  19. case class WorkspaceSymbolInformation(symbol: String, sematicdbKind: Kind, range: org.eclipse.lsp4j.Range) extends Product with Serializable

    Permalink
  20. case class WorkspaceSymbolQuery(query: String, alternatives: Array[AlternativeQuery], isTrailingDot: Boolean, isClasspath: Boolean = true) extends Product with Serializable

    Permalink

    A query for workspace/symbol.

    A query for workspace/symbol.

    query

    the user query itself.

    alternatives

    all query alternatives for this query. For non-lowercase queries this list has always length 1 but for all-lowercase queries we have combinations of query with guesses for which characters in the query should be capitalized.

  21. class ZeroCopySubSequence extends CharSequence

    Permalink

Value Members

  1. object BloomFilters

    Permalink
  2. object Classfile extends Serializable

    Permalink
  3. object ClasspathSearch

    Permalink
  4. object CompilerOffsetParams extends Serializable

    Permalink
  5. object CompressedPackageIndex extends Serializable

    Permalink
  6. object Compression

    Permalink
  7. object Docstrings

    Permalink
  8. object EmptyCancelToken extends CancelToken

    Permalink
  9. object EmptySymbolDocumentation extends SymbolDocumentation

    Permalink

    A symbol documenation with all empty values

  10. object Fuzzy extends Fuzzy

    Permalink

    Metals fuzzy search for strings.

    Metals fuzzy search for strings.

    Goals: - predictable, the user should understand why particular results matched a given query. When the search is too fuzzy the results become noisy and the user has little control over how to narrow the results. - fast, we perform fuzzy search on a lot of string in critical paths on ever user keystroke. We avoid allocations and backtracking when possible even if it comes at the price of less readable code.

    The following pairs of (query, symbol) match. - InStr java/io/InputFileStream# - IFS java/io/InputFileStream# - i.InStr java/io/InputFileStream# - j.i.InStr java/io/InputFileStream# - M.Entry java/util/Map#Entry# (inner classes are like packages)

    The following pairs of (query, symbol) do not match. - IpStr java/io/InputFileStream# (missing leading n before p) - instr java/io/InputFileStream# (lowercase queries are exact, WorkspaceSymbolProvider works around this limitation by guessing multiple capitalizations of all-lowercase queries) - MapEntry java/io/InputFileStream# (missing . separator after "Map") - j.InStr java/io/InputFileStream# (missing io separator, the java/ package must be direct parent)

    Glossary and conventions used in this file: - query, what the user typed to look up a symbol. - symbol, a SemanticDB Java/Scala symbol (https://scalameta.org/docs/semanticdb/specification.html) or a java.util.zip.ZipEntry name pointing to a classfile. - delimiter, one of the characters '.' or '/' or '#' that separate package/class/object/trait names in SemanticDB symbols, or '$' that separates inner classes in classfile names. - name, characters between delimiters like "io" in "java/io/InputStream". - main name, the last name in the query or symbol. For example, "Pos" is the main name in "s.m.Pos". - qa, the start index in the query string. - qb, the end index in the query string. - sa, the start index in the symbol string. - sb, the end index in the symbol string.

  11. object JavadocIndexer

    Permalink
  12. object JdkSources

    Permalink

    Locates zip file on disk that contains the source code for the JDK.

  13. object PackageIndex

    Permalink
  14. object PositionSyntax

    Permalink
  15. object RecursivelyDelete

    Permalink
  16. object ScaladocIndexer

    Permalink
  17. object SemanticdbDefinition extends Serializable

    Permalink
  18. object Testing

    Permalink
  19. object TextEdits

    Permalink

    Client implementation of how to interpret TextEdit from LSP, used for testing purposes.

  20. object TrigramSubstrings

    Permalink
  21. object WorkspaceSymbolQuery extends Serializable

    Permalink

Ungrouped