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
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.
Equations
- Lean.Lsp.RefInfo.empty = { definition := none, usages := #[] }
Instances For
Equations
- Lean.Lsp.RefInfo.merge a b = { definition := Option.orElse b.definition fun x => 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
- One or more equations did not get rendered due to their size.
Instances For
- version : Nat
- module : Lake.Name
- references : Lean.Lsp.ModuleRefs
Content of individual .ilean
files
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
def
Lean.Server.combineFvars
(trees : Array Lean.Elab.InfoTree)
(refs : Array Lean.Server.Reference)
:
The FVarId
s of a function parameter in the function's signature and body
differ. However, they have TermInfo
nodes with binder := true
in the exact
same position. Moreover, macros such as do-reassignment x := e
may create
chains of variable definitions where a helper definition overlaps with a use
of a variable.
This function changes every such group to use a single FVarId
(the head of the
chain/DAG) and gets rid of duplicate definitions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
partial def
Lean.Server.combineFvars.findCanonicalBinder
(idMap : Lean.HashMap Lean.FVarId Lean.FVarId)
(id : Lean.FVarId)
:
Equations
- Lean.Server.combineFvars.applyIdMap x x = match x, x with | m, Lean.Lsp.RefIdent.fvar id => Lean.Lsp.RefIdent.fvar (Lean.Server.combineFvars.findCanonicalBinder m id) | x, ident => ident
Instances For
def
Lean.Server.combineFvars.buildIdMap
(trees : Array Lean.Elab.InfoTree)
(refs : Array Lean.Server.Reference)
(posMap : Lean.HashMap Lean.Lsp.Range Lean.FVarId)
:
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
def
Lean.Server.dedupReferences
(refs : Array Lean.Server.Reference)
(allowSimultaneousBinderUse : optParam Bool false)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.Server.findModuleRefs
(text : Lean.FileMap)
(trees : Array Lean.Elab.InfoTree)
(localVars : optParam Bool true)
(allowSimultaneousBinderUse : optParam Bool false)
:
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
def
Lean.Server.References.addIlean
(self : Lean.Server.References)
(path : Lake.FilePath)
(ilean : Lean.Server.Ilean)
:
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
def
Lean.Server.References.updateWorkerRefs
(self : Lean.Server.References)
(name : Lake.Name)
(version : Nat)
(refs : Lean.Lsp.ModuleRefs)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.Server.References.finalizeWorkerRefs
(self : Lean.Server.References)
(name : Lake.Name)
(version : Nat)
(refs : Lean.Lsp.ModuleRefs)
:
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
def
Lean.Server.References.findAt
(self : Lean.Server.References)
(module : Lake.Name)
(pos : Lean.Lsp.Position)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.Server.References.referringTo
(self : Lean.Server.References)
(identModule : Lake.Name)
(ident : Lean.Lsp.RefIdent)
(srcSearchPath : Lean.SearchPath)
(includeDefinition : optParam Bool true)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.Server.References.definitionOf?
(self : Lean.Server.References)
(ident : Lean.Lsp.RefIdent)
(srcSearchPath : Lean.SearchPath)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.Server.References.definitionsMatching
{α : Type}
(self : Lean.Server.References)
(srcSearchPath : Lean.SearchPath)
(filter : Lake.Name → Option α)
(maxAmount? : optParam (Option Nat) none)
:
IO (Array (α × Lean.Lsp.Location))
Equations
- One or more equations did not get rendered due to their size.