A Go-To-Module widget #
This file defines:
goToModule, a clickable widget bringing the user to a given module (at a customizable position and with customizable visible text)goToModuleOfDecls/goToModuleOfDecl, the same for bringing the user to the position before or after declarations from a (single) module, as specified
Tries to resolve the module modName to a source file URI.
This has to be done in the Lean server
since the Environment does not keep track of source URIs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Widget props for ImportGraph.Widget.GoToModule.
- modName : Lean.Name
- pos : Lean.Lsp.Position
Instances For
Equations
- One or more equations did not get rendered due to their size.
A position past the end of any file, assuming no file has more than 4294967296 lines.
Equations
- ImportGraph.Widget.pastEndOfFile = { line := 1 <<< 32, character := 0 }
Instances For
Creates a clickable link which takes the user to the provided module.
By default, takes the user to the top of the module. Providing pos will bring the user to that
position in the file.
By default, the module name is used as the link's text. The text can be overridden by providing
overrideText.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gets the latest-ending range among all declarations, or none if none could be found.
Assumes all declarations come from the same module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gets the earliest-starting range among all declarations, or none if none could be found.
Assumes all declarations come from the same module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Where the cursor should end up relative to given range(s) after a go-to-module.
- start
(lineBefore : Bool := true)
: RelativeRangeLocation
Places the cursor by default on the line before the range(s). If
lineBefore := false, places the cursor just at the start of the range(s). - end
(lineAfter : Bool := true)
: RelativeRangeLocation
Places the cursor by default on the line after the range(s). If
lineAfter := false, places the cursor just at the end of the range(s).
Instances For
Goes to either before or after all of the ranges of all provided decls. The location the cursor
ends up may be specified by setting location:
.end (lineAfter := true)(the default): go the first character of the line after the range of the last declaration..end (lineAfter := false): place the cursor at the end of the range of the last declaration..start (lineBefore := true): place the cursor on the line before the first declaration..start (lineBefore := false): place the cursor at the beginning of the range of the first declaration.
(We use the full range, including e.g. the body of the declaration.)
Errors if no decl has a module and fallBackModule is not specified.
Ignores declarations with no position information (such as autogenerated declarations). If a module
is found but no range can be found, goes to the end or beginning of the module, according to
location.
Errors if not all declarations come from the same module.
By default, the link text is the name of decl's module. The text can be overridden with
overrideText.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Goes to either before or after the range of the provided decl. The location the cursor
ends up may be specified by setting location:
.end (lineAfter := true)(the default): go the first character of the line of the declaration..end (lineAfter := false): place the cursor at the end of the range of the declaration..start (lineBefore := true): place the cursor on the line before the declaration..start (lineBefore := false): place the cursor at the beginning of the range of the declaration.
(We use the full range, including e.g. the body of the declaration.)
Errors if decl has no module.
If the declaration has a module but no range can be found, goes to the end or beginning of the
module, according to location.
Errors if not all declarations come from the same module.
By default, the link text is the name of decl's module. The text can be overridden with
overrideText.
Equations
- ImportGraph.Widget.goToModuleOfDecl decl location overrideText = ImportGraph.Widget.goToModuleOfDecls #[decl] location none overrideText