Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
243,000
RMNode<FoldRegionImpl> (@NotNull FoldRegionImpl key, int start, int end, boolean greedyToLeft, boolean greedyToRight, boolean stickingToRight, int layer) { return new FRNode(this, key, start, end); }
createNewNode
243,001
Editor () { return myEditor; }
getEditor
243,002
boolean () { return !myEditor.isDisposed() && super.isValid(); }
isValid
243,003
void () { EditorImpl.assertIsDispatchThread(); int oldWidth = getWidthInPixels(); int oldHeight = getHeightInPixels(); GutterIconRenderer oldIconRenderer = getGutterIconRenderer(); doUpdate(); int changeFlags = 0; if (oldWidth != getWidthInPixels()) changeFlags |= InlayModel.ChangeFlags.WIDTH_CHANGED; if (oldHeight != ...
update
243,004
void () { if (isValid() && !myEditor.isDisposed() && !myEditor.getDocument().isInBulkUpdate() && !myEditor.getInlayModel().isInBatchMode()) { JComponent contentComponent = myEditor.getContentComponent(); if (contentComponent.isShowing()) { Rectangle bounds = getBounds(); if (bounds != null) { if (this instanceof BlockI...
repaint
243,005
void () { EditorImpl.assertIsDispatchThread(); if (isValid()) { int offset = getOffset(); // We want listeners notified after disposal, but want inlay offset to be available at that time putUserData(OFFSET_BEFORE_DISPOSAL, offset); putUserData(ID_BEFORE_DISPOSAL, getId()); //noinspection unchecked getTree().removeInter...
dispose
243,006
int () { Integer offsetBeforeDisposal = getUserData(OFFSET_BEFORE_DISPOSAL); return offsetBeforeDisposal == null ? getStartOffset() : offsetBeforeDisposal; }
getOffset
243,007
boolean () { return myRelatedToPrecedingText; }
isRelatedToPrecedingText
243,008
R () { return myRenderer; }
getRenderer
243,009
int () { return myWidthInPixels; }
getWidthInPixels
243,010
void (Graphics g, int y, int start, int stop) { stop -= myWidthProvider.compute() / 4; Color oldColor = g.getColor(); g.setColor(myColorHolder.getColor()); final int height = myHeightProvider.compute(); final int halfHeight = height / 2; int mid = y - halfHeight; int top = y - height; LinePainter2D.paint((Graphics2D)g,...
paint
243,011
RangeHighlighterEx () { return myHighlighter; }
getHighlighter
243,012
void (@NotNull DocumentEvent e) { int oldStart = intervalStart(); int oldEnd = intervalEnd(); if (myHighlighter.isPersistent()) { persistentHighlighterUpdate(e, myHighlighter.getTargetArea() == HighlighterTargetArea.LINES_IN_RANGE); } else { super.changedUpdateImpl(e); } validateState(e, oldStart, oldEnd); }
changedUpdateImpl
243,013
void (DocumentEvent e, int oldStart, int oldEnd) { if (myHighlighter.isValid()) { if (!isValid()) { reportError("Base highlighter " + myHighlighter + " is valid, mirror " + this + "(prev state: " + oldStart + "-" + oldEnd + ") is invalid after " + e); } else if (intervalStart() != myHighlighter.getStartOffset() || inte...
validateState
243,014
void (String message) { DocumentEx document = getDocument(); RangeMarkerTree.RMNode<RangeMarkerEx> node = myHighlighter instanceof RangeHighlighterImpl ? ((RangeHighlighterImpl)myHighlighter).myNode : null; LOG.error(message, new Attachment("document.txt", document instanceof DocumentImpl ? ((DocumentImpl)document).dum...
reportError
243,015
String () { String result = super.toString(); if (myNode.isFlagSet(RangeHighlighterTree.RHNode.IS_PERSISTENT)) { result += "(persistent)"; } return result; }
toString
243,016
VisibleEditorsTracker () { return ApplicationManager.getApplication().getService(VisibleEditorsTracker.class); }
getInstance
243,017
void (@NotNull CommandEvent event) { getInstance().commandStarted(); }
commandStarted
243,018
void (@NotNull CommandEvent event) { getInstance().commandFinished(); }
commandFinished
243,019
boolean (Editor editor) { return myEditorsVisibleOnCommandStart.contains(editor); }
wasEditorVisibleOnCommandStart
243,020
long () { return myCurrentCommandStart; }
getCurrentCommandStart
243,021
long () { return myLastCommandFinish; }
getLastCommandFinish
243,022
void () { for (Editor editor : EditorFactory.getInstance().getAllEditors()) { if (editor.getComponent().isShowing()) { myEditorsVisibleOnCommandStart.add(editor); } ((ScrollingModelImpl)editor.getScrollingModel()).finishAnimation(); myCurrentCommandStart = System.currentTimeMillis(); } }
commandStarted
243,023
void () { myEditorsVisibleOnCommandStart.clear(); myLastCommandFinish = System.currentTimeMillis(); }
commandFinished
243,024
GutterMark () { return mark; }
getMark
243,025
int () { return line; }
getLine
243,026
Point () { return location; }
getLocation
243,027
void (final @NotNull DocumentEvent e) { myIsInUpdate = false; myDocumentUpdateCounter++; if (!myEditor.getDocument().isInBulkUpdate()) { doWithCaretMerging(() -> {}); // do caret merging if it's not scheduled for later if (myVisualPositionUpdateScheduled) updateVisualPosition(); } }
documentChanged
243,028
void (@NotNull DocumentEvent e) { if (!myEditor.getDocument().isInBulkUpdate() && e.isWholeTextReplaced()) { for (CaretImpl caret : myCarets) { caret.updateCachedStateIfNeeded(); // logical position will be needed to restore caret position via diff } } myIsInUpdate = true; myVisualPositionUpdateScheduled = false; }
beforeDocumentChange
243,029
int () { return EditorDocumentPriorities.CARET_MODEL; }
getPriority
243,030
void () { for (CaretImpl caret : myCarets) { Disposer.dispose(caret); } mySelectionMarkerTree.dispose(myEditor.getDocument()); myPositionMarkerTree.dispose(myEditor.getDocument()); }
dispose
243,031
void () { for (CaretImpl caret : myCarets) { caret.updateVisualPosition(); } }
updateVisualPosition
243,032
void (final @NotNull CaretListener listener) { myCaretListeners.addListener(listener); }
addCaretListener
243,033
void (@NotNull CaretListener listener) { myCaretListeners.removeListener(listener); }
removeCaretListener
243,034
TextAttributes () { TextAttributes textAttributes = myTextAttributes; if (textAttributes == null) { myTextAttributes = textAttributes = new TextAttributes(); if (myEditor.getSettings().isCaretRowShown()) { textAttributes.setBackgroundColor(myEditor.getColorsScheme().getColor(EditorColors.CARET_ROW_COLOR)); } } return t...
getTextAttributes
243,035
void () { myTextAttributes = null; }
reinitSettings
243,036
boolean () { return true; }
supportsMultipleCarets
243,037
int () { return Math.max(1, MAX_CARET_COUNT.asInteger()); }
getMaxCaretCount
243,038
CaretImpl () { CaretImpl currentCaret = myCurrentCaret.get(); return currentCaret != null ? currentCaret : getPrimaryCaret(); }
getCurrentCaret
243,039
CaretImpl () { return myPrimaryCaret; }
getPrimaryCaret
243,040
int () { synchronized (myCarets) { return myCarets.size(); } }
getCaretCount
243,041
List<Caret> () { List<Caret> carets; synchronized (myCarets) { carets = new ArrayList<>(myCarets); } carets.sort(CARET_POSITION_COMPARATOR); return carets; }
getAllCarets
243,042
boolean (@NotNull Caret caret) { EditorImpl.assertIsDispatchThread(); if (myCarets.size() <= 1 || !(caret instanceof CaretImpl)) { return false; } synchronized (myCarets) { if (!myCarets.remove(caret)) { return false; } myPrimaryCaret = myCarets.getLast(); } fireCaretRemoved(caret); Disposer.dispose(caret); return true...
removeCaret
243,043
void () { EditorImpl.assertIsDispatchThread(); ListIterator<CaretImpl> caretIterator = myCarets.listIterator(myCarets.size() - 1); while (caretIterator.hasPrevious()) { CaretImpl caret = caretIterator.previous(); synchronized (myCarets) { caretIterator.remove(); } fireCaretRemoved(caret); Disposer.dispose(caret); } }
removeSecondaryCarets
243,044
void (final @NotNull CaretAction action) { runForEachCaret(action, false); }
runForEachCaret
243,045
void (final @NotNull CaretAction action, final boolean reverseOrder) { if (myCurrentCaret.get() != null) { throw new IllegalStateException("Recursive runForEachCaret invocations are not allowed"); } Runnable iteration = () -> { try { List<Caret> sortedCarets = getAllCarets(); Iterable<Caret> caretIterable = reverseOrde...
runForEachCaret
243,046
void (@NotNull CaretActionListener listener, @NotNull Disposable disposable) { myCaretActionListeners.addListener(listener, disposable); }
addCaretActionListener
243,047
void (@NotNull Runnable runnable) { EditorImpl.assertIsDispatchThread(); doWithCaretMerging(runnable); }
runBatchCaretOperation
243,048
void () { EditorImpl.assertIsDispatchThread(); if (myCarets.size() > 1) { LinkedList<CaretImpl> carets = new LinkedList<>(myCarets); carets.sort(CARET_POSITION_COMPARATOR); ListIterator<CaretImpl> it = carets.listIterator(); CaretImpl keepPrimary = getPrimaryCaret(); while (it.hasNext()) { CaretImpl prevCaret = null; i...
mergeOverlappingCaretsAndSelections
243,049
boolean (@NotNull CaretImpl firstCaret, @NotNull CaretImpl secondCaret) { if (firstCaret.getVisualPosition().equals(secondCaret.getVisualPosition())) { return true; } int firstStart = firstCaret.getSelectionStart(); int secondStart = secondCaret.getSelectionStart(); int firstEnd = firstCaret.getSelectionEnd(); int seco...
caretsOverlap
243,050
boolean (@NotNull CaretImpl firstCaret) { return firstCaret.getSelectionStart() == firstCaret.getSelectionEnd() && firstCaret.hasVirtualSelection(); }
hasPureVirtualSelection
243,051
void (final @NotNull List<? extends CaretState> caretStates) { setCaretsAndSelections(caretStates, true); }
setCaretsAndSelections
243,052
void (final @NotNull List<? extends CaretState> caretStates, final boolean updateSystemSelection) { if (caretStates.isEmpty()) { throw new IllegalArgumentException("At least one caret should exist"); } int maxCaretCount = getMaxCaretCount(); List<? extends CaretState> states; if (caretStates.size() <= maxCaretCount) { ...
setCaretsAndSelections
243,053
List<CaretState> () { synchronized (myCarets) { List<CaretState> states = new ArrayList<>(myCarets.size()); for (CaretImpl caret : myCarets) { states.add(new CaretState(caret.getLogicalPosition(), caret.myVisualColumnAdjustment, caret.getSelectionStartLogicalPosition(), caret.getSelectionEndLogicalPosition())); } retur...
getCaretsAndSelections
243,054
void (@NotNull Caret caret) { myCaretListeners.getMulticaster().caretAdded(new CaretEvent(caret, caret.getLogicalPosition(), caret.getLogicalPosition())); }
fireCaretAdded
243,055
void (@NotNull Caret caret) { myCaretListeners.getMulticaster().caretRemoved(new CaretEvent(caret, caret.getLogicalPosition(), caret.getLogicalPosition())); }
fireCaretRemoved
243,056
boolean () { return myCurrentCaret.get() != null; }
isIteratingOverCarets
243,057
String () { return "[in update: " + myIsInUpdate + ", update counter: " + myDocumentUpdateCounter + ", perform caret merging: " + myPerformCaretMergingAfterCurrentOperation + ", current caret: " + myCurrentCaret.get() + ", all carets: " + ContainerUtil.map(myCarets, CaretImpl::dumpState) + "]"; }
dumpState
243,058
void (@NotNull Inlay<?> inlay) { if (myEditor.getDocument().isInBulkUpdate() || myEditor.getInlayModel().isInBatchMode()) return; Inlay.Placement placement = inlay.getPlacement(); if (placement == Inlay.Placement.INLINE) { int offset = inlay.getOffset(); for (CaretImpl caret : myCarets) { caret.onInlayAdded(offset); } ...
onAdded
243,059
void (@NotNull Inlay<?> inlay) { if (myEditor.getDocument().isInBulkUpdate() || myEditor.getInlayModel().isInBatchMode()) return; Inlay.Placement placement = inlay.getPlacement(); if (myEditor.getDocument().isInEventsHandling()) { if (placement == Inlay.Placement.AFTER_LINE_END) myVisualPositionUpdateScheduled = true; ...
onRemoved
243,060
void (@NotNull Inlay<?> inlay, int changeFlags) { if (myEditor.getDocument().isInBulkUpdate() || myEditor.getInlayModel().isInBatchMode() || (changeFlags & (InlayModel.ChangeFlags.WIDTH_CHANGED | InlayModel.ChangeFlags.HEIGHT_CHANGED)) == 0) { return; } if (inlay.getPlacement() != Inlay.Placement.AFTER_LINE_END || hasC...
onUpdated
243,061
void (@NotNull Editor editor) { if (myEditor.getDocument().isInBulkUpdate()) return; doWithCaretMerging(() -> { for (CaretImpl caret : myCarets) { caret.resetCachedState(); caret.myVisualColumnAdjustment = 0; caret.updateVisualPosition(); } }); }
onBatchModeFinish
243,062
boolean () { return myEditor.getSettings().isVirtualSpace() && ContainerUtil.exists(myCarets, CaretImpl::isInVirtualSpace); }
hasCaretInVirtualSpace
243,063
void () { for (CaretImpl caret : myCarets) { caret.validateState(); } }
validateState
243,064
void () { updateSize(); }
exitDumbMode
243,065
void () { DnDSupport.createBuilder(this) .setBeanProvider(info -> { final GutterIconRenderer renderer = getGutterRenderer(info.getPoint()); if (renderer != null && renderer.getDraggableObject() != null && (info.isCopy() || info.isMove())) { myDnDInProgress = true; return new DnDDragStartBean(renderer); } return null; }...
installDnD
243,066
void () { processComponentEvent(new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED)); }
fireResized
243,067
Dimension () { int w = myLayout.getWidth(); Dimension size = new Dimension(w, myEditor.getPreferredHeight()); JBInsets.addTo(size, getInsets()); return size; }
getPreferredSize
243,068
void (ComponentUI newUI) { super.setUI(newUI); reinitSettings(true); }
setUI
243,069
void () { super.updateUI(); setRenderingHints(); reinitSettings(true); }
updateUI
243,070
void () { UISettings.setupEditorAntialiasing(this); putClientProperty(RenderingHints.KEY_FRACTIONALMETRICS, UISettings.getEditorFractionalMetricsHint()); }
setRenderingHints
243,071
void (boolean updateGutterSize) { updateFoldingOutlineVisibility(); updateSize(false, updateGutterSize); repaint(); }
reinitSettings
243,072
void () { myAlphaContext.setVisible( !ExperimentalUI.isNewUI() || myHovered || !EditorSettingsExternalizable.getInstance().isFoldingOutlineShownOnlyOnHover() ); }
updateFoldingOutlineVisibility
243,073
Graphics (Graphics graphics) { return JBSwingUtilities.runGlobalCGTransform(this, super.getComponentGraphics(graphics)); }
getComponentGraphics
243,074
void (Graphics g_) { ReadAction.run(() -> { Rectangle clip = g_.getClipBounds(); if (clip == null || clip.isEmpty()) { return; } Graphics2D g = (Graphics2D)getComponentGraphics(g_); if (myEditor.isDisposed()) { g.setColor(myEditor.getDisposedBackground()); g.fillRect(clip.x, clip.y, clip.width, clip.height); return; } ...
paintComponent
243,075
void (Graphics2D g) { if (!debug()) return; Point p = MouseInfo.getPointerInfo().getLocation(); SwingUtilities.convertPointFromScreen(p, this.myEditor.getComponent()); if (p.x >= 0 && p.x <= getWidth()) { int off = 0; for (EditorGutterLayout.GutterArea area : myLayout.getLayout()) { int x = off; off += area.width(); if...
debugGutterAreas
243,076
void (Graphics g, int firstVisibleOffset, int lastVisibleOffset) { myTextFgColors.clear(); Color defaultBackgroundColor = myEditor.getBackgroundColor(); Color defaultForegroundColor = myEditor.getColorsScheme().getDefaultForeground(); int startX = myEditor.isInDistractionFreeMode() ? 0 : ExperimentalUI.isNewUI() ? getW...
paintEditorBackgrounds
243,077
void (Graphics g, int startOffset, int endOffset, TextAttributes attributes, Color defaultBackgroundColor, Color defaultForegroundColor, int startX) { Color bgColor = myEditor.getBackgroundColor(attributes); if (Comparing.equal(bgColor, defaultBackgroundColor)) return; VisualPosition visualStart = myEditor.offsetToVisu...
drawEditorBackgroundForRange
243,078
void (final MouseEvent e) { final IdeEventQueue queue = IdeEventQueue.getInstance(); if (getGutterRenderer(e) != null) return; if (myEditor.getMouseEventArea(e) == EditorMouseEventArea.ANNOTATIONS_AREA) { queue.blockNextEvents(e); closeAllAnnotations(); e.consume(); } }
processClose
243,079
void (Graphics2D g, int startVisualLine, int endVisualLine) { int x = getAnnotationsAreaOffset(); int w = getAnnotationsAreaWidthEx(); if (w == 0) return; int viewportStartY = myEditor.getScrollingModel().getVisibleArea().y; AffineTransform old = setMirrorTransformIfNeeded(g, x, w); try { Color color = myEditor.getColo...
paintAnnotations
243,080
void (Graphics g, TextAnnotationGutterProvider gutterProvider, int line, int x, int y) { String s = gutterProvider.getLineText(line, myEditor); if (!StringUtil.isEmpty(s)) { g.setColor(myEditor.getColorsScheme().getColor(gutterProvider.getColor(line, myEditor))); EditorFontType style = gutterProvider.getStyle(line, myE...
paintAnnotationLine
243,081
Font (String text, EditorFontType style) { Font font = ExperimentalUI.isNewUI() ? JBFont.regular().deriveFont((float)myEditor.getFontSize()) : myEditor.getColorsScheme().getFont(style); return UIUtil.getFontWithFallbackIfNeeded(font, text); }
getFontForText
243,082
void (@NotNull Graphics g, @NotNull Rectangle clip, int firstVisibleOffset, int lastVisibleOffset) { if (isFoldingOutlineShown()) { doPaintFoldingTree((Graphics2D)g, clip, firstVisibleOffset, lastVisibleOffset); } }
paintFoldingTree
243,083
void (Graphics2D g, int firstVisibleOffset, int lastVisibleOffset, int firstVisibleLine, int lastVisibleLine) { if (isLineMarkersShown()) { paintGutterRenderers(g, firstVisibleOffset, lastVisibleOffset, firstVisibleLine, lastVisibleLine); } }
paintLineMarkers
243,084
void (final Graphics g, final Rectangle clip, final int x, final int width, Color background, Color caretRowColor) { g.setColor(background); g.fillRect(x, clip.y, width, clip.height); paintCaretRowBackground(g, x, width, caretRowColor); }
paintBackground
243,085
Color () { if (!myEditor.getSettings().isCaretRowShown()) { return null; } if (!Registry.is("highlight.caret.line.at.custom.fold") && isCaretAtCustomFolding()) { return null; } return myEditor.getColorsScheme().getColor(EditorColors.CARET_ROW_COLOR); }
getCaretRowColor
243,086
boolean () { FoldingModelImpl foldingModel = myEditor.getFoldingModel(); FoldRegion[] topLevelRegions = foldingModel.fetchTopLevel(); if (topLevelRegions == null) { return false; } int caretOffset = myEditor.getCaretModel().getOffset(); int idx = foldingModel.getLastCollapsedRegionBefore(caretOffset); if (idx >= 0) { F...
isCaretAtCustomFolding
243,087
void (final Graphics g, final int x, final int width, Color color) { if (color != null) { int caretLine = myEditor.getCaretModel().getVisualPosition().line; int[] yRange = myEditor.visualLineToYRange(caretLine); g.setColor(color); g.fillRect(x, yRange[0], width, yRange[1] - yRange[0]); } }
paintCaretRowBackground
243,088
void (Graphics2D g, int startVisualLine, int endVisualLine) { if (isLineNumbersShown()) { int offset = getLineNumberAreaOffset() + myLineNumberAreaWidth; doPaintLineNumbers(g, startVisualLine, endVisualLine, offset, getPrimaryLineNumberConverter()); if (myAdditionalLineNumberConverter != null) { doPaintLineNumbers(g, s...
paintLineNumbers
243,089
void (Graphics2D g) { if (myAccessibleGutterLine != null) { myAccessibleGutterLine.paint(g); } }
paintCurrentAccessibleLine
243,090
Color () { if (myEditor.isInDistractionFreeMode() || !myPaintBackground) { return myEditor.getBackgroundColor(); } if (ExperimentalUI.isNewUI()) { Color bg = myEditor.getColorsScheme().getColor(EditorColors.EDITOR_GUTTER_BACKGROUND); return bg == null ? myEditor.getBackgroundColor() : bg; } Color color = myEditor.getCo...
getBackground
243,091
Font () { Font editorFont = myEditor.getColorsScheme().getFont(EditorFontType.PLAIN); float editorFontSize = editorFont.getSize2D(); float delta = (float)AdvancedSettings.getInt("editor.gutter.linenumber.font.size.delta"); return editorFont.deriveFont(Math.max(1f, editorFontSize + delta)); }
getFontForLineNumbers
243,092
int (@NotNull String maxLineNumberText) { return FontLayoutService.getInstance().stringWidth(getFontMetrics(getFontForLineNumbers()), maxLineNumberText); }
calcLineNumbersAreaWidth
243,093
void (Graphics2D g, int startVisualLine, int endVisualLine, int offset, @NotNull LineNumberConverter converter) { int lastLine = myEditor.logicalToVisualPosition( new LogicalPosition(endLineNumber(), 0)) .line; endVisualLine = Math.min(endVisualLine, lastLine); if (startVisualLine > endVisualLine) { return; } Color col...
doPaintLineNumbers
243,094
int () { return Math.max(0, myEditor.getDocument().getLineCount() - 1); }
endLineNumber
243,095
boolean (RangeHighlighter h1, RangeHighlighter h2) { return h1 != null && (h2 == null || h1.getStartOffset() < h2.getStartOffset()); }
less
243,096
void () { updateSize(); }
revalidateMarkup
243,097
int () { int result = getLineMarkerAreaWidth(); result = 31 * result + myTextAnnotationGuttersSize; result = 31 * result + myTextAnnotationExtraSize; result = 31 * result + getLineNumberAreaWidth(); return result; }
sizeHash
243,098
void () { myTextAnnotationGuttersSize = 0; myGapAfterAnnotations = false; final int lineCount = Math.max(myEditor.getDocument().getLineCount(), 1); final int guttersCount = myTextAnnotationGutters.size(); for (int j = 0; j < guttersCount; j++) { TextAnnotationGutterProvider gutterProvider = myTextAnnotationGutters.get(...
calcAnnotationsSize
243,099
void () { myTextAnnotationExtraSize = 0; if (!myEditor.isInDistractionFreeMode() || isMirrored()) return; int marginFromSettings = AdvancedSettings.getInt(DISTRACTION_FREE_MARGIN); if (marginFromSettings != -1) { myTextAnnotationExtraSize = marginFromSettings; return; } Component outerContainer = ComponentUtil.findPare...
calcAnnotationExtraSize