Documentation

Batteries.Util.Incremental

A utility for simple incremental commands #

A snapshot for the result of command elaboration

Instances For

    The snapshot type for simpleIncrementalElab

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

      Wraps cmd with simple incrementality handling that makes the command not re-run if only trailing whitespace was changed or when a syntax error gets introduced and then removed again.

      To make this work, cmd doesn't receive the trailing whitespace of the command and doesn't have access to incrementality itself.

      To make use of this, you have to write an explicit elaborator (i.e. a declaration with a @[command_elab]) and tag it with @[incremental] and then wrap the body in simpleIncrementalElab. Example:

      syntax (name := expensiveCmd) "#expensive_command" : command
      
      @[command_elab expensiveCmd, incremental]
      def elabExpensiveCmd : CommandElab := simpleIncrementalElab fun stx => do
        ...
      
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For