Documentation

Lean.Linter.Deprecated

Instances For

    Creates a hint for a missing (since := "...") clause that offers to append one with the current date to the deprecation syntax stx. Returns the empty message if stx has no source position.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Lean.Linter.setDeprecated {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (declName : Name) (entry : DeprecationEntry) :
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Lean.Linter.isDeprecated (env : Environment) (declName : Name) :
        Equations
        Instances For
          Equations
          Instances For
            Equations
            Instances For

              How a deprecation warning for a constant with a replacement suggests switching to the replacement. Suggestions are only made when the replacement has the same type as the deprecated constant.

              • none : DeprecationHint

                No suggestion.

              • ident : DeprecationHint

                If the current ref is an identifier that resolves to the deprecated constant, offers to replace it with the shortest name that resolves to the replacement.

              • custom (mk : Name → MetaM MessageData) : DeprecationHint

                Appends the message computed from the name of the replacement, such as a hint for syntax other than a plain identifier, or a note explaining why no hint is offered.

              Instances For

                Creates a hint that offers to replace ref by replacement. Returns the empty message if ref has no source position.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  def Lean.Linter.mkIdentHint (declName newName : Name) :

                  Creates the hint offered by DeprecationHint.ident: if the current ref is an identifier that resolves to declName, offers to replace it with the shortest name that resolves to newName.

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

                    Reports a use of declName at the current ref if it is deprecated. Callers should usually use checkDeprecatedAt, which respects Core.Context.checkDeprecated.

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

                      Reports a use of declName at ref if it is deprecated, unless deprecation checks are disabled at ref (see Core.Context.checkDeprecated).

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

                        Creates a suggestion that removes elems[i] from the list elems in the source of whole, together with the separator after it, or before it if it is the last element. If it is the only element, the suggestion removes whole instead. Returns none if any of the syntax has no position in the current file.

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

                          Reports that declName is deprecated but tagged with attrName at ref, where attrName adds declarations to a set used by automation (see isAutomationAttr). Automation uses such declarations without a deprecation warning, so the hint offers removal? to remove the attribute.

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