def
Lean.Server.Completion.findCompletionInfosAt
(fileMap : Lean.FileMap)
(hoverPos : String.Pos)
(cmdStx : Lean.Syntax)
(infoTree : Lean.Elab.InfoTree)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.Server.Completion.findCompletionInfosAt.go
(fileMap : Lean.FileMap)
(hoverPos : String.Pos)
(hoverLine : Nat)
(ctx : Lean.Elab.ContextInfo)
(info : Lean.Elab.Info)
(best : Array Lean.Server.Completion.ContextualizedCompletionInfo)
:
Equations
- One or more equations did not get rendered due to their size.
- Lean.Server.Completion.findCompletionInfosAt.go fileMap hoverPos hoverLine ctx info best = (pure best).run
Instances For
def
Lean.Server.Completion.findPrioritizedCompletionPartitionsAt
(fileMap : Lean.FileMap)
(hoverPos : String.Pos)
(cmdStx : Lean.Syntax)
(infoTree : Lean.Elab.InfoTree)
:
Finds all CompletionInfo
s (both from the InfoTree
and synthetic ones), prioritizes them,
arranges them in partitions of CompletionInfo
s with the same priority and sorts these partitions
so that CompletionInfo
s with the highest priority come first.
The returned CompletionInfo
s are also tagged with their index in findCompletionInfosAt
so that
when resolving a CompletionItem
, we can reconstruct which CompletionInfo
it was created from.
In general, the InfoTree
may contain multiple different CompletionInfo
s covering hoverPos
,
and so we need to decide which of these CompletionInfo
s we want to use to show completions to the
user. We choose priorities by the following rules:
- Synthetic completions have the lowest priority since they are only intended as a backup.
- Non-identifier completions have the highest priority since they tend to be much more helpful than identifier completions when available since there are typically way too many of the latter.
- Within the three groups [non-id completions, id completions, synthetic completions],
CompletionInfo
s with a smaller range are considered to be better.
Equations
- One or more equations did not get rendered due to their size.