Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
241,000
void (@NotNull Document document) { if (!project.isDisposed()) { listener.bulkUpdateStarting(document); } }
bulkUpdateStarting
241,001
void (@NotNull Document document) { if (!project.isDisposed()) { listener.bulkUpdateFinished(document); } }
bulkUpdateFinished
241,002
int () { return startOffsets.length + endOffsets.length; }
getOffsetCount
241,003
int (int @NotNull [] offsets, int index) { System.arraycopy(startOffsets, 0, offsets, index, startOffsets.length); System.arraycopy(endOffsets, 0, offsets, index + startOffsets.length, endOffsets.length); return index + getOffsetCount(); }
getOffsets
241,004
int (int @NotNull [] offsets, int index) { System.arraycopy(offsets, index, startOffsets, 0, startOffsets.length); System.arraycopy(offsets, index + startOffsets.length, endOffsets, 0, endOffsets.length); return index + getOffsetCount(); }
setOffsets
241,005
int () { return startOffsets.length; }
getCaretCount
241,006
boolean (@Nullable CaretStateTransferableData d1, @Nullable CaretStateTransferableData d2) { return (d1 == null || d1.getCaretCount() == 1) && (d2 == null || d2.getCaretCount() == 1) || d1 != null && d2 != null && Arrays.equals(d1.startOffsets, d2.startOffsets) && Arrays.equals(d1.endOffsets, d2.endOffsets); }
areEquivalent
241,007
SpellCheckingEditorCustomizationProvider () { return ApplicationManager.getApplication().getService(SpellCheckingEditorCustomizationProvider.class); }
getInstance
241,008
Set<String> () { return Collections.emptySet(); }
getSpellCheckingToolNames
241,009
List<String> (@NotNull String input, @Nullable CaretStateTransferableData caretData, int caretCount) { if (caretCount <= 0) { throw new IllegalArgumentException("Caret count must be positive"); } if (caretCount == 1) { return Collections.singletonList(input); } // // | caretData | input split by | split count | Nth car...
split
241,010
Editor () { return (Editor)getSource(); }
getEditor
241,011
RangeHighlighter () { return myHighlighter; }
getHighlighter
241,012
int () { return -1; }
getHoveredFreeMarkersLine
241,013
int () { return 0; }
getLineNumberAreaOffset
241,014
int () { return 0; }
getLineNumberAreaWidth
241,015
LineNumberConverter () { return LineNumberConverter.DEFAULT; }
getPrimaryLineNumberConverter
241,016
void (final Graphics g) { Graphics2D g2d = (Graphics2D)g; int lcdContrastValue = UIUtil.getLcdContrastValue(); g2d.setRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST, lcdContrastValue); g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, AntialiasingType.getKeyForCurrentScope(true)); UISettings.setupFractiona...
setupAntialiasing
241,017
void (Editor editor) { if (editor instanceof EditorImpl) { ((EditorImpl)editor).hideCursor(); } }
hideCursorInEditor
241,018
Icon (Icon icon, EditorImpl editor) { float scale = getEditorScaleFactor(editor); return scale == 1 ? icon : IconUtil.scale(icon, editor.getComponent(), scale); }
scaleIcon
241,019
int (int width, EditorImpl editor) { return (int)(getEditorScaleFactor(editor) * width); }
scaleWidth
241,020
float (@NotNull EditorImpl editor) { if (Registry.is("editor.scale.gutter.icons")) { float scale = editor.getScale(); if (Math.abs(1f - scale) > 0.10f) { return scale; } } return 1f; }
getEditorScaleFactor
241,021
void () { disposeMarker(); Rectangle visibleArea = myEditor.getScrollingModel().getVisibleAreaOnScrollingFinished(); int caretY = myEditor.visualLineToY(myEditor.getCaretModel().getVisualPosition().line); if (visibleArea.height > 0 && (caretY + myEditor.getLineHeight() <= visibleArea.y || caretY >= (visibleArea.y + vis...
savePosition
241,022
void (boolean stopAnimation) { int newY; if (myTopLeftCornerMarker == null) { newY = myEditor.visualLineToY(myEditor.getCaretModel().getVisualPosition().line); } else { if (!myTopLeftCornerMarker.isValid()) return; newY = myEditor.offsetToXY(myTopLeftCornerMarker.getStartOffset()).y; } ScrollingModel scrollingModel = m...
restorePosition
241,023
void () { disposeMarker(); }
dispose
241,024
void () { if (myTopLeftCornerMarker != null) myTopLeftCornerMarker.dispose(); }
disposeMarker
241,025
void (@Nullable Editor editor, boolean stopAnimation, @NotNull Runnable operation) { if (editor == null || editor instanceof ImaginaryEditor) { operation.run(); return; } EditorScrollingPositionKeeper keeper = new EditorScrollingPositionKeeper(editor); keeper.savePosition(); try { operation.run(); keeper.restorePositio...
perform
241,026
void (@Nullable Document document, boolean stopAnimation, @NotNull Runnable runnable) { EditorScrollingPositionKeeper.ForDocument keeper = new EditorScrollingPositionKeeper.ForDocument(document); keeper.savePosition(); try { runnable.run(); keeper.restorePosition(stopAnimation); } finally { Disposer.dispose(keeper); } ...
perform
241,027
void () { myKeepers.forEach(EditorScrollingPositionKeeper::savePosition); }
savePosition
241,028
void (boolean stopAnimation) { myKeepers.forEach(k -> k.restorePosition(stopAnimation)); }
restorePosition
241,029
void () { myKeepers.forEach(Disposer::dispose); }
dispose
241,030
boolean (@Nullable Editor editor) { return editor != null && TextEditorProvider.getInstance().getTextEditor(editor) instanceof TextEditorImpl; }
isRealFileEditor
241,031
boolean (@Nullable Editor editor) { return editor != null && editor.getContentComponent() instanceof JPasswordField; }
isPasswordEditor
241,032
int (@NotNull Editor editor, final int line) { if (editor instanceof EditorImpl editorImpl) { int lineEndOffset = line >= editorImpl.getVisibleLineCount() ? editor.getDocument().getTextLength() : new VisualLinesIterator(editorImpl, line).getVisualLineEndOffset(); return editor.offsetToVisualPosition(lineEndOffset, true...
getLastVisualLineColumnNumber
241,033
int (@NotNull Editor editor, int line) { return ReadAction.compute(() -> { VisualPosition endLineVisualPosition = new VisualPosition(line, getLastVisualLineColumnNumber(editor, line)); return editor.visualPositionToOffset(endLineVisualPosition); }); }
getVisualLineEndOffset
241,034
float (@NotNull Editor editor) { return ReadAction.compute(() -> { Rectangle viewArea = editor.getScrollingModel().getVisibleAreaOnScrollingFinished(); if (viewArea.height == 0) { return 0f; } LogicalPosition pos = editor.getCaretModel().getLogicalPosition(); Point location = editor.logicalPositionToXY(pos); return (lo...
calcVerticalScrollProportion
241,035
void (@NotNull Editor editor, float proportion) { ReadAction.run(() -> { Rectangle viewArea = editor.getScrollingModel().getVisibleArea(); LogicalPosition caretPosition = editor.getCaretModel().getLogicalPosition(); Point caretLocation = editor.logicalPositionToXY(caretPosition); int yPos = caretLocation.y; yPos -= vie...
setVerticalScrollProportion
241,036
int (@NotNull Editor editor) { return ReadAction.compute(() -> { int caretY = editor.visualLineToY(editor.getCaretModel().getVisualPosition().line); int viewAreaPosition = editor.getScrollingModel().getVisibleAreaOnScrollingFinished().y; return caretY - viewAreaPosition; }); }
calcRelativeCaretPosition
241,037
void (@NotNull Editor editor, int position) { ReadAction.run(() -> { int caretY = editor.visualLineToY(editor.getCaretModel().getVisualPosition().line); editor.getScrollingModel().scrollVertically(caretY - position); }); }
setRelativeCaretPosition
241,038
void (@NotNull Editor editor) { final LogicalPosition position = editor.getCaretModel().getLogicalPosition(); fillVirtualSpaceUntil(editor, position.column, position.line); }
fillVirtualSpaceUntilCaret
241,039
void (final @NotNull Editor editor, int columnNumber, int lineNumber) { final int offset = editor.logicalPositionToOffset(new LogicalPosition(lineNumber, columnNumber)); final String filler = EditorModificationUtilEx.calcStringToFillVirtualSpace(editor); if (!filler.isEmpty()) { WriteAction.run(() -> { editor.getDocume...
fillVirtualSpaceUntil
241,040
int (int colNumber, int tabSize) { if (tabSize <= 0) { tabSize = 1; } return tabSize - colNumber % tabSize; }
getTabLength
241,041
int (@NotNull Editor editor, @NotNull CharSequence text, int start, int offset) { return calcColumnNumber(editor, text, start, offset, getTabSize(editor)); }
calcColumnNumber
241,042
int (@Nullable Editor editor, @NotNull CharSequence text, final int start, final int offset, final int tabSize) { if (editor instanceof TextComponentEditor) { return offset - start; } boolean useOptimization = true; if (editor != null) { SoftWrap softWrap = editor.getSoftWrapModel().getSoftWrap(start); useOptimization ...
calcColumnNumber
241,043
FontInfo (final char c, @JdkConstants.FontStyle int style, @NotNull Editor editor) { return ReadAction.compute(() -> { EditorColorsScheme colorsScheme = editor.getColorsScheme(); return ComplementaryFontsRegistry.getFontAbleToDisplay(c, style, colorsScheme.getFontPreferences(), FontInfo.getFontRenderContext(editor.getC...
fontForChar
241,044
Icon (Icon icon, Editor editor) { if (Registry.is("editor.scale.gutter.icons") && editor instanceof EditorImpl && icon instanceof ScalableIcon) { float scale = ((EditorImpl)editor).getScale(); if (Math.abs(1f - scale) > 0.1f) { return ((ScalableIcon)icon).scale(scale); } } return icon; }
scaleIconAccordingEditorFont
241,045
int (char c, @JdkConstants.FontStyle int fontType, @NotNull Editor editor) { return fontForChar(c, fontType, editor).charWidth(c); }
charWidth
241,046
int (@JdkConstants.FontStyle int fontType, @NotNull Editor editor) { int width = charWidth(' ', fontType, editor); return width > 0 ? width : 1; }
getSpaceWidth
241,047
int (@NotNull Editor editor) { return getSpaceWidth(Font.PLAIN, editor); }
getPlainSpaceWidth
241,048
int (@NotNull Editor editor) { return editor.getSettings().getTabSize(editor.getProject()); }
getTabSize
241,049
int (int x, @NotNull Editor editor) { int tabSize = getTabSize(editor); if (tabSize <= 0) { tabSize = 1; } return nextTabStop(x, editor, tabSize); }
nextTabStop
241,050
int (int x, @NotNull Editor editor, int tabSize) { int leftInset = ReadAction.compute(() -> editor.getContentComponent().getInsets().left); return nextTabStop(x - leftInset, getSpaceWidth(Font.PLAIN, editor), tabSize) + leftInset; }
nextTabStop
241,051
int (int x, int plainSpaceWidth, int tabSize) { if (tabSize <= 0) { return x + plainSpaceWidth; } tabSize *= plainSpaceWidth; int nTabs = x / tabSize; return (nTabs + 1) * tabSize; }
nextTabStop
241,052
float (float x, float plainSpaceWidth, int tabSize) { if (tabSize <= 0) { return x + plainSpaceWidth; } float tabSizePixels = tabSize * plainSpaceWidth; int nTabs = (int)((x + plainSpaceWidth / 2) / tabSizePixels); return (nTabs + 1) * tabSizePixels; }
nextTabStop
241,053
int (@NotNull Editor editor, @NotNull CharSequence text, int start, int end, int x) { int startToUse = start; int lastTabSymbolIndex = -1; // Skip all lines except the last. loop: for (int i = end - 1; i >= start; i--) { switch (text.charAt(i)) { case '\n': startToUse = i + 1; break loop; case '\t': if (lastTabSymbolIn...
textWidthInColumns
241,054
int (int width, int plainSpaceSize) { int result = width / plainSpaceSize; if (width % plainSpaceSize > 0) { result++; } return result; }
columnsNumber
241,055
int (float width, float plainSpaceSize) { return (int)Math.ceil(width / plainSpaceSize); }
columnsNumber
241,056
int (@NotNull Editor editor, @NotNull CharSequence text, int start, int end, @JdkConstants.FontStyle int fontType, int x) { int result = 0; for (int i = start; i < end; i++) { char c = text.charAt(i); if (c != '\t') { FontInfo font = fontForChar(c, fontType, editor); result += font.charWidth(c); continue; } result += n...
textWidth
241,057
TextRange (@NotNull Editor editor) { return logicalPairToTextRange(editor, calcCaretLineRange(editor)); }
calcCaretLineTextRange
241,058
TextRange (@NotNull Caret caret) { return logicalPairToTextRange(caret.getEditor(), calcCaretLineRange(caret)); }
calcCaretLineTextRange
241,059
TextRange (@NotNull Editor editor, @NotNull VisualPosition start, @NotNull VisualPosition end) { return logicalPairToTextRange(editor, calcSurroundingRange(editor, start, end)); }
calcSurroundingTextRange
241,060
TextRange (@NotNull Editor editor, @NotNull Pair<LogicalPosition, LogicalPosition> logicalPair) { return TextRange.create(editor.logicalPositionToOffset(logicalPair.first), editor.logicalPositionToOffset(logicalPair.second)); }
logicalPairToTextRange
241,061
int (@NotNull Editor editor, int offset) { return getNotFoldedLineStartOffset(editor, offset, false); }
getNotFoldedLineStartOffset
241,062
int (@NotNull Editor editor, int startOffset, boolean stopAtInvisibleFoldRegions) { return ReadAction.compute(() -> { int offset = startOffset; while (true) { offset = DocumentUtil.getLineStartOffset(offset, editor.getDocument()); FoldRegion foldRegion = editor.getFoldingModel().getCollapsedRegionAtOffset(offset - 1); ...
getNotFoldedLineStartOffset
241,063
int (@NotNull Editor editor, int offset) { return getNotFoldedLineEndOffset(editor, offset, false); }
getNotFoldedLineEndOffset
241,064
int (@NotNull Editor editor, int startOffset, boolean stopAtInvisibleFoldRegions) { return ReadAction.compute(() -> { int offset = startOffset; while (true) { offset = getLineEndOffset(offset, editor.getDocument()); FoldRegion foldRegion = editor.getFoldingModel().getCollapsedRegionAtOffset(offset); if (foldRegion == n...
getNotFoldedLineEndOffset
241,065
int (int offset, Document document) { if (offset >= document.getTextLength()) { return offset; } int lineNumber = document.getLineNumber(offset); return document.getLineEndOffset(lineNumber); }
getLineEndOffset
241,066
void (@NotNull Editor editor) { scrollToTheEnd(editor, false); }
scrollToTheEnd
241,067
void (@NotNull Editor editor, boolean preferVerticalScroll) { editor.getSelectionModel().removeSelection(); Document document = editor.getDocument(); int lastLine = Math.max(0, document.getLineCount() - 1); boolean caretWasAtLastLine = editor.getCaretModel().getLogicalPosition().line == lastLine; editor.getCaretModel()...
scrollToTheEnd
241,068
boolean (@NotNull MouseWheelEvent e) { if (e.getWheelRotation() == 0) return false; return SystemInfo.isMac ? !e.isControlDown() && e.isMetaDown() && !e.isAltDown() && !e.isShiftDown() : e.isControlDown() && !e.isMetaDown() && !e.isAltDown() && !e.isShiftDown(); }
isChangeFontSize
241,069
boolean (@NotNull Editor editor) { return inVirtualSpace(editor, editor.getCaretModel().getLogicalPosition()); }
isCaretInVirtualSpace
241,070
boolean (@NotNull Editor editor, @NotNull LogicalPosition logicalPosition) { return EditorCoreUtil.inVirtualSpace(editor, logicalPosition); }
inVirtualSpace
241,071
void () { EditorFactory.getInstance().refreshAllEditors(); }
reinitSettings
241,072
TextRange (Editor editor) { return ReadAction.compute(() -> { List<Caret> carets = editor.getCaretModel().getAllCarets(); return carets.get(0).getSelectionRange().union(carets.get(carets.size() - 1).getSelectionRange()); }); }
getSelectionInAnyMode
241,073
int (@NotNull Editor editor, int logicalLine) { return ReadAction.compute(() -> { LogicalPosition logicalPosition = new LogicalPosition(logicalLine, 0); VisualPosition visualPosition = editor.logicalToVisualPosition(logicalPosition); return visualPosition.line; }); }
logicalToVisualLine
241,074
Interval (@NotNull Editor editor, int y) { return ReadAction.compute(() -> { int visualLine = editor.yToVisualLine(y); if (editor instanceof EditorImpl) { VisualLinesIterator iterator = new VisualLinesIterator((EditorImpl)editor, visualLine); if (!iterator.atEnd()) { return new TextRangeInterval(iterator.getStartLogica...
yToLogicalLineRange
241,075
int (@NotNull Editor editor, @NotNull MouseEvent event) { return yPositionToLogicalLine(editor, event.getY()); }
yPositionToLogicalLine
241,076
int (@NotNull Editor editor, @NotNull Point point) { return yPositionToLogicalLine(editor, point.y); }
yPositionToLogicalLine
241,077
int (@NotNull Editor editor, int y) { return ReadAction.compute(() -> { int line = editor instanceof EditorImpl ? editor.yToVisualLine(y) : y / editor.getLineHeight(); return editor.visualToLogicalPosition(new VisualPosition(line, 0)).line; }); }
yPositionToLogicalLine
241,078
int (@NotNull Editor editor, int y) { return ReadAction.compute(() -> { int visualLine = editor.yToVisualLine(y); int visualLineStartY = editor.visualLineToY(visualLine); if (y < visualLineStartY || y >= visualLineStartY + editor.getLineHeight()) return -1; int line = editor.visualToLogicalPosition(new VisualPosition(v...
yToLogicalLineNoCustomRenderers
241,079
boolean (@NotNull Editor editor, int offset) { return ReadAction.compute(() -> { Document document = editor.getDocument(); if (offset < 0 || offset > document.getTextLength()) { return false; } int line = document.getLineNumber(offset); return offset == document.getLineEndOffset(line); }); }
isAtLineEnd
241,080
void (@NotNull Editor editor, int startOffset, int endOffset) { ReadAction.run(() -> { FoldingModel foldingModel = editor.getFoldingModel(); FoldRegion startFoldRegion = foldingModel.getCollapsedRegionAtOffset(startOffset); if (startFoldRegion != null && (startFoldRegion.getStartOffset() == startOffset || startFoldRegi...
setSelectionExpandingFoldedRegionsIfNeeded
241,081
Font () { return ReadAction.compute(() -> { float fontSize = UISettingsUtils.getInstance().getScaledEditorFontSize(); if (UISettings.getInstance().getPresentationMode()) { fontSize -= 4f; } EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); Font editorFont = scheme.getFont(EditorFontType.P...
getEditorFont
241,082
Font (int size) { return ReadAction.compute(() -> { EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); Font font = scheme.getFont(EditorFontType.PLAIN).deriveFont((float)size); return UIUtil.getFontWithFallback(font); }); }
getEditorFont
241,083
int () { return Registry.intValue("editor.caret.width", 2); }
getDefaultCaretWidth
241,084
int (@NotNull Editor editor, @NotNull LogicalPosition position) { return ReadAction.compute(() -> { int startOffset = editor.getDocument().getLineStartOffset(position.line); int endOffset = editor.logicalPositionToOffset(position); return editor.getSoftWrapModel().getSoftWrapsForRange(startOffset, endOffset).size(); })...
getSoftWrapCountAfterLineStart
241,085
boolean (@Nullable TextAttributes attributes) { return attributes == TextAttributes.ERASE_MARKER || (attributes != null && (attributes.getFontType() != Font.PLAIN || attributes.getForegroundColor() != null)); }
attributesImpactFontStyleOrColor
241,086
boolean (@Nullable TextAttributes attributes) { return attributes == TextAttributes.ERASE_MARKER || (attributes != null && attributes.getFontType() != Font.PLAIN); }
attributesImpactFontStyle
241,087
boolean (@Nullable TextAttributes attributes) { return attributes == TextAttributes.ERASE_MARKER || (attributes != null && attributes.getForegroundColor() != null); }
attributesImpactForegroundColor
241,088
boolean (@NotNull Editor editor) { return editor.getCaretModel().getCurrentCaret() == editor.getCaretModel().getPrimaryCaret(); }
isCurrentCaretPrimary
241,089
void (@NotNull Editor editor, @NotNull Disposable disposable) { ThreadingAssertions.assertEventDispatchThread(); ReadAction.run(() -> { if (editor.isDisposed()) { Disposer.dispose(disposable); return; } // for injected editors disposal will happen only when host editor is disposed, // but this seems to be the best we c...
disposeWithEditor
241,090
void (@NotNull Editor editor, @NotNull Runnable operation) { if (editor.getDocument().isInBulkUpdate()) { Disposable disposable = Disposer.newDisposable(); disposeWithEditor(editor, disposable); editor.getDocument().addDocumentListener(new DocumentListener() { @Override public void bulkUpdateFinished(@NotNull Document ...
runBatchFoldingOperationOutsideOfBulkUpdate
241,091
void (@NotNull Document document) { editor.getFoldingModel().runBatchFoldingOperation(operation); Disposer.dispose(disposable); }
bulkUpdateFinished
241,092
void (@NotNull Editor editor, @NotNull Runnable taskWithScrolling) { ScrollingModel scrollingModel = editor.getScrollingModel(); if (!(scrollingModel instanceof ScrollingModelImpl)) { taskWithScrolling.run(); } else { boolean animationWasEnabled = ((ScrollingModelImpl)scrollingModel).isAnimationEnabled(); scrollingMode...
runWithAnimationDisabled
241,093
String (char c, @NotNull TextAttributesKey textAttributesKey, @NotNull String fallback) { EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); TextAttributes textAttributes = scheme.getAttributes(textAttributesKey); int style = textAttributes != null ? textAttributes.getFontType() : Font.PLA...
displayCharInEditor
241,094
VisualPosition (@NotNull Editor editor, int offset) { return ReadAction.compute(() -> { Editor e = editor; LogicalPosition logicalPosition = e.offsetToLogicalPosition(offset); if (e instanceof EditorWindow) { logicalPosition = ((EditorWindow)e).injectedToHost(logicalPosition); e = ((EditorWindow)e).getDelegate(); } Vis...
inlayAwareOffsetToVisualPosition
241,095
int (@NotNull List<? extends Inlay> inlays) { int sum = 0; for (Inlay inlay : inlays) { sum += inlay.getHeightInPixels(); } return sum; }
getTotalInlaysHeight
241,096
int (@NotNull Editor editor, int visualLine, boolean above) { return getTotalInlaysHeight(editor.getInlayModel().getBlockElementsForVisualLine(visualLine, above)); }
getInlaysHeight
241,097
boolean (@NotNull Inlay inlay) { if (showWhenFolded(inlay)) { return false; } return ReadAction.compute(() -> { Editor editor = inlay.getEditor(); Inlay.Placement placement = inlay.getPlacement(); int offset = inlay.getOffset(); if (placement == Inlay.Placement.AFTER_LINE_END) { offset = DocumentUtil.getLineEndOffset(o...
isInlayFolded
241,098
int (@NotNull Editor editor, int visualLine) { return ReadAction.compute(() -> editor.visualLineToY(visualLine) - getInlaysHeight(editor, visualLine, true)); }
getVisualLineAreaStartY
241,099
int (@NotNull Editor editor, int visualLine) { return ReadAction.compute(() -> editor.visualLineToYRange(visualLine)[1] + getInlaysHeight(editor, visualLine, false)); }
getVisualLineAreaEndY