Commit b5a74aac authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Implement @inheritdoc processing inside Tag class.

parent 0b2bab6a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ module JsDuck::Builtins
  class Inheritdoc < Tag
    def initialize
      @pattern = ["inheritdoc", "inheritDoc"]
      @key = :inheritdoc
    end

    # @inheritdoc class.name#static-type-member
@@ -18,5 +19,9 @@ module JsDuck::Builtins
      p.maybe_ident_chain(:cls)
      p.maybe_member_reference
    end

    def process_doc(docs)
      docs.first
    end
  end
end
+2 −5
Original line number Diff line number Diff line
@@ -130,17 +130,14 @@ module JsDuck

    # Detects properties common for each doc-object and adds them
    def add_shared(hash, doc_map)
      hash.merge!({
        :inheritdoc => extract(doc_map, :inheritdoc),
        :meta => detect_meta(doc_map),
      })

      doc_map.each_pair do |key, value|
        if tag = BuiltinsRegistry.get_by_key(key)
          hash[key] = tag.process_doc(value)
        end
      end

      hash[:meta] = detect_meta(doc_map)

      # copy :private also to main hash
      hash[:private] = hash[:meta][:private] ? true : nil