Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
243,300
LogicalPosition (int offset) { return myMapper.offsetToLogicalPosition(offset); }
offsetToLogicalPosition
243,301
int (@NotNull LogicalPosition pos) { return myMapper.logicalPositionToOffset(pos); }
logicalPositionToOffset
243,302
VisualPosition (@NotNull LogicalPosition pos, boolean beforeSoftWrap) { assertNotInBulkMode(); myEditor.getSoftWrapModel().prepareToMapping(); return myMapper.logicalToVisualPosition(pos, beforeSoftWrap); }
logicalToVisualPosition
243,303
LogicalPosition (@NotNull VisualPosition pos) { assertNotInBulkMode(); myEditor.getSoftWrapModel().prepareToMapping(); return myMapper.visualToLogicalPosition(pos); }
visualToLogicalPosition
243,304
VisualPosition (int offset, boolean leanTowardsLargerOffsets, boolean beforeSoftWrap) { assertNotInBulkMode(); myEditor.getSoftWrapModel().prepareToMapping(); return myMapper.offsetToVisualPosition(offset, leanTowardsLargerOffsets, beforeSoftWrap); }
offsetToVisualPosition
243,305
int (VisualPosition visualPosition) { assertNotInBulkMode(); myEditor.getSoftWrapModel().prepareToMapping(); return myMapper.visualPositionToOffset(visualPosition); }
visualPositionToOffset
243,306
int (int offset, boolean beforeSoftWrap) { assertNotInBulkMode(); myEditor.getSoftWrapModel().prepareToMapping(); return myMapper.offsetToVisualLine(offset, beforeSoftWrap); }
offsetToVisualLine
243,307
int (int visualLine) { assertNotInBulkMode(); myEditor.getSoftWrapModel().prepareToMapping(); return myMapper.visualLineToOffset(visualLine); }
visualLineToOffset
243,308
VisualPosition (@NotNull Point2D p) { assertNotInBulkMode(); myEditor.getSoftWrapModel().prepareToMapping(); return myMapper.xyToVisualPosition(p); }
xyToVisualPosition
243,309
Point2D (@NotNull VisualPosition pos) { assertNotInBulkMode(); myEditor.getSoftWrapModel().prepareToMapping(); return myMapper.visualPositionToXY(pos); }
visualPositionToXY
243,310
Point2D (int offset, boolean leanTowardsLargerOffsets, boolean beforeSoftWrap) { assertNotInBulkMode(); myEditor.getSoftWrapModel().prepareToMapping(); return myMapper.offsetToXY(offset, leanTowardsLargerOffsets, beforeSoftWrap); }
offsetToXY
243,311
void (String prefixText, TextAttributes attributes) { myPrefixText = prefixText; synchronized (myLock) { myPrefixLayout = prefixText == null || prefixText.isEmpty() ? null : LineLayout.create(this, prefixText, attributes.getFontType()); } myPrefixAttributes = attributes; mySizeManager.invalidateRange(0, 0); }
setPrefix
243,312
float () { LineLayout layout = getPrefixLayout(); return layout == null ? 0 : layout.getWidth(); }
getPrefixTextWidthInPixels
243,313
void (Graphics2D g) { myEditor.getSoftWrapModel().prepareToMapping(); checkFontRenderContext(g.getFontRenderContext()); myPainter.paint(g); }
paint
243,314
void () { myPainter.repaintCarets(); }
repaintCarets
243,315
Dimension () { assert !myEditor.isPurePaintingMode(); myEditor.getSoftWrapModel().prepareToMapping(); return mySizeManager.getPreferredSize(); }
getPreferredSize
243,316
int (int beginLine, int endLine) { assert !myEditor.isPurePaintingMode(); myEditor.getSoftWrapModel().prepareToMapping(); return mySizeManager.getPreferredWidth(beginLine, endLine); }
getPreferredWidth
243,317
int () { assert !myEditor.isPurePaintingMode(); myEditor.getSoftWrapModel().prepareToMapping(); return mySizeManager.getPreferredHeight(); }
getPreferredHeight
243,318
int (int startOffset, int endOffset) { int startVisualLine = offsetToVisualLine(startOffset, false); int endVisualLine = offsetToVisualLine(endOffset, true); return getMaxTextWidthInLineRange(startVisualLine, endVisualLine) + getInsets().left; }
getMaxWidthInRange
243,319
void () { synchronized (myLock) { myPlainSpaceWidth = -1; myTabSize = -1; setFontRenderContext(null); } myBidiFlags = switch (EditorSettingsExternalizable.getInstance().getBidiTextDirection()) { case LTR -> Bidi.DIRECTION_LEFT_TO_RIGHT; case RTL -> Bidi.DIRECTION_RIGHT_TO_LEFT; default -> Bidi.DIRECTION_DEFAULT_LEFT_TO...
reinitSettings
243,320
void (int startOffset, int endOffset, boolean invalidateSize) { int textLength = myDocument.getTextLength(); if (startOffset > endOffset || startOffset >= textLength || endOffset < 0) { return; } int startLine = myDocument.getLineNumber(Math.max(0, startOffset)); int endLine = myDocument.getLineNumber(Math.min(textLeng...
invalidateRange
243,321
void () { myLogicalPositionCache.reset(true); myTextLayoutCache.resetToDocumentSize(true); mySizeManager.reset(); }
reset
243,322
boolean (@NotNull VisualPosition visualPosition) { if (myDocument.getTextLength() == 0) return false; LogicalPosition logicalPosition = visualToLogicalPosition(visualPosition); int offset = logicalPositionToOffset(logicalPosition); if (!logicalPosition.equals(offsetToLogicalPosition(offset))) return false; // virtual s...
isRtlLocation
243,323
boolean (@NotNull VisualPosition visualPosition) { int offset = visualPositionToOffset(visualPosition); int otherSideOffset = visualPositionToOffset(visualPosition.leanRight(!visualPosition.leansRight)); return offset != otherSideOffset; }
isAtBidiRunBoundary
243,324
int (int offset, boolean lookForward) { int textLength = myDocument.getTextLength(); if (textLength == 0 || offset < 0 || offset > textLength) return -1; int line = myDocument.getLineNumber(offset); LineLayout layout = myTextLayoutCache.getLineLayout(line); int lineStartOffset = myDocument.getLineStartOffset(line); int...
findNearestDirectionBoundary
243,325
float () { synchronized (myLock) { initMetricsIfNeeded(); return myPlainSpaceWidth; } }
getPlainSpaceWidth
243,326
int () { synchronized (myLock) { initMetricsIfNeeded(); return myEditor.getSettings().isFullLineHeightCursor() ? myLineHeight : myLineHeight + myTopOverhang + myBottomOverhang; } }
getCaretHeight
243,327
int () { synchronized (myLock) { initMetricsIfNeeded(); return myLineHeight; } }
getLineHeight
243,328
float () { if (myEditor.isOneLineMode()) return 1; float lineSpacing = myEditor.getColorsScheme().getLineSpacing(); return lineSpacing > 0 ? lineSpacing : 1; }
getVerticalScalingFactor
243,329
int () { synchronized (myLock) { return myDescent; } }
getDescent
243,330
int () { synchronized (myLock) { initMetricsIfNeeded(); return myCharHeight; } }
getCharHeight
243,331
int () { synchronized (myLock) { initMetricsIfNeeded(); return myLineHeight - myDescent; } }
getAscent
243,332
int () { synchronized (myLock) { initMetricsIfNeeded(); return myTopOverhang; } }
getTopOverhang
243,333
int () { synchronized (myLock) { initMetricsIfNeeded(); return myBottomOverhang; } }
getBottomOverhang
243,334
void () { if (myPlainSpaceWidth >= 0) return; Font font = myEditor.getColorsScheme().getFont(EditorFontType.PLAIN); FontMetrics fm = FontInfo.getFontMetrics(font, myFontRenderContext); float width = FontLayoutService.getInstance().charWidth2D(fm, ' '); myPlainSpaceWidth = width > 0 ? width : 1; myCharHeight = FontLayou...
initMetricsIfNeeded
243,335
int () { synchronized (myLock) { if (myTabSize < 0) { myTabSize = EditorUtil.getTabSize(myEditor); } return myTabSize; } }
getTabSize
243,336
boolean (FontRenderContext context) { FontRenderContext contextToSet = context == null ? FontInfo.getFontRenderContext(myEditor.getContentComponent()) : context; if (areEqualContexts(myFontRenderContext, contextToSet)) return false; AffineTransform transform = contextToSet.getTransform(); if (transform.getDeterminant()...
setFontRenderContext
243,337
void (FontRenderContext context) { boolean contextUpdated = false; synchronized (myLock) { if (setFontRenderContext(context)) { myPlainSpaceWidth = -1; contextUpdated = true; } } if (contextUpdated) { myTextLayoutCache.resetToDocumentSize(false); invalidateFoldRegionLayouts(); myCharWidthCache.clear(); myEditor.getFold...
checkFontRenderContext
243,338
boolean (FontRenderContext c1, FontRenderContext c2) { if (c1 == c2) return true; if (c1 == null || c2 == null) return false; // We ignore fractional metrics aspect of contexts, because we it's not changing during editor's lifecycle. // And it has different values for component graphics (ON/OFF) and component's font me...
areEqualContexts
243,339
int (@NotNull FoldRegion region, int offset, boolean leanTowardsLargerOffsets) { if (offset < 0 || offset == 0 && !leanTowardsLargerOffsets) return 0; String text = region.getPlaceholderText(); if (offset > text.length()) { offset = text.length(); leanTowardsLargerOffsets = true; } int logicalColumn = LogicalPositionCa...
offsetToVisualColumnInFoldRegion
243,340
int (@NotNull FoldRegion region, int visualColumn, boolean leansRight) { if (visualColumn < 0 || visualColumn == 0 && !leansRight) return 0; String text = region.getPlaceholderText(); for (LineLayout.VisualFragment fragment : getFoldRegionLayout(region).getFragmentsInVisualOrder(0)) { int startVC = fragment.getStartVis...
visualColumnToOffsetInFoldRegion
243,341
void () { ReadAction.run(() -> { for (FoldRegion region : myEditor.getFoldingModel().getAllFoldRegions()) { invalidateFoldRegionLayout(region); } }); }
invalidateFoldRegionLayouts
243,342
void (FoldRegion region) { region.putUserData(FOLD_REGION_TEXT_LAYOUT, null); }
invalidateFoldRegionLayout
243,343
void (@NotNull Graphics g, char @NotNull [] data, int start, int end, int x, int y, @NotNull Color color, @NotNull FontInfo fontInfo) { myPainter.drawChars(g, data, start, end, x, y, color, fontInfo); }
drawChars
243,344
String () { String prefixText = myPrefixText; TextAttributes prefixAttributes = myPrefixAttributes; synchronized (myLock) { return "[prefix text: " + prefixText + ", prefix attributes: " + prefixAttributes + ", space width: " + myPlainSpaceWidth + ", line height: " + myLineHeight + ", descent: " + myDescent + ", char h...
dumpState
243,345
void () { myLogicalPositionCache.validateState(); mySizeManager.validateState(); }
validateState
243,346
void () { if (myDocument instanceof DocumentImpl) { ((DocumentImpl)myDocument).assertNotInBulkUpdate(); } else if (myDocument.isInBulkUpdate()) { throw new IllegalStateException("Current operation is not permitted in bulk mode"); } if (myEditor.getInlayModel().isInBatchMode()) { throw new IllegalStateException("Current...
assertNotInBulkMode
243,347
void (List<? super LineFragment> fragments, char[] lineChars, int start, int end, boolean isRtl, FontInfo fontInfo) { boolean needsLayout = isRtl || fontInfo.getFont().hasLayoutAttributes(); boolean nonLatinText = false; if (!needsLayout && (containsSurrogatePairs(lineChars, start, end) || Font.textRequiresLayout(lineC...
createTextFragments
243,348
boolean (char[] chars, int start, int end) { end--; // no need to check last character for high surrogate for (int i = start; i < end; i++) { if (Character.isHighSurrogate(chars[i]) && Character.isLowSurrogate(chars[i + 1])) { return true; } } return false; }
containsSurrogatePairs
243,349
boolean (char[] chars, int start, int end) { for (int i = start; i < end; i++) { if (chars[i] >= 0x2ea /* first non-Latin code point */) return true; } return false; }
containsNonLatinText
243,350
void () { trimChunkCache(); }
hideNotify
243,351
int () { return EditorDocumentPriorities.EDITOR_TEXT_LAYOUT_CACHE; }
getPriority
243,352
void (@NotNull DocumentEvent event) { myDocumentChangeOldEndLine = getAdjustedLineNumber(event.getOffset() + event.getOldLength()); }
beforeDocumentChange
243,353
void (@NotNull DocumentEvent event) { int startLine = myDocument.getLineNumber(event.getOffset()); int newEndLine = getAdjustedLineNumber(event.getOffset() + event.getNewLength()); invalidateLines(startLine, myDocumentChangeOldEndLine, newEndLine, true, LineLayout.isBidiLayoutRequired(event.getNewFragment())); if (myLi...
documentChanged
243,354
void () { myLines = null; laidOutChunks.clear(); }
dispose
243,355
int (int offset) { return myDocument.getTextLength() == 0 ? -1 : myDocument.getLineNumber(offset); }
getAdjustedLineNumber
243,356
void (int startLine, int oldEndLine, int newEndLine, boolean textChanged, boolean bidiRequiredForNewText) { checkDisposed(); if (textChanged) { LineLayout firstOldLine = startLine >= 0 && startLine < myLines.size() ? myLines.get(startLine) : null; LineLayout lastOldLine = oldEndLine >= 0 && oldEndLine < myLines.size() ...
invalidateLines
243,357
int () { return myView.getEditor().getContentComponent().isShowing() ? MAX_CHUNKS_IN_ACTIVE_EDITOR : MAX_CHUNKS_IN_INACTIVE_EDITOR; }
getChunkCacheSizeLimit
243,358
void (LineLayout layout) { layout.getChunksInLogicalOrder().forEach(laidOutChunks::remove); }
removeChunksFromCache
243,359
void () { int limit = getChunkCacheSizeLimit(); while (laidOutChunks.size() > limit) { LineLayout.Chunk chunk = laidOutChunks.removeLast(); if (LOG.isDebugEnabled()) { LOG.debug("Clearing chunk for " + myView.getEditor().getVirtualFile()); } chunk.clearCache(); } }
trimChunkCache
243,360
void () { if (myLines == null) { myView.getEditor().throwDisposalError("Editor is already disposed"); } }
checkDisposed
243,361
LineLayout (@NotNull EditorView view, int line, boolean skipBidiLayout) { List<BidiRun> runs = createFragments(view, line, skipBidiLayout); return createLayout(view, runs, null, line); }
create
243,362
LineLayout (@NotNull EditorView view, @NotNull CharSequence text, @JdkConstants.FontStyle int fontStyle) { List<BidiRun> runs = createFragments(view, text, fontStyle); LineLayout delegate = createLayout(view, runs, text, 0); return new WithSize(delegate); }
create
243,363
LineLayout (@NotNull EditorView view, @NotNull List<BidiRun> runs, @Nullable CharSequence text, int line) { if (runs.isEmpty()) return new SingleChunk(null); if (runs.size() == 1) { BidiRun run = runs.get(0); if (run.level == 0 && run.getChunkCount() == 1) { Chunk chunk = run.chunks == null ? new Chunk(0, run.endOffset...
createLayout
243,364
void (BidiRun[] bidiRuns) { byte[] levels = new byte[bidiRuns.length]; for (int i = 0; i < bidiRuns.length; i++) { levels[i] = bidiRuns[i].level; } Bidi.reorderVisually(levels, 0, bidiRuns, 0, levels.length); }
reorderRunsVisually
243,365
boolean (@NotNull CharSequence text) { char[] chars = CharArrayUtil.fromSequence(text); return Bidi.requiresBidi(chars, 0, chars.length); }
isBidiLayoutRequired
243,366
List<BidiRun> (@NotNull EditorView view, int line, boolean skipBidiLayout) { Document document = view.getEditor().getDocument(); int lineStartOffset = document.getLineStartOffset(line); int lineEndOffset = document.getLineEndOffset(line); if (lineEndOffset <= lineStartOffset) return Collections.emptyList(); if (skipBid...
createFragments
243,367
List<BidiRun> (@NotNull EditorView view, @NotNull CharSequence text, @JdkConstants.FontStyle int fontStyle) { if (text.length() == 0) return Collections.emptyList(); FontFallbackIterator ffi = new FontFallbackIterator() .setPreferredFonts(view.getEditor().getColorsScheme().getFontPreferences()) .setFontStyle(fontStyle)...
createFragments
243,368
List<BidiRun> (EditorView view, char[] text, int startOffsetInEditor) { int textLength = text.length; if (view.getEditor().myDisableRtl || !Bidi.requiresBidi(text, 0, textLength)) { return Collections.singletonList(new BidiRun(textLength)); } view.getEditor().bidiTextFound(); List<BidiRun> runs = new ArrayList<>(); int...
createRuns
243,369
boolean (char[] text, int offset) { return offset > 0 && offset < text.length && Character.isHighSurrogate(text[offset - 1]) && Character.isLowSurrogate(text[offset]); }
isInsideSurrogatePair
243,370
int (char[] text, int offset) { return isInsideSurrogatePair(text, offset) ? offset - 1 : offset; }
alignToCodePointBoundary
243,371
int (CharSequence text, int offset) { return offset > 0 && offset < text.length() && Character.isHighSurrogate(text.charAt(offset - 1)) && Character.isLowSurrogate(text.charAt(offset)) ? offset - 1 : offset; }
alignToCodePointBoundary
243,372
int[] (char[] text, int start, int end, IElementType token) { if (token == null) return null; Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(token.getLanguage()); if (!(commenter instanceof CodeDocumentationAwareCommenter cdaCommenter)) return null; if (token.equals(cdaCommenter.getLineCommentTokenType()...
getCommentPrefixAndOrSuffixBoundaries
243,373
boolean (String value) { return value != null && !value.isEmpty() && !Character.isLowSurrogate(value.charAt(0)) && !Character.isHighSurrogate(value.charAt(value.length() - 1)); }
isValidSuffixOrPrefix
243,374
boolean (@Nullable IElementType token1, @Nullable IElementType token2) { if (token1 == token2) return false; if (token1 == null || token2 == null) return true; if (StringEscapesTokenTypes.STRING_LITERAL_ESCAPES.contains(token1) || StringEscapesTokenTypes.STRING_LITERAL_ESCAPES.contains(token2)) return false; if (token1...
distinctTokens
243,375
void (List<BidiRun> runs, char[] text, int start, int end, int flags) { if (start < end && !Bidi.requiresBidi(text, start, end)) { addOrMergeRun(runs, new BidiRun((byte)0, start, end)); return; } int afterLastTabPosition = start; for (int i = start; i < end; i++) { if (text[i] == '\t') { addRunsNoTabs(runs, text, after...
addRuns
243,376
void (List<BidiRun> runs, char[] text, int start, int end, int flags) { if (start >= end) return; Bidi bidi = new Bidi(text, start, null, 0, end - start, flags); int runCount = bidi.getRunCount(); for (int i = 0; i < runCount; i++) { addOrMergeRun(runs, new BidiRun((byte)bidi.getRunLevel(i), start + bidi.getRunStart(i)...
addRunsNoTabs
243,377
void (List<BidiRun> runs, BidiRun run) { int size = runs.size(); if (size > 0 && runs.get(size - 1).level == 0 && run.level == 0) { BidiRun lastRun = runs.remove(size - 1); assert lastRun.endOffset == run.startOffset; runs.add(new BidiRun((byte)0, lastRun.startOffset, run.endOffset)); } else { runs.add(run); } }
addOrMergeRun
243,378
void (EditorView view, BidiRun run, Chunk chunk, char[] text, int start, int end, @Nullable TabFragment tabFragment, boolean showSpecialChars, FontFallbackIterator it) { assert start < end; int last = start; for (int i = start; i < end; i++) { char c = text[i]; LineFragment specialFragment = null; if (c == '\t') { asse...
addFragments
243,379
void (BidiRun run, Chunk chunk, char[] text, int start, int end, FontFallbackIterator it) { if (start < end) { it.start(text, start, end); while (!it.atEnd()) { addTextFragmentIfNeeded(chunk, text, it.getStart(), it.getEnd(), it.getFontInfo(), run.isRtl()); it.advance(); } } }
addFragmentsNoTabs
243,380
void (Chunk chunk, char[] chars, int from, int to, FontInfo fontInfo, boolean isRtl) { if (to > from) { assert fontInfo != null; TextFragmentFactory.createTextFragments(chunk.fragments, chars, from, to, isRtl, fontInfo); } }
addTextFragmentIfNeeded
243,381
BidiRun[] () { if (myChunk == null) return BidiRun.EMPTY_ARRAY; BidiRun run = new BidiRun(myChunk.endOffset); run.chunks = Collections.singletonList(myChunk); return new BidiRun[] {run}; }
createRuns
243,382
float () { float x = 0; for (VisualFragment fragment : getFragmentsInVisualOrder(x)) { x = fragment.getEndX(); } return x; }
calculateWidth
243,383
boolean () { return BitUtil.isSet(level, 1); }
isRtl
243,384
List<Chunk> (CharSequence text, int startOffsetInText) { List<Chunk> c = chunks; if (c == null) { int chunkCount = getChunkCount(); chunks = c = new ArrayList<>(chunkCount); for (int i = 0; i < chunkCount; i++) { int from = startOffset + i * CHUNK_CHARACTERS; int to = i == chunkCount - 1 ? endOffset : from + CHUNK_CHAR...
getChunks
243,385
int () { return (endOffset - startOffset + CHUNK_CHARACTERS - 1) / CHUNK_CHARACTERS; }
getChunkCount
243,386
BidiRun (@NotNull EditorView view, int line, int targetStartOffset, int targetEndOffset, @Nullable Runnable quickEvaluationListener) { assert targetStartOffset < endOffset; assert targetEndOffset > startOffset; int start = Math.max(startOffset, targetStartOffset); int end = Math.min(endOffset, targetEndOffset); BidiRun...
subRun
243,387
void (@NotNull EditorView view, BidiRun run, int line) { if (isReal()) { view.getTextLayoutCache().onChunkAccess(this); } if (fragments != null) return; assert isReal(); fragments = new ArrayList<>(); EditorImpl editor = view.getEditor(); int lineStartOffset = editor.getDocument().getLineStartOffset(line); int start = ...
ensureLayout
243,388
Chunk (EditorView view, BidiRun run, int line, int targetStartOffset, int targetEndOffset, @Nullable Runnable quickEvaluationListener) { assert isReal(); assert targetStartOffset < endOffset; assert targetEndOffset > startOffset; int start = Math.max(startOffset, targetStartOffset); int end = Math.min(endOffset, target...
subChunk
243,389
boolean () { if (myRunIndex >= myRuns.length) return false; BidiRun run = myRuns[myRunIndex]; List<Chunk> chunks = run.getChunks(myText, myLineStartOffset); if (myChunkIndex >= chunks.size()) return false; Chunk chunk = chunks.get(run.isRtl() ? chunks.size() - 1 - myChunkIndex : myChunkIndex); if (myView != null) { chu...
hasNext
243,390
VisualFragment () { if (!hasNext()) { throw new NoSuchElementException(); } BidiRun run = myRuns[myRunIndex]; if (myRunIndex == 0 && myChunkIndex == 0 && myFragmentIndex == 0) { myFragment.startLogicalColumn = run.visualStartLogicalColumn; } else { myFragment.startLogicalColumn = myChunkIndex == 0 && myFragmentIndex ==...
next
243,391
void () { throw new UnsupportedOperationException(); }
remove
243,392
int (int offset) { return isRtl ? startOffset - offset : offset - startOffset; }
getRelativeOffset
243,393
int () { return myLength; }
getLength
243,394
int (int startColumn) { return myColumnCount; }
getLogicalColumnCount
243,395
int (float startX) { return myColumnCount; }
getVisualColumnCount
243,396
int (float startX, int startColumn, int column) { return column; }
logicalToVisualColumn
243,397
int (float startX, int startColumn, int column) { return column; }
visualToLogicalColumn
243,398
int (float startX, int column) { return column; }
visualColumnToOffset
243,399
float (float startX, int column) { return column < myColumnCount ? 0 : myWidth; }
visualColumnToX