Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
257,600
void (@NotNull TextMergeChange change) { if (change.isResolved()) { onChangeRemoved(change); } else { onChangeAdded(change); } if (getChangesCount() == 0 && getConflictsCount() == 0) { LOG.assertTrue(ContainerUtil.and(getAllChanges(), TextMergeChange::isResolved)); ApplicationManager.getApplication().invokeLater(() -> ...
onChangeResolved
257,601
MergeModelBase () { return myModel; }
getModel
257,602
List<TextMergeChange> () { return myAllMergeChanges; }
getAllChanges
257,603
List<TextMergeChange> () { return ContainerUtil.filter(myAllMergeChanges, mergeChange -> !mergeChange.isResolved()); }
getChanges
257,604
KeyboardModifierListener () { return myModifierProvider; }
getModifierProvider
257,605
EditorEx () { return getEditor(ThreeSide.BASE); }
getEditor
257,606
boolean (@Nullable @Nls String commandName, boolean underBulkUpdate, @Nullable List<? extends TextMergeChange> affected, @NotNull Runnable task) { myContentModified = true; IntList affectedIndexes = null; if (affected != null) { affectedIndexes = new IntArrayList(affected.size()); for (TextMergeChange change : affected...
executeMergeCommand
257,607
boolean (@Nullable @Nls String commandName, @Nullable List<? extends TextMergeChange> affected, @NotNull Runnable task) { return executeMergeCommand(commandName, false, affected, task); }
executeMergeCommand
257,608
void (@NotNull TextMergeChange change) { if (change.isResolved()) return; change.setResolved(Side.LEFT, true); change.setResolved(Side.RIGHT, true); onChangeResolved(change); myModel.invalidateHighlighters(change.getIndex()); }
markChangeResolved
257,609
void (@NotNull TextMergeChange change, @NotNull Side side) { if (change.isResolved(side)) return; change.setResolved(side, true); if (change.isResolved()) onChangeResolved(change); myModel.invalidateHighlighters(change.getIndex()); }
markChangeResolved
257,610
void (@NotNull TextMergeChange change, @NotNull Side side, boolean resolveChange) { if (!change.isConflict() || resolveChange) { markChangeResolved(change); } else { markChangeResolved(change, side); } }
ignoreChange
257,611
void (@NotNull TextMergeChange change, @NotNull Side side, boolean resolveChange) { if (change.isResolved(side)) return; if (!change.isChange(side)) { markChangeResolved(change); return; } ThreeSide sourceSide = side.select(ThreeSide.LEFT, ThreeSide.RIGHT); ThreeSide oppositeSide = side.select(ThreeSide.RIGHT, ThreeSid...
replaceChange
257,612
void (int index) { TextMergeChange change = myAllMergeChanges.get(index); change.reinstallHighlighters(); myInnerDiffWorker.scheduleRediff(change); }
reinstallHighlighters
257,613
void (@NotNull TextMergeChange.State state) { super.restoreChangeState(state); TextMergeChange change = myAllMergeChanges.get(state.myIndex); boolean wasResolved = change.isResolved(); change.restoreState(state); if (wasResolved != change.isResolved()) onChangeResolved(change); }
restoreChangeState
257,614
boolean (@NotNull ThreeSide side) { return ContainerUtil.exists(getAllChanges(), change -> !change.isConflict() && canResolveChangeAutomatically(change, side)); }
hasNonConflictedChanges
257,615
void (@NotNull ThreeSide side) { executeMergeCommand(DiffBundle.message("merge.dialog.apply.non.conflicted.changes.command"), true, null, () -> { List<TextMergeChange> allChanges = new ArrayList<>(getAllChanges()); for (TextMergeChange change : allChanges) { if (!change.isConflict()) { resolveChangeAutomatically(change...
applyNonConflictedChanges
257,616
boolean () { return ContainerUtil.exists(getAllChanges(), change -> canResolveChangeAutomatically(change, ThreeSide.BASE)); }
hasResolvableConflictedChanges
257,617
void () { executeMergeCommand(DiffBundle.message("message.resolve.simple.conflicts.command"), true, null, () -> { List<TextMergeChange> allChanges = new ArrayList<>(getAllChanges()); for (TextMergeChange change : allChanges) { resolveChangeAutomatically(change, ThreeSide.BASE); } }); TextMergeChange firstUnresolved = C...
applyResolvableConflictedChanges
257,618
boolean (@NotNull TextMergeChange change, @NotNull ThreeSide side) { if (change.isConflict()) { return side == ThreeSide.BASE && change.getConflictType().canBeResolved() && !change.isResolved(Side.LEFT) && !change.isResolved(Side.RIGHT) && !isChangeRangeModified(change); } else { return !change.isResolved() && change.i...
canResolveChangeAutomatically
257,619
boolean (@NotNull TextMergeChange change) { MergeLineFragment changeFragment = change.getFragment(); int baseStartLine = changeFragment.getStartLine(ThreeSide.BASE); int baseEndLine = changeFragment.getEndLine(ThreeSide.BASE); DocumentContent baseDiffContent = ThreeSide.BASE.select(myMergeRequest.getContents()); Docume...
isChangeRangeModified
257,620
void (@NotNull TextMergeChange change, @NotNull ThreeSide side) { if (!canResolveChangeAutomatically(change, side)) return; if (change.isConflict()) { List<CharSequence> texts = ThreeSide.map(it -> DiffUtil.getLinesContent(getEditor(it).getDocument(), change.getStartLine(it), change.getEndLine(it))); CharSequence newCo...
resolveChangeAutomatically
257,621
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
257,622
void (@NotNull AnActionEvent e) { if (DiffUtil.isFromShortcut(e)) { // consume shortcut even if there are nothing to do - avoid calling some other action e.getPresentation().setEnabledAndVisible(true); return; } Presentation presentation = e.getPresentation(); Editor editor = e.getData(CommonDataKeys.EDITOR); ThreeSide...
update
257,623
void (@NotNull final AnActionEvent e) { Editor editor = e.getData(CommonDataKeys.EDITOR); final ThreeSide side = getEditorSide(editor); if (editor == null || side == null) return; final List<TextMergeChange> selectedChanges = getSelectedChanges(side); if (selectedChanges.isEmpty()) return; String title = DiffBundle.mes...
actionPerformed
257,624
boolean (@NotNull ThreeSide side) { EditorEx editor = getEditor(side); return DiffUtil.isSomeRangeSelected(editor, lines -> ContainerUtil.exists(getAllChanges(), change -> isChangeSelected(change, lines, side))); }
isSomeChangeSelected
257,625
List<TextMergeChange> (@NotNull ThreeSide side) { EditorEx editor = getEditor(side); BitSet lines = DiffUtil.getSelectedLines(editor); return ContainerUtil.filter(getChanges(), change -> isChangeSelected(change, lines, side)); }
getSelectedChanges
257,626
boolean (@NotNull TextMergeChange change, @NotNull BitSet lines, @NotNull ThreeSide side) { if (!isEnabled(change)) return false; int line1 = change.getStartLine(side); int line2 = change.getEndLine(side); return DiffUtil.isSelectedByLine(lines, line1, line2); }
isChangeSelected
257,627
String (@NotNull ThreeSide side) { return DiffBundle.message("action.presentation.merge.ignore.text"); }
getText
257,628
boolean (@NotNull ThreeSide side) { return side == mySide.select(ThreeSide.LEFT, ThreeSide.RIGHT); }
isVisible
257,629
boolean (@NotNull TextMergeChange change) { return !change.isResolved(mySide); }
isEnabled
257,630
void (@NotNull ThreeSide side, @NotNull List<? extends TextMergeChange> changes) { for (TextMergeChange change : changes) { ignoreChange(change, mySide, false); } }
apply
257,631
String (@NotNull ThreeSide side) { return DiffBundle.message("action.presentation.merge.ignore.text"); }
getText
257,632
boolean (@NotNull ThreeSide side) { return side == ThreeSide.BASE; }
isVisible
257,633
boolean (@NotNull TextMergeChange change) { return !change.isResolved(); }
isEnabled
257,634
void (@NotNull ThreeSide side, @NotNull List<? extends TextMergeChange> changes) { for (TextMergeChange change : changes) { markChangeResolved(change); } }
apply
257,635
String (@NotNull ThreeSide side) { return side != ThreeSide.BASE ? DiffBundle.message("action.presentation.diff.accept.text") : getTemplatePresentation().getText(); }
getText
257,636
boolean (@NotNull ThreeSide side) { if (side == ThreeSide.BASE) return true; return side == mySide.select(ThreeSide.LEFT, ThreeSide.RIGHT); }
isVisible
257,637
boolean (@NotNull TextMergeChange change) { return !change.isResolved(mySide); }
isEnabled
257,638
void (@NotNull ThreeSide side, @NotNull List<? extends TextMergeChange> changes) { for (int i = changes.size() - 1; i >= 0; i--) { replaceChange(changes.get(i), mySide, false); } }
apply
257,639
String (@NotNull ThreeSide side) { return DiffBundle.message("action.presentation.merge.resolve.using.side.text", mySide.getIndex()); }
getText
257,640
boolean (@NotNull ThreeSide side) { if (side == ThreeSide.BASE) return true; return side == mySide.select(ThreeSide.LEFT, ThreeSide.RIGHT); }
isVisible
257,641
boolean (@NotNull TextMergeChange change) { return !change.isResolved(mySide); }
isEnabled
257,642
void (@NotNull ThreeSide side, @NotNull List<? extends TextMergeChange> changes) { for (int i = changes.size() - 1; i >= 0; i--) { replaceChange(changes.get(i), mySide, true); } }
apply
257,643
String (@NotNull ThreeSide side) { return DiffBundle.message("action.presentation.merge.resolve.automatically.text"); }
getText
257,644
boolean (@NotNull ThreeSide side) { return side == ThreeSide.BASE; }
isVisible
257,645
boolean (@NotNull TextMergeChange change) { return canResolveChangeAutomatically(change, ThreeSide.BASE); }
isEnabled
257,646
void (@NotNull ThreeSide side, @NotNull List<? extends TextMergeChange> changes) { for (int i = changes.size() - 1; i >= 0; i--) { TextMergeChange change = changes.get(i); resolveChangeAutomatically(change, ThreeSide.BASE); } }
apply
257,647
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
257,648
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(hasNonConflictedChanges(mySide)); }
update
257,649
void (@NotNull AnActionEvent e) { applyNonConflictedChanges(mySide); }
actionPerformed
257,650
boolean () { return true; }
displayTextInToolbar
257,651
boolean () { return true; }
useSmallerFontForTextInToolbar
257,652
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
257,653
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(hasResolvableConflictedChanges()); }
update
257,654
void (@NotNull AnActionEvent e) { applyResolvableConflictedChanges(); }
actionPerformed
257,655
void (@NotNull AnActionEvent e) { DiffContent baseContent = ThreeSide.BASE.select(myMergeRequest.getContents()); String baseTitle = ThreeSide.BASE.select(myMergeRequest.getContentTitles()); DiffContent otherContent = mySide.select(myRequest.getContents()); String otherTitle = mySide.select(myRequest.getContentTitles())...
actionPerformed
257,656
void (@NotNull Handler handler) { ThreeSide left = mySide.select(ThreeSide.LEFT, ThreeSide.BASE); ThreeSide right = mySide.select(ThreeSide.BASE, ThreeSide.RIGHT); for (TextMergeChange mergeChange : myAllMergeChanges) { if (!mergeChange.isChange(mySide)) continue; boolean isResolved = mergeChange.isResolved(mySide); if...
process
257,657
void () { init(myPanel, myTextMergeViewer); }
init
257,658
void () { for (TextMergeChange change : myAllMergeChanges) { change.updateGutterActions(false); } }
onModifiersChanged
257,659
void (@NotNull Editor editor, @NotNull com.intellij.openapi.vcs.ex.Range range) { if (!myTracker.isValid()) return; final Document document = myTracker.getDocument(); int line = Math.min(!range.hasLines() ? range.getLine2() : range.getLine2() - 1, getLineCount(document) - 1); int[] startLines = new int[]{ transferPosit...
scrollAndShow
257,660
List<AnAction> (@NotNull Editor editor, @NotNull com.intellij.openapi.vcs.ex.Range range, @Nullable Point mousePosition) { List<AnAction> actions = new ArrayList<>(); actions.add(new LineStatusMarkerPopupActions.ShowPrevChangeMarkerAction(editor, myTracker, range, this)); actions.add(new LineStatusMarkerPopupActions.Sh...
createToolbarActions
257,661
boolean (@NotNull Editor editor, @NotNull com.intellij.openapi.vcs.ex.Range range) { return true; }
isEnabled
257,662
void (@NotNull Editor editor, @NotNull com.intellij.openapi.vcs.ex.Range range) { DiffUtil.moveCaretToLineRangeIfNeeded(editor, range.getLine1(), range.getLine2()); myTracker.rollbackChanges(range); }
actionPerformed
257,663
void (@NotNull Editor editor, @NotNull List<? extends Range> ranges, @NotNull Graphics g) { int framingBorder = JBUIScale.scale(2); LineStatusMarkerDrawUtil.paintDefault(editor, g, ranges, DefaultFlagsProvider.DEFAULT, framingBorder); }
paintGutterMarkers
257,664
String () { return "MergeThreesideViewer.MyLineStatusMarkerRenderer{" + "myTracker=" + myTracker + '}'; }
toString
257,665
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
257,666
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(getTextSettings().isEnableLstGutterMarkersInMerge()); }
update
257,667
void (@NotNull AnActionEvent e) { if (!myLineStatusTracker.isValid()) return; int line = getEditor().getCaretModel().getLogicalPosition().line; Range targetRange = myGoToNext ? myLineStatusTracker.getNextRange(line) : myLineStatusTracker.getPrevRange(line); if (targetRange != null) new MyLineStatusMarkerRenderer(myLine...
actionPerformed
257,668
List<CharSequence> (@NotNull TextMergeChange change, @NotNull List<? extends Document> documents) { return ThreeSide.map(side -> { if (!change.isChange(side) || change.isResolved(side)) return null; int startLine = change.getStartLine(side); int endLine = change.getEndLine(side); if (startLine == endLine) return null; ...
getChunks
257,669
void () { if (myDisposed) return; myDisposed = true; LOG.assertTrue(myBulkChangeUpdateDepth == 0); myStartLines.clear(); myEndLines.clear(); }
dispose
257,670
boolean () { return myDisposed; }
isDisposed
257,671
int () { return myStartLines.size(); }
getChangesCount
257,672
int (int index) { return myStartLines.getInt(index); }
getLineStart
257,673
int (int index) { return myEndLines.getInt(index); }
getLineEnd
257,674
void (@NotNull List<? extends LineRange> changes) { myStartLines.clear(); myEndLines.clear(); for (LineRange range : changes) { myStartLines.add(range.start); myEndLines.add(range.end); } }
setChanges
257,675
boolean () { return myInsideCommand; }
isInsideCommand
257,676
void (int index, int line) { myStartLines.set(index, line); }
setLineStart
257,677
void (int index, int line) { myEndLines.set(index, line); }
setLineEnd
257,678
void (int index) { if (myBulkChangeUpdateDepth > 0) { myChangesToUpdate.add(index); } else { reinstallHighlighters(index); } }
invalidateHighlighters
257,679
void () { myBulkChangeUpdateDepth++; }
enterBulkChangeUpdateBlock
257,680
void () { myBulkChangeUpdateDepth--; LOG.assertTrue(myBulkChangeUpdateDepth >= 0); if (myBulkChangeUpdateDepth == 0) { myChangesToUpdate.forEach((IntConsumer)index -> { reinstallHighlighters(index); }); myChangesToUpdate.clear(); } }
exitBulkChangeUpdateBlock
257,681
void (@NotNull S state) { setLineStart(state.myIndex, state.myStartLine); setLineEnd(state.myIndex, state.myEndLine); }
restoreChangeState
257,682
S (int index, int oldLine1, int oldLine2, int shift) { int line1 = getLineStart(index); int line2 = getLineEnd(index); DiffUtil.UpdatedLineRange newRange = DiffUtil.updateRangeOnModification(line1, line2, oldLine1, oldLine2, shift); // RangeMarker can be updated in a different way boolean rangeAffected = newRange.damag...
processDocumentChange
257,683
void (@NotNull DocumentEvent e) { if (isDisposed()) return; enterBulkChangeUpdateBlock(); if (getChangesCount() == 0) return; LineRange lineRange = DiffUtil.getAffectedLineRange(e); int shift = DiffUtil.countLinesShift(e); List<S> corruptedStates = new SmartList<>(); for (int index = 0; index < getChangesCount(); index...
beforeDocumentChange
257,684
void (@NotNull DocumentEvent e) { if (isDisposed()) return; exitBulkChangeUpdateBlock(); }
documentChanged
257,685
boolean (@Nullable @NlsContexts.Command String commandName, @Nullable String commandGroupId, @NotNull UndoConfirmationPolicy confirmationPolicy, boolean underBulkUpdate, @Nullable IntList affectedChanges, @NotNull Runnable task) { IntList allAffectedChanges = affectedChanges != null ? collectAffectedChanges(affectedCha...
executeMergeCommand
257,686
void (boolean undo, @Nullable IntList affectedChanges) { if (myUndoManager == null) return; List<S> states; if (affectedChanges != null) { states = new ArrayList<>(affectedChanges.size()); affectedChanges.forEach((IntConsumer)(index) -> { states.add(storeChangeState(index)); }); } else { states = new ArrayList<>(getCha...
registerUndoRedo
257,687
void () { MergeModelBase<?> model = myModelRef.get(); if (model != null && myUndo) restoreStates(model); }
undo
257,688
void () { MergeModelBase<?> model = myModelRef.get(); if (model != null && !myUndo) restoreStates(model); }
redo
257,689
void (@NotNull MergeModelBase model) { if (model.isDisposed()) return; if (model.getChangesCount() == 0) return; model.enterBulkChangeUpdateBlock(); try { for (State state : myStates) { //noinspection unchecked model.restoreChangeState(state); model.invalidateHighlighters(state.myIndex); } } finally { model.exitBulkCha...
restoreStates
257,690
void (int index, @NotNull List<? extends CharSequence> newContent) { LOG.assertTrue(isInsideCommand()); int outputStartLine = getLineStart(index); int outputEndLine = getLineEnd(index); DiffUtil.applyModification(myDocument, outputStartLine, outputEndLine, newContent); if (outputStartLine == outputEndLine) { // onBefor...
replaceChange
257,691
void (int index, @NotNull List<? extends CharSequence> newContent) { LOG.assertTrue(isInsideCommand()); int outputStartLine = getLineStart(index); int outputEndLine = getLineEnd(index); DiffUtil.applyModification(myDocument, outputEndLine, outputEndLine, newContent); int newOutputEndLine = outputEndLine + newContent.si...
appendChange
257,692
void (int index, int newOutputStartLine, int newOutputEndLine) { LOG.assertTrue(isInsideCommand()); if (getLineStart(index) != newOutputStartLine || getLineEnd(index) != newOutputEndLine) { setLineStart(index, newOutputStartLine); setLineEnd(index, newOutputEndLine); invalidateHighlighters(index); } boolean beforeChang...
moveChangesAfterInsertion
257,693
IntList (@NotNull IntList directChanges) { IntList result = new IntArrayList(directChanges.size()); int directArrayIndex = 0; int otherIndex = 0; while (directArrayIndex < directChanges.size() && otherIndex < getChangesCount()) { int directIndex = directChanges.getInt(directArrayIndex); if (directIndex == otherIndex) {...
collectAffectedChanges
257,694
MergeViewer (@NotNull MergeContext context, @NotNull MergeRequest request) { return new TextMergeViewer(context, ((TextMergeRequest)request)); }
createComponent
257,695
boolean (@NotNull MergeContext context, @NotNull MergeRequest request) { return request instanceof TextMergeRequest; }
canShow
257,696
List<DiffContent> (@NotNull TextMergeRequest mergeRequest) { List<DocumentContent> contents = mergeRequest.getContents(); final DocumentContent left = ThreeSide.LEFT.select(contents); final DocumentContent right = ThreeSide.RIGHT.select(contents); final DocumentContent output = mergeRequest.getOutputContent(); return A...
getDiffContents
257,697
List<String> (@NotNull TextMergeRequest mergeRequest) { List<String> titles = MergeUtil.notNullizeContentTitles(mergeRequest.getContentTitles()); titles.set(ThreeSide.BASE.getIndex(), DiffBundle.message("merge.version.title.merged.result")); return titles; }
getDiffContentTitles
257,698
JComponent () { return myViewer.getComponent(); }
getComponent
257,699
JComponent () { return myViewer.getPreferredFocusedComponent(); }
getPreferredFocusedComponent