Moves source after the referenced one

@param {String} sourceName Name of the source to move
@param {String} referenceSourceName Name of the source to be used as a position reference
171282
function (sourceName, referenceSourceName) {
            var sourceToMove,
                sourcePos,
                referenceSourcePos;
            if (!this._sources.every(function (source, index) {
                var name = source.getName();
                if (name === sourceName) {
                    sourceToMove = source;
                    sourcePos = index;
                } else if (name === referenceSourceName) {
                    referenceSourcePos = index;
                }
                return sourcePos === undefined || referenceSourcePos === undefined;
            })) {
                var KEEP_ITEM = 0,
                    REMOVE_ITEM = 1;
                this._sources.splice(sourcePos, REMOVE_ITEM);
                if (sourcePos > referenceSourcePos) {
                    ++referenceSourcePos;
                }
                this._sources.splice(referenceSourcePos, KEEP_ITEM, sourceToMove);
                this._rebuildSourcesIndex();
            }
        }
172464
public function addSource( string $sourceName, ISource $source ) : Translator
   {

      $source->setLocale( $this->_locale );

      $this->_sources[ $sourceName ] = $source;

      return $this;

   }
145292
function addSourceInstanceName(
  { node, getNode, loadNodeContent, actions, createNodeId, reporter },
  pluginOptions
) {
  const { createNodeField } = actions;

  const parent = getNode(node.parent);

  const sourceInstanceName =
    parent && parent.sourceInstanceName ? parent.sourceInstanceName : 'unknown';

  // Add node field
  createNodeField({
    node,
    name: 'sourceName',
    value: sourceInstanceName
  });

  // console.error('adding', sourceInstanceName, node.fields.sourceInstanceName)

  // if (!parent) {
  //   // Node has already been processed.
  //   console.error('Ocular markdown node has no parent', JSON.stringify(node.parent), JSON.stringify(node.sourceInstanceName), node.relativePath);
  //   return;
  // }

  if (parent) {
    addMissingFrontmatter(node, sourceInstanceName);
  }
}
247091
function ReferencedIdentifier(_ref2) {
      */var node = _ref2.node;
      */var scope = _ref2.scope;

      if (node.name === "exports" && !scope.getBinding("exports")) {
        this.hasExports = true;
      }

      if (node.name === "module" && !scope.getBinding("module")) {
        this.hasModule = true;
      }
    }
529637
public static void removeResource(String pResourceName) throws TTException, ResourceNotExistingException {
        ISession session = getSession(pResourceName);
        session.truncate();
    }
1359562
def add_reference(self, source, target, **kwargs):
        
        # Tweak keyword arguments for addReference
        addRef_kw = kwargs.copy()
        addRef_kw.setdefault("referenceClass", self.referenceClass)
        if "schema" in addRef_kw:
            del addRef_kw["schema"]
        uid = api.get_uid(target)
        rc = api.get_tool("reference_catalog")
        # throws IndexError if uid is invalid
        rc.addReference(source, uid, self.relationship, **addRef_kw)
        # link the version of the reference
        self.link_version(source, target)
260297
function highlightSourceAtLocation(
  source: Source,
  location: SourceLocation,
): string {
  const firstLineColumnOffset = source.locationOffset.column - 1;
  const body = whitespace(firstLineColumnOffset) + source.body;

  const lineIndex = location.line - 1;
  const lineOffset = source.locationOffset.line - 1;
  const lineNum = location.line + lineOffset;

  const columnOffset = location.line === 1 ? firstLineColumnOffset : 0;
  const columnNum = location.column + columnOffset;

  const lines = body.split(/\r\n|[\n\r]/g);
  return (
    `${source.name} (${lineNum}:${columnNum})\n` +
    printPrefixedLines([
      // Lines specified like this: ["prefix", "string"],
      [`${lineNum - 1}: `, lines[lineIndex - 1]],
      [`${lineNum}: `, lines[lineIndex]],
      ['', whitespace(columnNum - 1) + '^'],
      [`${lineNum + 1}: `, lines[lineIndex + 1]],
    ])
  );
}
903727
function (name) {
            var result;
            this._sources.every(function (source) {
                if (source.getName() === name) {
                    result = this._update(source);
                    return false;
                }
                return true;
            }, this);
            return result;
        }
869582
public static void addDragSource (
        DragSource source, JComponent comp, boolean autoremove)
    {
        singleton.addSource(source, comp, autoremove);
    }
5057
function handleFindRefs (refsResp) {
            if (!refsResp || !refsResp.references || !refsResp.references.refs) {
                return;
            }

            var inlineWidget = EditorManager.getFocusedInlineWidget(),
                editor = EditorManager.getActiveEditor(),
                refs = refsResp.references.refs,
                type = refsResp.references.type;

            //In case of inline widget if some references are outside widget's text range then don't allow for rename
            if (inlineWidget) {
                var isInTextRange  = !refs.find(function(item) {
                    return (item.start.line < inlineWidget._startLine || item.end.line > inlineWidget._endLine);
                });
                
                if (!isInTextRange) {
                    editor.displayErrorMessageAtCursor(Strings.ERROR_RENAME_QUICKEDIT);
                    return;
                }
            }

            var currentPosition = editor.posFromIndex(refsResp.offset),
                refsArray = refs;
            if (type !== "local") {
                refsArray = refs.filter(function (element) {
                    return isInSameFile(element, refsResp);
                });
            }

            // Finding the Primary Reference in Array
            var primaryRef = refsArray.find(function (element) {
                return ((element.start.line === currentPosition.line || element.end.line === currentPosition.line)
                        && currentPosition.ch <= element.end.ch && currentPosition.ch >= element.start.ch);
            });
            // Setting the primary flag of Primary Refence to true
            primaryRef.primary = true;

            editor.setSelections(refsArray);
        }
595941
public void moveTheData(boolean bDisplayOption, int iMoveType)
    {
        if (m_convCheckMark != null) if (m_bDisableOnMove)
            m_fldDest.setEnabled(!m_convCheckMark.getState());
        if ((m_convCheckMark == null)
            || (m_convCheckMark.getState()))
        {
            if ((this.getSourceField() != null)
                && ((!this.getSourceField().isNull()) || (!m_bDontMoveNullSource)))
                m_fldDest.moveFieldToThis(this.getSourceField(), bDisplayOption, iMoveType);  // Move dependent field to here
            else if (m_strSource != null)
                m_fldDest.setString(m_strSource, bDisplayOption, iMoveType);   // Move dependent field to here
            else if (m_fldDest instanceof ReferenceField)
                ((ReferenceField)m_fldDest).setReference(this.getOwner(), bDisplayOption, iMoveType);
        }
        else
        {
            if (bDisplayOption)
                m_fldDest.displayField();      // Redisplay based on this check mark
        }
    }
1093280
function(source) {
         var src = (source ? source.src : undefined);

         if (this.selectedSrc !== src) {
            this.selectedSrc = src;
            this.update();
         }
      }
767714
function(sources){
      if (!sources)
        sources = {};

      for (var name in this.fields.sources)
        this.setSource(name, sources[name]);

      /** @cut */ for (var name in sources)
      /** @cut */   if (name in this.fields.sources == false)
      /** @cut */     basis.dev.warn('basis.data.object.Merge#setSource: can\'t set source with name `' + name + '` as not specified by fields configuration');
    }
985589
static void copyNameAnnotations(Node source, Node destination) {
    if (source.getBooleanProp(Node.IS_CONSTANT_NAME)) {
      destination.putBooleanProp(Node.IS_CONSTANT_NAME, true);
    }
  }
1371547
public void link(Object source, CollectionDescriptor cds, List referencesToLink)
    {
        for(int i = 0; i < referencesToLink.size(); i++)
        {
            link(source, cds, referencesToLink.get(i));
        }
    }
1184049
function insertAfter(newNode, referenceNode) {
  if (!referenceNode.parentNode) {
    referenceNode = AFRAME.INSPECTOR.selectedEntity;
  }

  if (!referenceNode) {
    AFRAME.INSPECTOR.sceneEl.appendChild(newNode);
  } else {
    referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
  }
}
802856
function mapSources (sourceMap, mapCallback) {
  let chain = Promise.resolve()
  function pushChain (path, index, arr) {
    chain = chain
      .then(() => mapCallback(path))
      .then(replacement => {
        arr[index] = replacement || path
      })
  }
  if (sourceMap.sources) {
    sourceMap.sources.forEach(pushChain)
  }
  if (sourceMap.sections) {
    sourceMap.sections.forEach(section => {
      if (section.map && section.map.sources) {
        section.map.sources.forEach(pushChain)
      }
    })
  }
  return chain.then(() => sourceMap)
}