- pos : Lean.Position
A precomputed UTF-16
character
field as inLean.Lsp.Position
. We need to store this because LSP clients want us to report the range in terms of UTF-16, but converting a Unicode codepoint stored inLean.Position
to UTF-16 requires loading and mapping the target source file, which is IO-heavy.charUtf16 : Nat- endPos : Lean.Position
See
charUtf16
.endCharUtf16 : Nat
Equations
- Lean.instInhabitedDeclarationRange = { default := { pos := default, charUtf16 := default, endPos := default, endCharUtf16 := default } }
Equations
- Lean.instReprDeclarationRange = { reprPrec := [anonymous] }
Equations
- One or more equations did not get rendered due to their size.
- range : Lean.DeclarationRange
- selectionRange : Lean.DeclarationRange
Equations
- Lean.instInhabitedDeclarationRanges = { default := { range := default, selectionRange := default } }
Equations
- Lean.instReprDeclarationRanges = { reprPrec := [anonymous] }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.addBuiltinDeclarationRanges declName declRanges = ST.Ref.modify Lean.builtinDeclRanges fun a => Lean.NameMap.insert a declName declRanges
def
Lean.addDeclarationRanges
{m : Type → Type}
[inst : Lean.MonadEnv m]
(declName : Lean.Name)
(declRanges : Lean.DeclarationRanges)
:
m Unit
Equations
- Lean.addDeclarationRanges declName declRanges = Lean.modifyEnv fun env => Lean.MapDeclarationExtension.insert Lean.declRangeExt env declName declRanges
def
Lean.findDeclarationRangesCore?
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadEnv m]
(declName : Lean.Name)
:
Equations
- Lean.findDeclarationRangesCore? declName = do let a ← Lean.getEnv pure (Lean.MapDeclarationExtension.find? Lean.declRangeExt a declName)
def
Lean.findDeclarationRanges?
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadEnv m]
[inst : MonadLiftT IO m]
(declName : Lean.Name)
:
Equations
- One or more equations did not get rendered due to their size.