def insert_depended_snippets!(inserter, snippet, context, tag)
      raise "must be passed snippet" unless snippet.is_a?(Snippet)

      dep_tags = deps_resolver.find(snippet, context, tag)
      dep_tags = sort_dep_tags_by_dep(dep_tags)

      dep_tags.each do |tag_info|
        sub_t = tag_info[:tag]
        sub_c = tag_info[:context]
        resolve_tag_repo_ref! sub_t

        visit(tag) if is_self(sub_t, sub_c)
        next if is_visited(sub_t)

        next_snippet = core.repo_manager.get_snippet(sub_c, sub_t)
        insert_by_tag_and_context! inserter, next_snippet, sub_c, sub_t
      end
    end
def insert_depended_snippets!(inserter, snippet, context, tag)
      raise "must be passed snippet" unless snippet.is_a?(Snippet)

      dep_tags = deps_resolver.find(snippet, context, tag)
      dep_tags = sort_dep_tags_by_dep(dep_tags)

      dep_tags.each do |tag_info|
        sub_t = tag_info[:tag]
        sub_c = tag_info[:context]
        resolve_tag_repo_ref! sub_t

        visit(tag) if is_self(sub_t, sub_c)
        next if is_visited(sub_t)

        next_snippet = core.repo_manager.get_snippet(sub_c, sub_t)
        insert_by_tag_and_context! inserter, next_snippet, sub_c, sub_t
      end
    end
Insert depended snippet