Documentation

ImportGraph.WorkspaceModel.Summary.Core

Transporting a Lake workspace summary over Json #

This file defines WorkspaceSummary for summarizing a Lake workspace and getWorkspaceSummary for transporting the bare minimum over a process boundary. (This is then used to compute a WorkspaceModel, including import hierarchy data, with getWorkspaceModel from ImportGraph.WorkspaceModel.Build.)

The motivation for this is the need to inspect the broader import hierarchy and lake workspace from within the language server. However, loading the lake workspace from within the lake language server causes a crash, so we must call out to an exe (import-graph-workspace-summary) across a process boundary, and have it send back this data as json, which we then use (within the language server) to compute the much richer WorkspaceModel.

getWorkspaceSummary also caches the resulting json in the .lake folder to avoid future external calls if possible. Note that the module set is not included in the transported or cached json; these are recomputed from the roots and globs stored in the json.

This shares BaseWorkspace with WorkspaceModel.

@[reducible, inline]

A summary of lean_lib data for transport over Json.

Equations
Instances For

    A summary of a lake package for transport over Json. All paths are absolute.

    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
          • One or more equations did not get rendered due to their size.
          Instances For

            A summary of the lake workspace suitable for transport over Json. This may be obtained with getWorkspaceSummary and enriched into a model of the workspace and its intradependencies via getWorkspaceModel.

            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
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    The name of the executable with root ImportGraph.WorkspaceModel.Emit. Should be synchronized with the lakefile.

                    Equations
                    Instances For

                      The "obvious" lakeDir given a workspace directory. TODO: Really, we ought to read this off of the lakeDir field from the lake-manifest.json instead of just trying to append .lake.

                      Equations
                      Instances For

                        A (new) folder in the given .lake directory for storing import graph data.

                        Equations
                        Instances For

                          The directory in which the cache lives. This is currently importGraphBuildDirPath := .lake/importGraph/, a directory exclusively for special import graph data such as the workspace summary cache.

                          Equations
                          Instances For

                            Given a special-purpose build folder in the lake directory, the path to workspace-summary.json, where we cache the workspace summary.

                            Equations
                            Instances For