Packages

c

scala.meta.internal.metals

DefinitionProvider

final class DefinitionProvider extends AnyRef

Implements goto definition that works even in code that doesn't parse.

Uses token edit-distance to align identifiers in the current open buffer with symbol occurrences from the latest SemanticDB snapshot.

The implementation logic for converting positions between the latest SemanticDB snapshot and current open buffer is quite hairy. We need to convert positions in both the "source" (where definition request is made) and the "destination" (location of the symbol definition). This requires using token edit distance twice:

- source: dirty buffer -> snapshot - destination: snapshot -> dirty buffer

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DefinitionProvider
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new DefinitionProvider(workspace: io.AbsolutePath, mtags: Mtags, buffers: Buffers, index: GlobalSymbolIndex, semanticdbs: Semanticdbs, warnings: Warnings, compilers: () => Compilers, remote: RemoteLanguageServer, trees: Trees, buildTargets: BuildTargets, scalaVersionSelector: ScalaVersionSelector, saveDefFileToDisk: Boolean, sourceMapper: SourceMapper)(implicit ec: ExecutionContext)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. def definition(path: io.AbsolutePath, params: TextDocumentPositionParams, token: CancelToken): Future[DefinitionResult]
  7. def definitionPathInputFromSymbol(sym: String, source: Option[io.AbsolutePath]): Option[VirtualFile]

    Returns VirtualFile that contains the definition of the given symbol (of semanticdb).

  8. val destinationProvider: DestinationProvider
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def fromSymbol(sym: String, targets: List[BuildTargetIdentifier]): java.util.List[Location]
  12. def fromSymbol(sym: String, source: Option[io.AbsolutePath]): java.util.List[Location]
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  19. def positionOccurrence(source: io.AbsolutePath, dirtyPosition: org.eclipse.lsp4j.Position, snapshot: TextDocument): ResolvedSymbolOccurrence
  20. def positionOccurrences(source: io.AbsolutePath, dirtyPosition: org.eclipse.lsp4j.Position, snapshot: TextDocument): List[ResolvedSymbolOccurrence]

    Find all SymbolOccurrences for the given position.

    Find all SymbolOccurrences for the given position. Multiple symbols might be attached, for example extension parameter. see: https://github.com/scalameta/metals/issues/3133

  21. def symbolOccurrence(source: io.AbsolutePath, dirtyPosition: org.eclipse.lsp4j.Position): Option[(SymbolOccurrence, TextDocument)]
  22. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped