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

Print subproperty warnings inside Tag::Param.

To achieve this, all #process_doc method get a third argument - the
position hash {:filename, :linenr}.

I considered several other options for passing this information
to the #process_doc method, but adding an instance variable for
all the tag classes didn't seem like a right way to go.
parent 3f72b80e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -103,9 +103,11 @@ module JsDuck

      # Detects properties common for each doc-object and adds them
      def add_shared(hash, doc_map)
        position = {:filename => @filename, :linenr => @linenr}

        doc_map.each_pair do |key, value|
          if tag = TagRegistry.get_by_key(key)
            tag.process_doc(hash, value)
            tag.process_doc(hash, value, position)
          end
        end

+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ module JsDuck::Tag
      }
    end

    def process_doc(h, tags)
    def process_doc(h, tags, pos)
      h[:aliases] = tags.map {|tag| tag[:name] }
    end

+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ module JsDuck::Tag
      p.hw.look(/\w+/) ? p.ident.to_sym : nil
    end

    def process_doc(h, tags)
    def process_doc(h, tags, pos)
      h[:aside] = tags
    end

+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ module JsDuck::Tag
    end

    # When the tag is found, its value will always be true.
    def process_doc(h, docs)
    def process_doc(h, docs, pos)
      h[@key] = true
    end
  end
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ module JsDuck::Tag
      }
    end

    def process_doc(h, tags)
    def process_doc(h, tags, pos)
      h[:name] = tags[0][:name]
    end
  end
Loading