Documentation

Lean.Server.CodeActions.Basic

A code action optionally supporting a lazy code action computation that is only run when the user clicks on the code action in the editor.

If you want to use the lazy feature, make sure that the edit? field on the eager code action result is none.

Instances For

    Passed as the data? field of Lsp.CodeAction to recover the context of the code action.

    • providerName : Lake.Name

      Name of CodeActionProvider that produced this request.

    • providerResultIndex : Nat

      Index in the list of code action that the given provider generated.

    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        A code action provider is a function for providing LSP code actions for an editor. You can register them with the @[code_action_provider] attribute.

        This is a low-level interface for making LSP code actions. This interface can be used to implement the following applications:

        • refactoring code: adding underscores to unused variables,
        • suggesting imports
        • document-level refactoring: removing unused imports, sorting imports, formatting.
        • Helper suggestions for working with type holes (_)
        • Helper suggestions for tactics.

        When implementing your own CodeActionProvider, we assume that no long-running computations are allowed. If you need to create a code-action with a long-running computation, you can use the lazy? field on LazyCodeAction to perform the computation after the user has clicked on the code action in their editor.

        Equations
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Handles a textDocument/codeAction request.

            This is implemented by calling all of the registered CodeActionProvider functions.

            reference.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Handler for "codeAction/resolve".

              reference

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For