%a{annotate:rdoc:skip}
module RDoc
  # <!-- rdoc-file=lib/rdoc/code_object.rb -->
  # Base class for the RDoc code tree.
  #
  # We contain the common stuff for contexts (which are containers) and other
  # elements (methods, attributes and so on)
  #
  # Here's the tree of the CodeObject subclasses:
  #
  # *   RDoc::Context
  #     *   RDoc::TopLevel
  #     *   RDoc::ClassModule
  #         *   RDoc::AnonClass (never used so far)
  #         *   RDoc::NormalClass
  #         *   RDoc::NormalModule
  #         *   RDoc::SingleClass
  # *   RDoc::MethodAttr
  #     *   RDoc::Attr
  #     *   RDoc::AnyMethod
  #         *   RDoc::GhostMethod
  #         *   RDoc::MetaMethod
  # *   RDoc::Alias
  # *   RDoc::Constant
  # *   RDoc::Mixin
  #     *   RDoc::Require
  #     *   RDoc::Include
  #
  class CodeObject
    # <!-- rdoc-file=lib/rdoc/code_object.rb -->
    # Our comment
    #
    attr_reader comment: Markup::Document | Comment | String

    # <!--
    #   rdoc-file=lib/rdoc/code_object.rb
    #   - new()
    # -->
    # Creates a new CodeObject that will document itself and its children
    #
    def initialize: () -> void

    # <!--
    #   rdoc-file=lib/rdoc/code_object.rb
    #   - comment=(comment)
    # -->
    # Replaces our comment with `comment`, unless it is empty.
    #
    def comment=: (Markup::Document | Comment | String | nil) -> (Markup::Document | Comment | String)
  end
end
