Loading lib/jsduck/doc_ast.rb +1 −13 Original line number Diff line number Diff line Loading @@ -63,7 +63,6 @@ module JsDuck :doc => detect_doc(docs), :params => detect_params(doc_map), :return => detect_return(doc_map), :throws => detect_throws(doc_map), }, doc_map) end Loading Loading @@ -245,17 +244,6 @@ module JsDuck } end def detect_throws(doc_map) return unless doc_map[:throws] doc_map[:throws].map do |throws| { :type => throws[:type] || "Object", :doc => throws[:doc] || "", } end end def detect_enum(doc_map) return nil unless extract(doc_map, :class, :enum) Loading @@ -271,7 +259,7 @@ module JsDuck # Combines :doc-s of most tags # Ignores tags that have doc comment themselves and subproperty tags def detect_doc(docs) ignore_tags = [:param, :return, :throws] + TagRegistry.multiliners.map {|t| t.key } ignore_tags = [:param, :return] + TagRegistry.multiliners.map {|t| t.key } doc_tags = docs.find_all { |tag| !ignore_tags.include?(tag[:tagname]) && !subproperty?(tag) } doc_tags.map { |tag| tag[:doc] }.compact.join(" ") end Loading lib/jsduck/tag/throws.rb +11 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ module JsDuck::Tag class Throws < Tag def initialize @pattern = "throws" @key = :throws @multiline = true end # @throws {Type} ... Loading @@ -11,5 +13,14 @@ module JsDuck::Tag p.add_tag(:throws) p.maybe_type end def process_doc(tags) tags.map do |throws| { :type => throws[:type] || "Object", :doc => throws[:doc] || "", } end end end end Loading
lib/jsduck/doc_ast.rb +1 −13 Original line number Diff line number Diff line Loading @@ -63,7 +63,6 @@ module JsDuck :doc => detect_doc(docs), :params => detect_params(doc_map), :return => detect_return(doc_map), :throws => detect_throws(doc_map), }, doc_map) end Loading Loading @@ -245,17 +244,6 @@ module JsDuck } end def detect_throws(doc_map) return unless doc_map[:throws] doc_map[:throws].map do |throws| { :type => throws[:type] || "Object", :doc => throws[:doc] || "", } end end def detect_enum(doc_map) return nil unless extract(doc_map, :class, :enum) Loading @@ -271,7 +259,7 @@ module JsDuck # Combines :doc-s of most tags # Ignores tags that have doc comment themselves and subproperty tags def detect_doc(docs) ignore_tags = [:param, :return, :throws] + TagRegistry.multiliners.map {|t| t.key } ignore_tags = [:param, :return] + TagRegistry.multiliners.map {|t| t.key } doc_tags = docs.find_all { |tag| !ignore_tags.include?(tag[:tagname]) && !subproperty?(tag) } doc_tags.map { |tag| tag[:doc] }.compact.join(" ") end Loading
lib/jsduck/tag/throws.rb +11 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ module JsDuck::Tag class Throws < Tag def initialize @pattern = "throws" @key = :throws @multiline = true end # @throws {Type} ... Loading @@ -11,5 +13,14 @@ module JsDuck::Tag p.add_tag(:throws) p.maybe_type end def process_doc(tags) tags.map do |throws| { :type => throws[:type] || "Object", :doc => throws[:doc] || "", } end end end end