Documentation

Lean.Data.Lsp.Internal

This file contains types for communication between the watchdog and the workers. These messages are not visible externally to users of the LSP server.

Most reference-related types have custom FromJson/ToJson implementations to reduce the size of the resulting JSON.

Information about a single import statement.

  • module : String

    Name of the module that is imported.

  • isPrivate : Bool

    Whether the module is being imported via private import.

  • isAll : Bool

    Whether the module is being imported via import all.

  • isMeta : Bool

    Whether the module is being imported via meta import.

Instances For

    Identifier of a reference.

    • const (moduleName identName : String) : RefIdent

      Named identifier. These are used in all references that are globally available.

    • fvar (moduleName id : String) : RefIdent

      Unnamed identifier. These are used for all local references.

    Instances For
      Equations
        Instances For

          Shortened representation of RefIdent for more compact serialization.

          Instances For

            Converts id to its compact serialization representation.

            Equations
              Instances For

                Converts repr to RefIdent.

                Equations
                  Instances For

                    Converts RefIdent from a JSON for RefIdentJsonRepr.

                    Equations
                      Instances For

                        Converts RefIdent to a JSON for RefIdentJsonRepr.

                        Equations
                          Instances For

                            Position information for a declaration. Inlined to reduce memory consumption.

                            • rangeStartPosLine : Nat

                              Start line of range.

                            • rangeStartPosCharacter : Nat

                              Start character of range.

                            • rangeEndPosLine : Nat

                              End line of range.

                            • rangeEndPosCharacter : Nat

                              End character of range.

                            • selectionRangeStartPosLine : Nat

                              Start line of selection range.

                            • selectionRangeStartPosCharacter : Nat

                              Start character of selection range.

                            • selectionRangeEndPosLine : Nat

                              End line of selection range.

                            • selectionRangeEndPosCharacter : Nat

                              End character of selection range.

                            Instances For

                              Converts a set of DeclarationRanges to a DeclInfo.

                              Equations
                                Instances For

                                  Range of this parent decl.

                                  Equations
                                    Instances For

                                      Selection range of this parent decl.

                                      Equations
                                        Instances For

                                          Declarations of a file with associated position information.

                                          Equations
                                            Instances For

                                              Denotes the range of a reference, as well as the parent declaration of the reference. If the reference is itself a declaration, then it contains no parent declaration. The position information is inlined to reduce memory consumption.

                                              • mk' :: (
                                                • startPosLine : Nat

                                                  Start line of the range of this location.

                                                • startPosCharacter : Nat

                                                  Start character of the range of this location.

                                                • endPosLine : Nat

                                                  End line of the range of this location.

                                                • endPosCharacter : Nat

                                                  End character of the range of this location.

                                                • parentDecl : String

                                                  Parent declaration of the reference. Empty string if the reference is itself a declaration. We do not use Option for memory consumption reasons.

                                              • )
                                              Instances For

                                                Creates a RefInfo.Location.

                                                Equations
                                                  Instances For

                                                    Range of this location.

                                                    Equations
                                                      Instances For

                                                        Name of the parent declaration of this location.

                                                        Equations
                                                          Instances For

                                                            Definition site and usage sites of a reference. Obtained from Lean.Server.RefInfo.

                                                            • definition? : Option Location

                                                              Definition site of the reference. May be none when we cannot find a definition site.

                                                            • usages : Array Location

                                                              Usage sites of the reference.

                                                            Instances For

                                                              References from a single module/file

                                                              Equations
                                                                Instances For

                                                                  Used in the $/lean/ileanHeaderInfo watchdog <- worker notifications. Contains the direct imports of the file managed by a worker.

                                                                  • version : Nat

                                                                    Version of the file these imports are from.

                                                                  • directImports : Array ImportInfo

                                                                    Direct imports of this file.

                                                                  Instances For

                                                                    Used in the $/lean/ileanHeaderSetupInfo watchdog <- worker notifications. Contains status information about lake setup-file.

                                                                    • version : Nat

                                                                      Version of the file these imports are from.

                                                                    • isSetupFailure : Bool

                                                                      Whether setting up the header using lake setup-file has failed.

                                                                    Instances For

                                                                      Used in the $/lean/ileanInfoUpdate and $/lean/ileanInfoFinal watchdog <- worker notifications. Contains the definitions and references of the file managed by a worker.

                                                                      • version : Nat

                                                                        Version of the file these references are from.

                                                                      • references : ModuleRefs

                                                                        All references for the file.

                                                                      • decls : Decls

                                                                        All decls for the file.

                                                                      Instances For

                                                                        Used in the $/lean/importClosure watchdog <- worker notification. Contains the full import closure of the file managed by a worker.

                                                                        Instances For

                                                                          Used in the $/lean/importClosure watchdog -> worker notification. Informs the worker that one of its dependencies has gone stale and likely needs to be rebuilt.

                                                                          • staleDependency : DocumentUri

                                                                            The dependency that is stale.

                                                                          Instances For

                                                                            LSP type for Lean.OpenDecl.

                                                                            • allExcept («namespace» : Name) (exceptions : Array Name) : OpenNamespace

                                                                              All declarations in «namespace» are opened, except for exceptions.

                                                                            • renamed («from» to : Name) : OpenNamespace

                                                                              The declaration «from» is renamed to to.

                                                                            Instances For

                                                                              Query in the $/lean/queryModule watchdog <- worker request.

                                                                              • identifier : String

                                                                                Identifier (potentially partial) to query.

                                                                              • openNamespaces : Array OpenNamespace

                                                                                Namespaces that are open at the position of identifier. Used for accurately matching declarations against identifier in context.

                                                                              Instances For

                                                                                Used in the $/lean/queryModule watchdog <- worker request, which is used by the worker to extract information from the .ilean information in the watchdog.

                                                                                • sourceRequestID : JsonRpc.RequestID

                                                                                  The request ID in the context of which this worker -> watchdog request was emitted. Used for cancelling this request in the watchdog.

                                                                                • Module queries for extracting .ilean information in the watchdog.

                                                                                Instances For

                                                                                  Result entry of a module query.

                                                                                  • module : Name

                                                                                    Module that decl is defined in.

                                                                                  • decl : Name

                                                                                    Full name of the declaration that matches the query.

                                                                                  • isExactMatch : Bool

                                                                                    Whether this decl matched the query exactly.

                                                                                  Instances For
                                                                                    @[reducible, inline]

                                                                                    Result for a single module query. Identifiers in the response are sorted descendingly by how well they match the query.

                                                                                    Equations
                                                                                      Instances For

                                                                                        Response for the $/lean/queryModule watchdog <- worker request.

                                                                                        Instances For

                                                                                          Name of a declaration in a given module.

                                                                                          • module : Name

                                                                                            Name of the module that this identifier is in.

                                                                                          • decl : Name

                                                                                            Name of the declaration.

                                                                                          Instances For