Representing collected and deduplicated definitions and usages #
- ident : Lean.Lsp.RefIdent
- aliases : Array Lean.Lsp.RefIdent
FVarIds that are logically identical to this reference
- range : Lean.Lsp.Range
- stx : Lean.Syntax
- info : Lean.Elab.Info
- isBinder : Bool
Instances For
- definition : Option Lean.Server.Reference
- usages : Array Lean.Server.Reference
Instances For
Equations
- Lean.Server.RefInfo.empty = { definition := none, usages := #[] }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Equations
- Lean.Server.ModuleRefs.addRef self ref = let refInfo := Lean.HashMap.findD self ref.ident Lean.Server.RefInfo.empty; Lean.HashMap.insert self ref.ident (Lean.Server.RefInfo.addRef refInfo ref)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Lsp.RefInfo.empty = { definition? := none, usages := #[] }
Instances For
Equations
- Lean.Lsp.RefInfo.merge a b = { definition? := Option.orElse b.definition? fun (x : Unit) => a.definition?, usages := Array.append a.usages b.usages }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- Lean.Lsp.RefInfo.contains self pos includeStop = Id.run (Option.isSome (Lean.Lsp.RefInfo.findRange? self pos includeStop))
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Content of individual .ilean
files
- version : Nat
- module : Lake.Name
- references : Lean.Lsp.ModuleRefs
Instances For
Equations
- Lean.Server.instFromJsonIlean = { fromJson? := Lean.Server.fromJsonIlean✝ }
Equations
- Lean.Server.instToJsonIlean = { toJson := Lean.Server.toJsonIlean✝ }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Collecting and deduplicating definitions and usages #
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
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 aftermatch
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.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Collecting and maintaining reference info from different sources #
- ileans : Lean.HashMap Lake.Name (Lake.FilePath × Lean.Lsp.ModuleRefs)
References loaded from ilean files
- workers : Lean.HashMap Lake.Name (Nat × Lean.Lsp.ModuleRefs)
References from workers, overriding the corresponding ilean files
Instances For
Equations
- Lean.Server.References.empty = { ileans := Lean.HashMap.empty, workers := Lean.HashMap.empty }
Instances For
Equations
- Lean.Server.References.addIlean self path ilean = { ileans := Lean.HashMap.insert self.ileans ilean.module (path, ilean.references), workers := self.workers }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Server.References.removeWorkerRefs self name = { ileans := self.ileans, workers := Lean.HashMap.erase self.workers name }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Server.References.findRange? self module pos includeStop = do let refs ← Lean.HashMap.find? (Lean.Server.References.allRefs self) module Lean.Lsp.ModuleRefs.findRange? refs pos includeStop
Instances For
- location : Lean.Lsp.Location
- parentInfo? : Option Lean.Lsp.RefInfo.ParentDecl
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.