Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
242,000
void () { myInlineElementsTree.dispose(myEditor.getDocument()); myBlockElementsTree.dispose(myEditor.getDocument()); myAfterLineEndElementsTree.dispose(myEditor.getDocument()); }
dispose
242,001
int (int visualLine, int startOffset, int prevFoldRegionIndex) { if (visualLine < 0 || !hasBlockElements()) return 0; int visibleLineCount = myEditor.getVisibleLineCount(); if (visualLine >= visibleLineCount) { return myBlockElementsTree.getSumOfValuesUpToOffset(Integer.MAX_VALUE) - myEditor.getFoldingModel().getTotalH...
getHeightOfBlockElementsBeforeVisualLine
242,002
boolean () { return myBlockElementsTree.size() > 0; }
hasBlockElements
242,003
boolean (int startOffset, int endOffset) { return !myInlineElementsTree.processOverlappingWith(startOffset, endOffset, inlay -> false); }
hasInlineElementsInRange
242,004
boolean () { return myInlineElementsTree.size() > 0; }
hasInlineElements
242,005
boolean (int offset) { return !myInlineElementsTree.processOverlappingWith(offset, offset, inlay -> false); }
hasInlineElementAt
242,006
boolean (@NotNull VisualPosition visualPosition) { int offset = myEditor.visualPositionToOffset(visualPosition); int inlayCount = getInlineElementsInRange(offset, offset).size(); if (inlayCount == 0) return false; VisualPosition inlayStartPosition = myEditor.offsetToVisualPosition(offset, false, false); return visualPo...
hasInlineElementAt
242,007
boolean () { return myAfterLineEndElementsTree.size() > 0; }
hasAfterLineEndElements
242,008
void (boolean enabled) { myConsiderCaretPositionOnDocumentUpdates = enabled; }
setConsiderCaretPositionOnDocumentUpdates
242,009
void (boolean batchMode, @NotNull Runnable operation) { EditorImpl.assertIsDispatchThread(); if (myInBatchMode || !batchMode) { operation.run(); } else { try { notifyBatchModeStarting(); myInBatchMode = true; operation.run(); } finally { myInBatchMode = false; notifyBatchModeFinished(); } } }
execute
242,010
boolean () { return myInBatchMode; }
isInBatchMode
242,011
void (@NotNull Listener listener, @NotNull Disposable disposable) { EditorImpl.assertIsDispatchThread(); myDispatcher.addListener(listener, disposable); }
addListener
242,012
void (InlayImpl inlay) { myDispatcher.getMulticaster().onAdded(inlay); }
notifyAdded
242,013
void () { List<Listener> listeners = myDispatcher.getListeners(); for (int i = listeners.size() - 1; i >= 0; i--) { listeners.get(i).onBatchModeStart(myEditor); } }
notifyBatchModeStarting
242,014
void () { myDispatcher.getMulticaster().onBatchModeFinish(myEditor); }
notifyBatchModeFinished
242,015
void () { for (Inlay inlay : getInlineElementsInRange(0, myEditor.getDocument().getTextLength())) { LOG.assertTrue(!DocumentUtil.isInsideSurrogatePair(myEditor.getDocument(), inlay.getOffset())); } }
validateState
242,016
String () { return "Inline elements: " + dumpInlays(myInlineElementsTree) + ", after-line-end elements: " + dumpInlays(myAfterLineEndElementsTree) + ", block elements: " + dumpInlays(myBlockElementsTree); }
dumpState
242,017
String (RangeMarkerTree<? extends InlayImpl> tree) { StringJoiner joiner = new StringJoiner(",", "[", "]"); tree.processAll(o -> { joiner.add(Integer.toString(o.getOffset())); return true; }); return joiner.toString(); }
dumpInlays
242,018
boolean (@NotNull Inlay<?> inlay) { return inlay instanceof BlockInlayImpl && ((BlockInlayImpl<?>)inlay).myShowWhenFolded; }
showWhenFolded
242,019
String () { return EditorBundle.message("radio.editor.tab.long.arrow"); }
toString
242,020
String () { return EditorBundle.message("radio.editor.tab.arrow"); }
toString
242,021
String () { return EditorBundle.message("radio.editor.tab.horizontal.line"); }
toString
242,022
void (Document document, final @NotNull EditorHighlighter highlighter) { document.putUserData(ourSomeEditorSyntaxHighlighter, new WeakReference<>(highlighter)); }
rememberEditorHighlighterForCachesOptimization
242,023
boolean (@NotNull CharSequence chars, @NotNull EditorHighlighter editorHighlighter) { boolean b = ((LexerEditorHighlighter)editorHighlighter).checkContentIsEqualTo(chars); if (!b) { Logger logger = Logger.getInstance(EditorHighlighterCache.class); logger.warn("Unexpected mismatch of editor highlighter content with inde...
checkCanUseCachedEditorHighlighter
242,024
void (int offset) { moveToOffset(offset, false); }
moveToOffset
242,025
void (final int offset, final boolean locateBeforeSoftWrap) { assertIsDispatchThread(); assertNotUpdating(); if (mySkipChangeRequests) { return; } myCaretModel.doWithCaretMerging(() -> { LogicalPosition logicalPosition = myEditor.offsetToLogicalPosition(offset); CaretEvent event = moveToLogicalPosition(logicalPosition,...
moveToOffset
242,026
CaretModel () { return myCaretModel; }
getCaretModel
242,027
boolean () { return isValid; }
isValid
242,028
void (final int _columnShift, final int lineShift, final boolean withSelection, final boolean scrollToCaret) { assertIsDispatchThread(); if (mySkipChangeRequests) { return; } stopKillRings(); myCaretModel.doWithCaretMerging(() -> { updateCachedStateIfNeeded(); int oldOffset = getOffset(); int columnShift = _columnShift...
moveCaretRelatively
242,029
void (final @NotNull LogicalPosition pos) { myCaretModel.doWithCaretMerging(() -> moveToLogicalPosition(pos, false, null, false, true)); }
moveToLogicalPosition
242,030
CaretEvent (@NotNull LogicalPosition pos, boolean locateBeforeSoftWrap, @NonNls @Nullable StringBuilder debugBuffer, boolean adjustForInlays, boolean fireListeners) { assertIsDispatchThread(); checkDisposal(); updateCachedStateIfNeeded(); if (debugBuffer != null) { debugBuffer.append("Start moveToLogicalPosition(). Loc...
doMoveToLogicalPosition
242,031
void () { int offset = myEditor.logicalPositionToOffset(myLogicalCaret); PositionMarker oldMarker = myPositionMarker; if (!oldMarker.isValid() || oldMarker.getStartOffset() != offset || oldMarker.getEndOffset() != offset) { myPositionMarker = new PositionMarker(offset); oldMarker.dispose(); } myLeansTowardsLargerOffset...
updateOffsetsFromLogicalPosition
242,032
void (VerticalInfo oldVerticalInfo) { if (oldVerticalInfo == null) oldVerticalInfo = new VerticalInfo(0, 0, myEditor.getLineHeight()); if (myVerticalInfo == null) myVerticalInfo = new VerticalInfo(0, 0, myEditor.getLineHeight()); int oldY, oldHeight, newY, newHeight; if (oldVerticalInfo.logicalLineY == myVerticalInfo.l...
requestRepaint
242,033
void (final @NotNull VisualPosition pos) { moveToVisualPosition(pos, true); }
moveToVisualPosition
242,034
void (final @NotNull VisualPosition pos, boolean fireListeners) { myCaretModel.doWithCaretMerging(() -> doMoveToVisualPosition(pos, fireListeners)); }
moveToVisualPosition
242,035
void () { EditorImpl.assertIsDispatchThread(); }
assertIsDispatchThread
242,036
void () { LOG.assertTrue(isUpToDate() || !ApplicationManager.getApplication().isDispatchThread(), "Caret model is in its update process. All requests are illegal at this point."); }
assertNotUpdating
242,037
void () { PositionMarker positionMarker = myPositionMarker; if (positionMarker != null) { // null it first to avoid accessing invalid marker from other threads myPositionMarker = null; positionMarker.dispose(); } SelectionMarker selectionMarker = mySelectionMarker; if (selectionMarker != null) { mySelectionMarker = nul...
dispose
242,038
boolean () { return !myCaretModel.myIsInUpdate; }
isUpToDate
242,039
LogicalPosition () { assertNotUpdating(); updateCachedStateIfNeeded(); return myLogicalCaret; }
getLogicalPosition
242,040
VisualPosition () { assertNotUpdating(); updateCachedStateIfNeeded(); return myVisibleCaret; }
getVisualPosition
242,041
int () { assertNotUpdating(); ApplicationManager.getApplication().assertReadAccessAllowed(); while (true) { PositionMarker marker = myPositionMarker; if (marker == null) return 0; // caret was disposed int startOffset = marker.getStartOffset(); // double-checking to avoid "concurrent dispose and return -1 from already ...
getOffset
242,042
int () { updateCachedStateIfNeeded(); return myVisualLineStart; }
getVisualLineStart
242,043
int () { updateCachedStateIfNeeded(); return myVisualLineEnd; }
getVisualLineEnd
242,044
void () { myVisualLineStart = myEditor.visualPositionToOffset(new VisualPosition(myVisibleCaret.line, 0)); myVisualLineEnd = myEditor.visualPositionToOffset(new VisualPosition(myVisibleCaret.line + 1, 0)); int[] yRange = myEditor.visualLineToYRange(myVisibleCaret.line); int logicalLineStartY; if (myEditor.getSoftWrapMo...
updateVisualLineInfo
242,045
boolean (CharSequence text, int offset) { return offset < text.length() && isBracket(text.charAt(offset)) && offset > 0 && isBracket(text.charAt(offset - 1)); }
isBetweenBrackets
242,046
boolean (char c) { return "()[]<>{}".indexOf(c) != -1; }
isBracket
242,047
CaretImpl () { updateCachedStateIfNeeded(); CaretImpl clone = new CaretImpl(myEditor, myCaretModel); clone.myLogicalCaret = myLogicalCaret; clone.myVerticalInfo = myVerticalInfo; clone.myVisibleCaret = myVisibleCaret; clone.myPositionMarker.dispose(); clone.myPositionMarker = new PositionMarker(getOffset()); clone.myLe...
cloneWithoutSelection
242,048
LogicalPosition (int line, int column) { if (line < 0) { return new LogicalPosition(0, 0); } else if (line >= myEditor.getDocument().getLineCount()) { return myEditor.offsetToLogicalPosition(myEditor.getDocument().getTextLength()); } else { return new LogicalPosition(line, column); } }
truncate
242,049
int () { ApplicationManager.getApplication().assertReadAccessAllowed(); if (hasSelection()) { RangeMarker marker = mySelectionMarker; if (marker != null) { return marker.getStartOffset(); } } return getOffset(); }
getSelectionStart
242,050
VisualPosition () { ThreadingAssertions.assertEventDispatchThread(); VisualPosition position; SelectionMarker marker = mySelectionMarker; if (hasSelection()) { position = getRangeMarkerStartPosition(); if (position == null) { VisualPosition startPosition = myEditor.offsetToVisualPosition(marker.getStartOffset(), true, ...
getSelectionStartPosition
242,051
int () { ApplicationManager.getApplication().assertReadAccessAllowed(); if (hasSelection()) { RangeMarker marker = mySelectionMarker; if (marker != null) { return marker.getEndOffset(); } } return getOffset(); }
getSelectionEnd
242,052
VisualPosition () { ThreadingAssertions.assertEventDispatchThread(); VisualPosition position; SelectionMarker marker = mySelectionMarker; if (hasSelection()) { position = getRangeMarkerEndPosition(); if (position == null) { VisualPosition startPosition = myEditor.offsetToVisualPosition(marker.getStartOffset(), true, fa...
getSelectionEndPosition
242,053
boolean () { ApplicationManager.getApplication().assertReadAccessAllowed(); SelectionMarker marker = mySelectionMarker; return hasSelection(marker); }
hasSelection
242,054
boolean (SelectionMarker marker) { return marker != null && marker.isValid() && (marker.getEndOffset() > marker.getStartOffset() || isVirtualSelectionEnabled() && marker.hasVirtualSelection()); }
hasSelection
242,055
TextRange () { ApplicationManager.getApplication().assertReadAccessAllowed(); SelectionMarker marker = mySelectionMarker; if (hasSelection(marker)) { return marker.getTextRange(); } else { int offset = getOffset(); return TextRange.create(offset, offset); } }
getSelectionRange
242,056
void (int startOffset, int endOffset) { setSelection(startOffset, endOffset, true); }
setSelection
242,057
void (int startOffset, int endOffset, boolean updateSystemSelection) { doSetSelection(myEditor.offsetToVisualPosition(startOffset, true, false), startOffset, myEditor.offsetToVisualPosition(endOffset, false, true), endOffset, false, updateSystemSelection, true); }
setSelection
242,058
void (int startOffset, @Nullable VisualPosition endPosition, int endOffset) { VisualPosition startPosition; if (hasSelection()) { startPosition = getLeadSelectionPosition(); } else { startPosition = myEditor.offsetToVisualPosition(startOffset, true, false); } setSelection(startPosition, startOffset, endPosition, endOff...
setSelection
242,059
void (@Nullable VisualPosition startPosition, int startOffset, @Nullable VisualPosition endPosition, int endOffset) { setSelection(startPosition, startOffset, endPosition, endOffset, true); }
setSelection
242,060
void (@Nullable VisualPosition startPosition, int startOffset, @Nullable VisualPosition endPosition, int endOffset, boolean updateSystemSelection) { VisualPosition startPositionToUse = startPosition == null ? myEditor.offsetToVisualPosition(startOffset, true, false) : startPosition; VisualPosition endPositionToUse = en...
setSelection
242,061
void () { if (myEditor.isStickySelection()) { // Most of our 'change caret position' actions (like move caret to word start/end etc.) remove active selection. // However, we don't want to do that for 'sticky selection'. return; } myCaretModel.doWithCaretMerging(() -> { ThreadingAssertions.assertEventDispatchThread(); m...
removeSelection
242,062
int () { ApplicationManager.getApplication().assertReadAccessAllowed(); int caretOffset = getOffset(); if (hasSelection()) { RangeMarker marker = mySelectionMarker; if (marker != null && marker.isValid()) { int startOffset = marker.getStartOffset(); int endOffset = marker.getEndOffset(); if (caretOffset != startOffset ...
getLeadSelectionOffset
242,063
VisualPosition () { SelectionMarker marker = mySelectionMarker; VisualPosition caretPosition = getVisualPosition(); if (isVirtualSelectionEnabled() && !hasSelection()) { return caretPosition; } if (marker == null || !marker.isValid()) { return caretPosition; } if (isRangeMarkerEndPositionIsLead()) { VisualPosition resu...
getLeadSelectionPosition
242,064
void () { ThreadingAssertions.assertEventDispatchThread(); myCaretModel.doWithCaretMerging(() -> EditorActionUtil.selectEntireLines(this, true)); }
selectLineAtCaret
242,065
void (final boolean honorCamelWordsSettings) { ThreadingAssertions.assertEventDispatchThread(); myCaretModel.doWithCaretMerging(() -> { removeSelection(); final EditorSettings settings = myEditor.getSettings(); boolean camelTemp = settings.isCamelWords(); final boolean needOverrideSetting = camelTemp && !honorCamelWord...
selectWordAtCaret
242,066
boolean () { return myEditor.isColumnMode(); }
isVirtualSelectionEnabled
242,067
int () { return myEditor.visualPositionToXY(myVisibleCaret).x; }
getCurrentX
242,068
EditorImpl () { return myEditor; }
getEditor
242,069
boolean () { return myEditor.myView.isRtlLocation(getVisualPosition()); }
isAtRtlLocation
242,070
boolean () { return myEditor.myView.isAtBidiRunBoundary(getVisualPosition()); }
isAtBidiRunBoundary
242,071
CaretVisualAttributes () { CaretVisualAttributes attrs = getUserData(VISUAL_ATTRIBUTES_KEY); return attrs == null ? CaretVisualAttributes.DEFAULT : attrs; }
getVisualAttributes
242,072
void (@NotNull CaretVisualAttributes attributes) { putUserData(VISUAL_ATTRIBUTES_KEY, attributes == CaretVisualAttributes.DEFAULT ? null : attributes); requestRepaint(myVerticalInfo); }
setVisualAttributes
242,073
String () { return "{valid: " + isValid + ", update counter: " + myDocumentUpdateCounter + ", position: " + myPositionMarker + ", logical pos: " + myLogicalCaret + ", visual pos: " + myVisibleCaret + ", visual line start: " + myVisualLineStart + ", visual line end: " + myVisualLineEnd + ", skip change requests: " + myS...
dumpState
242,074
void (@NotNull VisualPosition startPosition) { myRangeMarkerStartPosition = startPosition; }
setRangeMarkerStartPosition
242,075
void (@NotNull VisualPosition endPosition) { myRangeMarkerEndPosition = endPosition; }
setRangeMarkerEndPosition
242,076
boolean () { return myRangeMarkerEndPositionIsLead; }
isRangeMarkerEndPositionIsLead
242,077
void (boolean endPositionIsLead) { myRangeMarkerEndPositionIsLead = endPositionIsLead; }
setRangeMarkerEndPositionIsLead
242,078
void (RangeMarker marker) { SoftWrapModelImpl model = myEditor.getSoftWrapModel(); InlayModelImpl inlayModel = myEditor.getInlayModel(); int startOffset = marker.getStartOffset(); int endOffset = marker.getEndOffset(); if ((myRangeMarkerStartPosition == null || !myEditor.offsetToVisualPosition(startOffset, true, false)...
invalidateRangeMarkerVisualPositions
242,079
void () { LogicalPosition lp = myEditor.offsetToLogicalPosition(getOffset()); myLogicalCaret = new LogicalPosition(lp.line, lp.column + myLogicalColumnAdjustment, myLeansTowardsLargerOffsets); VisualPosition visualPosition = myEditor.logicalToVisualPosition(myLogicalCaret); myVisibleCaret = new VisualPosition(visualPos...
updateCachedState
242,080
boolean () { return myLogicalColumnAdjustment > 0; }
isInVirtualSpace
242,081
void () { if (myEditor.isDisposed()) myEditor.throwDisposalError("Editor is already disposed"); if (!isValid) throw new IllegalStateException("Caret is invalid", myDisposalTrace); }
checkDisposal
242,082
void () { if (!myEditor.isStickySelection() && !myEditor.getDocument().isInEventsHandling()) { CopyPasteManager.getInstance().stopKillRings(myEditor.getDocument()); } }
stopKillRings
242,083
void () { LOG.assertTrue(!DocumentUtil.isInsideSurrogatePair(myEditor.getDocument(), getOffset())); LOG.assertTrue(!DocumentUtil.isInsideSurrogatePair(myEditor.getDocument(), getSelectionStart())); LOG.assertTrue(!DocumentUtil.isInsideSurrogatePair(myEditor.getDocument(), getSelectionEnd())); }
validateState
242,084
void () { if (isValid()) { myCaretModel.myPositionMarkerTree.removeInterval(this); } }
dispose
242,085
void (@NotNull DocumentEvent e) { int oldOffset = intervalStart(); RangeMarkerTree.RMNode<RangeMarkerEx> node = myNode; long newRange = isValid() && node != null ? applyChange(e, node.toScalarRange(), isGreedyToLeft(), isGreedyToRight(), isStickingToRight()) : -1; if (newRange != -1) { setRange(newRange); // Under cert...
changedUpdateImpl
242,086
boolean (final DocumentEvent e) { return e.getOffset() > 0 && Character.isWhitespace(e.getDocument().getImmutableCharSequence().charAt(e.getOffset() - 1)) && CharArrayUtil.containsOnlyWhiteSpaces(e.getNewFragment()) && !CharArrayUtil.containLineBreaks(e.getNewFragment()); }
needToShiftWhiteSpaces
242,087
void (@NotNull DocumentEvent e) { int offset = intervalStart(); if (DocumentUtil.isInsideSurrogatePair(getDocument(), offset)) { setRange(TextRangeScalarUtil.toScalarRange(offset - 1, offset - 1)); } }
onReTarget
242,088
void () { startVirtualOffset = 0; endVirtualOffset = 0; }
resetVirtualSelection
242,089
boolean () { return endVirtualOffset > startVirtualOffset; }
hasVirtualSelection
242,090
void () { if (isValid()) { myCaretModel.mySelectionMarkerTree.removeInterval(this); } }
dispose
242,091
void (@NotNull DocumentEvent e) { super.changedUpdateImpl(e); if (isValid()) { alignToSurrogatePairBoundaries(); } if (endVirtualOffset > 0 && isValid()) { Document document = e.getDocument(); int startAfter = intervalStart(); int endAfter = intervalEnd(); if (!DocumentUtil.isAtLineEnd(endAfter, document) || document.g...
changedUpdateImpl
242,092
void () { long alignedRange = TextRangeScalarUtil.shift(toScalarRange(), DocumentUtil.isInsideSurrogatePair(getDocument(), getStartOffset()) ? -1 : 0, DocumentUtil.isInsideSurrogatePair(getDocument(), getEndOffset()) ? -1 : 0); setRange(alignedRange); }
alignToSurrogatePairBoundaries
242,093
void (@NotNull DocumentEvent e) { alignToSurrogatePairBoundaries(); }
onReTarget
242,094
String () { return super.toString() + (hasVirtualSelection() ? " virtual selection: " + startVirtualOffset + "-" + endVirtualOffset : ""); }
toString
242,095
void (final @NotNull CaretEvent event) { final IndentGuideDescriptor newGuide = getCaretIndentGuide(event); if (!Comparing.equal(myCurrentCaretGuide, newGuide)) { repaintGuide(newGuide); repaintGuide(myCurrentCaretGuide); myCurrentCaretGuide = newGuide; if (myCurrentHint != null) { myCurrentHint.hide(); myCurrentHint =...
caretPositionChanged
242,096
void (final @Nullable IndentGuideDescriptor guide) { if (guide != null) { myEditor.repaintLines(guide.startLine, guide.endLine); } }
repaintGuide
242,097
boolean (@NotNull IndentGuideDescriptor descriptor) { final Rectangle visibleArea = myEditor.getScrollingModel().getVisibleArea(); return myEditor.logicalLineToY(descriptor.startLine) < visibleArea.y; }
shouldShowHint
242,098
void (@NotNull IndentGuideDescriptor descriptor) { int startLine = Math.max(descriptor.codeConstructStartLine, descriptor.startLine - EditorFragmentComponent.getAvailableVisualLinesAboveEditor(myEditor) + 1); TextRange textRange = new TextRange(myEditor.getDocument().getLineStartOffset(startLine), myEditor.getDocument(...
showHint
242,099
EditorCssFontResolver () { return GLOBAL_INSTANCE; }
getGlobalInstance