code: def add_target_and_index(self, name, sig, signode):
          
          full_name = name[0]
          target_name = '{0}-{1}'.format(self.short_name, full_name)
          if target_name not in self.state.document.ids:
              signode['names'].append(target_name)
              signode['ids'].append(target_name)
              signode['first'] = not self.names
              self.state.document.note_explicit_target(signode)
  
              # Update domain objects
              objects = self.env.domaindata['dn']['objects']
              try:
                  found_obj = objects[full_name]
                  (found_doc, found_type) = found_obj
                  self.state_machine.reporter.warning(
                      ('duplicate object definition of {obj_type} {obj_name}'
                       'other instance in {path}'
                       .format(obj_type=found_type, obj_name=full_name,
                               path=self.env.doc2path(found_doc))),
                      line=self.lineno)
              except KeyError:
                  pass
              finally:
                  objects[full_name] = (self.env.docname, self.objtype)
  
          index_text = self.get_index_text(None, name)
          if index_text:
              entry = ('single', index_text, full_name, '')
              if SPHINX_VERSION_14:
                  entry = ('single', index_text, full_name, '', None)
              self.indexnode['entries'].append(entry)
docs: Add objects to the domain list of objects
  
          This uses the directive short name along with the full object name to
          create objects and nodes that are type and name unique.