File: .lake/packages/lean4/src/lean/Lean/Server/References.lean

full_name: Lean.Server.Reference.range
code: /--
Global reference. Used by the language server to figure out which identifiers refer to which
other identifiers across the whole project.
-/
structure Reference where
  /-- Identifier of this reference. -/
  ident    : RefIdent
  /-- Identifiers that are logically identical to this reference. -/
  aliases  : Array RefIdent := #[]
  /-- Range where this reference occurs. -/
  range    : Lsp.Range
  /-- Syntax of this reference. -/
  stx      : Syntax
  /-- `ContextInfo` at the point of elaboration of this reference. -/
  ci       : ContextInfo
  /-- Additional `InfoTree` information for this reference. -/
  info     : Info
  /-- Whether this reference declares `ident`. -/
  isBinder : Bool
goal: Lean.Lsp.Range

full_name: Lean.Server.Reference.aliases
code: /--
Global reference. Used by the language server to figure out which identifiers refer to which
other identifiers across the whole project.
-/
structure Reference where
  /-- Identifier of this reference. -/
  ident    : RefIdent
  /-- Identifiers that are logically identical to this reference. -/
  aliases  : Array RefIdent := #[]
  /-- Range where this reference occurs. -/
  range    : Lsp.Range
  /-- Syntax of this reference. -/
  stx      : Syntax
  /-- `ContextInfo` at the point of elaboration of this reference. -/
  ci       : ContextInfo
  /-- Additional `InfoTree` information for this reference. -/
  info     : Info
  /-- Whether this reference declares `ident`. -/
  isBinder : Bool
goal: Array Lean.Lsp.RefIdent

full_name: Lean.Server.Reference.info
code: /--
Global reference. Used by the language server to figure out which identifiers refer to which
other identifiers across the whole project.
-/
structure Reference where
  /-- Identifier of this reference. -/
  ident    : RefIdent
  /-- Identifiers that are logically identical to this reference. -/
  aliases  : Array RefIdent := #[]
  /-- Range where this reference occurs. -/
  range    : Lsp.Range
  /-- Syntax of this reference. -/
  stx      : Syntax
  /-- `ContextInfo` at the point of elaboration of this reference. -/
  ci       : ContextInfo
  /-- Additional `InfoTree` information for this reference. -/
  info     : Info
  /-- Whether this reference declares `ident`. -/
  isBinder : Bool
goal: Lean.Elab.Info

full_name: Lean.Server.Reference.isBinder
code: /--
Global reference. Used by the language server to figure out which identifiers refer to which
other identifiers across the whole project.
-/
structure Reference where
  /-- Identifier of this reference. -/
  ident    : RefIdent
  /-- Identifiers that are logically identical to this reference. -/
  aliases  : Array RefIdent := #[]
  /-- Range where this reference occurs. -/
  range    : Lsp.Range
  /-- Syntax of this reference. -/
  stx      : Syntax
  /-- `ContextInfo` at the point of elaboration of this reference. -/
  ci       : ContextInfo
  /-- Additional `InfoTree` information for this reference. -/
  info     : Info
  /-- Whether this reference declares `ident`. -/
  isBinder : Bool
goal: Bool

full_name: Lean.Server.Reference.ci
code: /--
Global reference. Used by the language server to figure out which identifiers refer to which
other identifiers across the whole project.
-/
structure Reference where
  /-- Identifier of this reference. -/
  ident    : RefIdent
  /-- Identifiers that are logically identical to this reference. -/
  aliases  : Array RefIdent := #[]
  /-- Range where this reference occurs. -/
  range    : Lsp.Range
  /-- Syntax of this reference. -/
  stx      : Syntax
  /-- `ContextInfo` at the point of elaboration of this reference. -/
  ci       : ContextInfo
  /-- Additional `InfoTree` information for this reference. -/
  info     : Info
  /-- Whether this reference declares `ident`. -/
  isBinder : Bool
goal: Lean.Elab.ContextInfo

full_name: Lean.Server.Reference.stx
code: /--
Global reference. Used by the language server to figure out which identifiers refer to which
other identifiers across the whole project.
-/
structure Reference where
  /-- Identifier of this reference. -/
  ident    : RefIdent
  /-- Identifiers that are logically identical to this reference. -/
  aliases  : Array RefIdent := #[]
  /-- Range where this reference occurs. -/
  range    : Lsp.Range
  /-- Syntax of this reference. -/
  stx      : Syntax
  /-- `ContextInfo` at the point of elaboration of this reference. -/
  ci       : ContextInfo
  /-- Additional `InfoTree` information for this reference. -/
  info     : Info
  /-- Whether this reference declares `ident`. -/
  isBinder : Bool
goal: Lean.Syntax

full_name: Lean.Server.Reference
code: /--
Global reference. Used by the language server to figure out which identifiers refer to which
other identifiers across the whole project.
-/
structure Reference where
  /-- Identifier of this reference. -/
  ident    : RefIdent
  /-- Identifiers that are logically identical to this reference. -/
  aliases  : Array RefIdent := #[]
  /-- Range where this reference occurs. -/
  range    : Lsp.Range
  /-- Syntax of this reference. -/
  stx      : Syntax
  /-- `ContextInfo` at the point of elaboration of this reference. -/
  ci       : ContextInfo
  /-- Additional `InfoTree` information for this reference. -/
  info     : Info
  /-- Whether this reference declares `ident`. -/
  isBinder : Bool
goal: Type

full_name: Lean.Server.Reference.ident
code: /--
Global reference. Used by the language server to figure out which identifiers refer to which
other identifiers across the whole project.
-/
structure Reference where
  /-- Identifier of this reference. -/
  ident    : RefIdent
  /-- Identifiers that are logically identical to this reference. -/
  aliases  : Array RefIdent := #[]
  /-- Range where this reference occurs. -/
  range    : Lsp.Range
  /-- Syntax of this reference. -/
  stx      : Syntax
  /-- `ContextInfo` at the point of elaboration of this reference. -/
  ci       : ContextInfo
  /-- Additional `InfoTree` information for this reference. -/
  info     : Info
  /-- Whether this reference declares `ident`. -/
  isBinder : Bool
goal: Lean.Lsp.RefIdent

full_name: Lean.Server.RefInfo.usages
code: /-- Definition and usages of an identifier within a single module. -/
structure RefInfo where
  /--
  Definition `Reference` of the identifier.
  Is equal to `none` if e.g. the definition is outside of the module where this `RefInfo` is used.
  -/
  definition : Option Reference
  /-- All usage `Reference`s of the identifier in a single module. -/
  usages     : Array Reference
goal: Array Lean.Server.Reference

full_name: Lean.Server.RefInfo.definition
code: /-- Definition and usages of an identifier within a single module. -/
structure RefInfo where
  /--
  Definition `Reference` of the identifier.
  Is equal to `none` if e.g. the definition is outside of the module where this `RefInfo` is used.
  -/
  definition : Option Reference
  /-- All usage `Reference`s of the identifier in a single module. -/
  usages     : Array Reference
goal: Option Lean.Server.Reference

full_name: Lean.Server.RefInfo
code: /-- Definition and usages of an identifier within a single module. -/
structure RefInfo where
  /--
  Definition `Reference` of the identifier.
  Is equal to `none` if e.g. the definition is outside of the module where this `RefInfo` is used.
  -/
  definition : Option Reference
  /-- All usage `Reference`s of the identifier in a single module. -/
  usages     : Array Reference
goal: Type

full_name: Lean.Server.RefInfo.empty
code: /-- No definition, no usages. -/
def empty : RefInfo 
goal: Lean.Server.RefInfo

full_name: Lean.Server.RefInfo.addRef
code: /--
Adds `ref` to `i`.
If `i` has no `definition` and `ref` is a declaration, it becomes the `definition`.
If `i` already has a `definition` and `ref` is also a declaration, it is not added to `i`.
Otherwise, `ref` is added to `i.usages`.
-/
def addRef (i : RefInfo) (ref : Reference) : RefInfo 
goal: Lean.Server.RefInfo

full_name: Lean.Server.RefInfo.toLspRefInfo
code: /-- Converts `i` to a JSON-serializable `Lsp.RefInfo`. -/
def toLspRefInfo (i : RefInfo) : BaseIO Lsp.RefInfo 
goal: BaseIO Lean.Lsp.RefInfo

full_name: Lean.Server.ModuleRefs
code: /-- All references from within a module for all identifiers used in a single module. -/
def ModuleRefs 
goal: Type

full_name: Lean.Server.ModuleRefs.addRef
code: /-- Adds `ref` to the `RefInfo` corresponding to `ref.ident` in `self`. See `RefInfo.addRef`. -/
def addRef (self : ModuleRefs) (ref : Reference) : ModuleRefs 
goal: Lean.Server.ModuleRefs

full_name: Lean.Server.ModuleRefs.toLspModuleRefs
code: /-- Converts `refs` to a JSON-serializable `Lsp.ModuleRefs`. -/
def toLspModuleRefs (refs : ModuleRefs) : BaseIO Lsp.ModuleRefs 
goal: BaseIO Lean.Lsp.ModuleRefs

full_name: Lean.Lsp.RefInfo.empty
code: /-- No definition, no usages -/
def empty : RefInfo 
goal: Lean.Lsp.RefInfo

full_name: Lean.Lsp.RefInfo.merge
code: /-- Combines the `usages` of `a` and `b` and prefers the `definition?` of `b` over that of `a`. -/
def merge (a : RefInfo) (b : RefInfo) : RefInfo 
goal: Lean.Lsp.RefInfo

full_name: Lean.Lsp.RefInfo.findReferenceLocation?.contains
code: /--
Finds the first definition or usage in `self` where the `RefInfo.Location.range`
contains the given `pos`. The `includeStop` parameter can be used to toggle between closed-interval
and half-open-interval behavior for the range. Closed-interval behavior matches the expectation of
VSCode when selecting an identifier at a cursor position (see #767).
-/
def findReferenceLocation?
    (self        : RefInfo)
    (pos         : Lsp.Position)
    (includeStop : Bool := false)
    : Option Location 
goal: Bool

full_name: Lean.Lsp.RefInfo.findReferenceLocation?
code: /--
Finds the first definition or usage in `self` where the `RefInfo.Location.range`
contains the given `pos`. The `includeStop` parameter can be used to toggle between closed-interval
and half-open-interval behavior for the range. Closed-interval behavior matches the expectation of
VSCode when selecting an identifier at a cursor position (see #767).
-/
def findReferenceLocation?
    (self        : RefInfo)
    (pos         : Lsp.Position)
    (includeStop : Bool := false)
    : Option Location 
goal: Option Lean.Lsp.RefInfo.Location

full_name: Lean.Lsp.RefInfo.contains
code: /-- Checks whether any of the ranges in `self.definition?` or `self.usages` contains `pos`. -/
def contains (self : RefInfo) (pos : Lsp.Position) (includeStop := false) : Bool 
goal: Bool

full_name: Lean.Lsp.ModuleRefs.findAt
code: /--
Find all identifiers in `self` with a reference in this module that contains `pos` in its range.
-/
def findAt
    (self        : ModuleRefs)
    (pos         : Lsp.Position)
    (includeStop := false)
    : Array RefIdent 
goal: Array Lean.Lsp.RefIdent

full_name: Lean.Lsp.ModuleRefs.findRange?
code: /-- Finds the first range in `self` that contains `pos`. -/
def findRange? (self : ModuleRefs) (pos : Lsp.Position) (includeStop := false) : Option Range 
goal: Option Lean.Lsp.Range

full_name: Lean.Server.Ilean.version
code: /-- Content of individual `.ilean` files -/
structure Ilean where
  /-- Version number of the ilean format. -/
  version    : Nat := 3
  /-- Name of the module that this ilean data has been collected for. -/
  module     : Name
  /-- All references of this module. -/
  references : Lsp.ModuleRefs
  deriving FromJson, ToJson
goal: Nat

full_name: Lean.Server.Ilean
code: /-- Content of individual `.ilean` files -/
structure Ilean where
  /-- Version number of the ilean format. -/
  version    : Nat := 3
  /-- Name of the module that this ilean data has been collected for. -/
  module     : Name
  /-- All references of this module. -/
  references : Lsp.ModuleRefs
  deriving FromJson, ToJson
goal: Type

full_name: Lean.Server.Ilean.module
code: /-- Content of individual `.ilean` files -/
structure Ilean where
  /-- Version number of the ilean format. -/
  version    : Nat := 3
  /-- Name of the module that this ilean data has been collected for. -/
  module     : Name
  /-- All references of this module. -/
  references : Lsp.ModuleRefs
  deriving FromJson, ToJson
goal: Lean.Name

full_name: Lean.Server.Ilean.references
code: /-- Content of individual `.ilean` files -/
structure Ilean where
  /-- Version number of the ilean format. -/
  version    : Nat := 3
  /-- Name of the module that this ilean data has been collected for. -/
  module     : Name
  /-- All references of this module. -/
  references : Lsp.ModuleRefs
  deriving FromJson, ToJson
goal: Lean.Lsp.ModuleRefs

full_name: Lean.Server.instFromJsonIlean
code: FromJson
goal: Lean.FromJson Lean.Server.Ilean

full_name: Lean.Server.instToJsonIlean
code: ToJson
goal: Lean.ToJson Lean.Server.Ilean

full_name: Lean.Server.Ilean.load
code: /-- Reads and parses the .ilean file at `path`. -/
def load (path : System.FilePath) : IO Ilean 
goal: IO Lean.Server.Ilean

full_name: Lean.Server.getModuleContainingDecl?
code: /-- Gets the name of the module that contains `declName`. -/
def getModuleContainingDecl? (env : Environment) (declName : Name) : Option Name 
goal: Option Lean.Name

full_name: Lean.Server.identOf
code: /--
Determines the `RefIdent` for the `Info` `i` of an identifier in `module` and
whether it is a declaration.
-/
def identOf (ci : ContextInfo) (i : Info) : Option (RefIdent × Bool) 
goal: Option (Lean.Lsp.RefIdent × Bool)

full_name: Lean.Server.findReferences
code: /-- Finds all references in `trees`. -/
def findReferences (text : FileMap) (trees : Array InfoTree) : Array Reference 
goal: Array Lean.Server.Reference

full_name: Lean.Server.combineIdents.useConstRepresentatives
code: /--
There are several different identifiers that should be considered equal for the purpose of finding
all references of an identifier:
- `FVarId`s of a function parameter in the function's signature and body
- Chains of helper definitions like those created for do-reassignment `x := e`
- Overlapping definitions like those defined by `where` declarations that define both an FVar
  (for local usage) and a constant (for non-local usage)
- Identifiers connected by `FVarAliasInfo` such as variables before and after `match` generalization

In the first three cases that are not explicitly denoted as aliases with an `FVarAliasInfo`, the
corresponding `Reference`s have the exact same range.
This function finds all definitions that have the exact same range as another definition or usage
and collapses them into a single identifier. It also collapses identifiers connected by
an `FVarAliasInfo`.
When collapsing identifiers, it prefers using a `RefIdent.const name` over a `RefIdent.fvar id` for
all identifiers that are being collapsed into one.
-/
partial def combineIdents (trees : Array InfoTree) (refs : Array Reference) : Array Reference 
goal: Lean.HashMap Lean.Lsp.RefIdent Lean.Lsp.RefIdent

full_name: Lean.Server.combineIdents.insertIdMap
code: /--
There are several different identifiers that should be considered equal for the purpose of finding
all references of an identifier:
- `FVarId`s of a function parameter in the function's signature and body
- Chains of helper definitions like those created for do-reassignment `x := e`
- Overlapping definitions like those defined by `where` declarations that define both an FVar
  (for local usage) and a constant (for non-local usage)
- Identifiers connected by `FVarAliasInfo` such as variables before and after `match` generalization

In the first three cases that are not explicitly denoted as aliases with an `FVarAliasInfo`, the
corresponding `Reference`s have the exact same range.
This function finds all definitions that have the exact same range as another definition or usage
and collapses them into a single identifier. It also collapses identifiers connected by
an `FVarAliasInfo`.
When collapsing identifiers, it prefers using a `RefIdent.const name` over a `RefIdent.fvar id` for
all identifiers that are being collapsed into one.
-/
partial def combineIdents (trees : Array InfoTree) (refs : Array Reference) : Array Reference 
goal: StateT (Lean.HashMap Lean.Lsp.RefIdent Lean.Lsp.RefIdent) Id Unit

full_name: Lean.Server.combineIdents.buildIdMap
code: /--
There are several different identifiers that should be considered equal for the purpose of finding
all references of an identifier:
- `FVarId`s of a function parameter in the function's signature and body
- Chains of helper definitions like those created for do-reassignment `x := e`
- Overlapping definitions like those defined by `where` declarations that define both an FVar
  (for local usage) and a constant (for non-local usage)
- Identifiers connected by `FVarAliasInfo` such as variables before and after `match` generalization

In the first three cases that are not explicitly denoted as aliases with an `FVarAliasInfo`, the
corresponding `Reference`s have the exact same range.
This function finds all definitions that have the exact same range as another definition or usage
and collapses them into a single identifier. It also collapses identifiers connected by
an `FVarAliasInfo`.
When collapsing identifiers, it prefers using a `RefIdent.const name` over a `RefIdent.fvar id` for
all identifiers that are being collapsed into one.
-/
partial def combineIdents (trees : Array InfoTree) (refs : Array Reference) : Array Reference 
goal: Lean.HashMap Lean.Lsp.RefIdent Lean.Lsp.RefIdent

full_name: Lean.Server.combineIdents.findCanonicalRepresentative
code: /--
There are several different identifiers that should be considered equal for the purpose of finding
all references of an identifier:
- `FVarId`s of a function parameter in the function's signature and body
- Chains of helper definitions like those created for do-reassignment `x := e`
- Overlapping definitions like those defined by `where` declarations that define both an FVar
  (for local usage) and a constant (for non-local usage)
- Identifiers connected by `FVarAliasInfo` such as variables before and after `match` generalization

In the first three cases that are not explicitly denoted as aliases with an `FVarAliasInfo`, the
corresponding `Reference`s have the exact same range.
This function finds all definitions that have the exact same range as another definition or usage
and collapses them into a single identifier. It also collapses identifiers connected by
an `FVarAliasInfo`.
When collapsing identifiers, it prefers using a `RefIdent.const name` over a `RefIdent.fvar id` for
all identifiers that are being collapsed into one.
-/
partial def combineIdents (trees : Array InfoTree) (refs : Array Reference) : Array Reference 
goal: Lean.Lsp.RefIdent

full_name: Lean.Server.combineIdents
code: /--
There are several different identifiers that should be considered equal for the purpose of finding
all references of an identifier:
- `FVarId`s of a function parameter in the function's signature and body
- Chains of helper definitions like those created for do-reassignment `x := e`
- Overlapping definitions like those defined by `where` declarations that define both an FVar
  (for local usage) and a constant (for non-local usage)
- Identifiers connected by `FVarAliasInfo` such as variables before and after `match` generalization

In the first three cases that are not explicitly denoted as aliases with an `FVarAliasInfo`, the
corresponding `Reference`s have the exact same range.
This function finds all definitions that have the exact same range as another definition or usage
and collapses them into a single identifier. It also collapses identifiers connected by
an `FVarAliasInfo`.
When collapsing identifiers, it prefers using a `RefIdent.const name` over a `RefIdent.fvar id` for
all identifiers that are being collapsed into one.
-/
partial def combineIdents (trees : Array InfoTree) (refs : Array Reference) : Array Reference 
goal: Array Lean.Server.Reference

full_name: Lean.Server.dedupReferences
code: /--
Groups `refs` by identifier and range s.t. references with the same identifier and range
are added to the `aliases` of the representative of the group.
Yields to separate groups for declaration and usages if `allowSimultaneousBinderUse` is set.
-/
def dedupReferences (refs : Array Reference) (allowSimultaneousBinderUse := false) : Array Reference 
goal: Array Lean.Server.Reference

full_name: Lean.Server.findModuleRefs
code: /--
Finds all references in `trees` and deduplicates the result.
See `dedupReferences` and `combineIdents`.
-/
def findModuleRefs (text : FileMap) (trees : Array InfoTree) (localVars : Bool := true)
    (allowSimultaneousBinderUse := false) : ModuleRefs 
goal: Lean.Server.ModuleRefs

full_name: Lean.Server.References.workers
code: /-- References from ilean files and current ilean information from file workers. -/
structure References where
  /-- References loaded from ilean files -/
  ileans : HashMap Name (System.FilePath × Lsp.ModuleRefs)
  /-- References from workers, overriding the corresponding ilean files -/
  workers : HashMap Name (Nat × Lsp.ModuleRefs)
goal: Lean.HashMap Lean.Name (Nat × Lean.Lsp.ModuleRefs)

full_name: Lean.Server.References.ileans
code: /-- References from ilean files and current ilean information from file workers. -/
structure References where
  /-- References loaded from ilean files -/
  ileans : HashMap Name (System.FilePath × Lsp.ModuleRefs)
  /-- References from workers, overriding the corresponding ilean files -/
  workers : HashMap Name (Nat × Lsp.ModuleRefs)
goal: Lean.HashMap Lean.Name (System.FilePath × Lean.Lsp.ModuleRefs)

full_name: Lean.Server.References
code: /-- References from ilean files and current ilean information from file workers. -/
structure References where
  /-- References loaded from ilean files -/
  ileans : HashMap Name (System.FilePath × Lsp.ModuleRefs)
  /-- References from workers, overriding the corresponding ilean files -/
  workers : HashMap Name (Nat × Lsp.ModuleRefs)
goal: Type

full_name: Lean.Server.References.empty
code: /-- No ilean files, no information from workers. -/
def empty : References 
goal: Lean.Server.References

full_name: Lean.Server.References.addIlean
code: /-- Adds the contents of an ilean file `ilean` at `path` to `self`. -/
def addIlean (self : References) (path : System.FilePath) (ilean : Ilean) : References 
goal: Lean.Server.References

full_name: Lean.Server.References.removeIlean
code: /-- Removes the ilean file data at `path` from `self`. -/
def removeIlean (self : References) (path : System.FilePath) : References 
goal: Lean.Server.References

full_name: Lean.Server.References.updateWorkerRefs
code: /--
Updates the worker references in `self` with the `refs` of the worker managing the module `name`.
Replaces the current references with `refs` if `version` is newer than the current version managed
in `refs` and otherwise merges the reference data if `version` is equal to the current version.
-/
def updateWorkerRefs (self : References) (name : Name) (version : Nat) (refs : Lsp.ModuleRefs) : References 
goal: Lean.Server.References

full_name: Lean.Server.References.finalizeWorkerRefs
code: /--
Replaces the worker references in `self` with the `refs` of the worker managing the module `name`
if `version` is newer than the current version managed in `refs`.
-/
def finalizeWorkerRefs (self : References) (name : Name) (version : Nat) (refs : Lsp.ModuleRefs) : References 
goal: Lean.Server.References

full_name: Lean.Server.References.removeWorkerRefs
code: /-- Erases all worker references in `self` for the worker managing `name`. -/
def removeWorkerRefs (self : References) (name : Name) : References 
goal: Lean.Server.References

full_name: Lean.Server.References.allRefs
code: /-- Yields a map from all modules to all of their references. -/
def allRefs (self : References) : HashMap Name Lsp.ModuleRefs 
goal: Lean.HashMap Lean.Name Lean.Lsp.ModuleRefs

full_name: Lean.Server.References.allRefsFor
code: /--
Yields all references in `self` for `ident`, as well as the `DocumentUri` that each
reference occurs in.
-/
def allRefsFor
    (self          : References)
    (srcSearchPath : SearchPath)
    (ident         : RefIdent)
    : IO (Array (DocumentUri × Lsp.RefInfo)) 
goal: IO (Array (Lean.Lsp.DocumentUri × Lean.Lsp.RefInfo))

full_name: Lean.Server.References.findAt
code: /-- Yields all references in `module` at `pos`. -/
def findAt (self : References) (module : Name) (pos : Lsp.Position) (includeStop := false) : Array RefIdent 
goal: Array Lean.Lsp.RefIdent

full_name: Lean.Server.References.findRange?
code: /-- Yields the first reference in `module` at `pos`. -/
def findRange? (self : References) (module : Name) (pos : Lsp.Position) (includeStop := false) : Option Range 
goal: Option Lean.Lsp.Range

full_name: Lean.Server.References.DocumentRefInfo.location
code: /-- Location and parent declaration of a reference. -/
structure DocumentRefInfo where
  /-- Location of the reference. -/
  location    : Location
  /-- Parent declaration of the reference. -/
  parentInfo? : Option RefInfo.ParentDecl
goal: Lean.Lsp.Location

full_name: Lean.Server.References.DocumentRefInfo
code: /-- Location and parent declaration of a reference. -/
structure DocumentRefInfo where
  /-- Location of the reference. -/
  location    : Location
  /-- Parent declaration of the reference. -/
  parentInfo? : Option RefInfo.ParentDecl
goal: Type

full_name: Lean.Server.References.DocumentRefInfo.parentInfo?
code: /-- Location and parent declaration of a reference. -/
structure DocumentRefInfo where
  /-- Location of the reference. -/
  location    : Location
  /-- Parent declaration of the reference. -/
  parentInfo? : Option RefInfo.ParentDecl
goal: Option Lean.Lsp.RefInfo.ParentDecl

full_name: Lean.Server.References.referringTo
code: /-- Yields locations and parent declaration for all references referring to `ident`. -/
def referringTo
    (self              : References)
    (srcSearchPath     : SearchPath)
    (ident             : RefIdent)
    (includeDefinition : Bool := true)
    : IO (Array DocumentRefInfo) 
goal: IO (Array Lean.Server.References.DocumentRefInfo)

full_name: Lean.Server.References.definitionOf?
code: /-- Yields the definition location of `ident`. -/
def definitionOf?
    (self          : References)
    (ident         : RefIdent)
    (srcSearchPath : SearchPath)
    : IO (Option DocumentRefInfo) 
goal: IO (Option Lean.Server.References.DocumentRefInfo)

full_name: Lean.Server.References.definitionsMatching
code: /-- Yields all definitions matching the given `filter`. -/
def definitionsMatching
    (self          : References)
    (srcSearchPath : SearchPath)
    (filter        : Name → Option α)
    (maxAmount?    : Option Nat := none) : IO $ Array (α × Location) 
goal: IO (Array (α × Lean.Lsp.Location))