Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
271,600 | void (@NotNull DocumentEvent event) { Document document = event.getDocument(); int textLength = document.getTextLength(); expectedResults = new int[textLength + 1]; for (int i = 0; i <= textLength; i++) { expectedResults[i] = document.getLineNumber(i); } } | beforeDocumentChange |
271,601 | void (@NotNull DocumentEvent event) { for (int i = 0; i < expectedResults.length; i++) { assertEquals("Wrong result for offset " + i, expectedResults[i], ((DocumentEventImpl)event).getLineNumberBeforeUpdate(i)); } } | documentChanged |
271,602 | void () { LOG.debug("Seed is " + mySeed); int i = 0; try { initText(""); for (i = 0; i < RANDOM_ITERATIONS; i++) { ourActions.get(myRandom.nextInt(ourActions.size())).run(); validateState(); } } catch (Throwable t) { String message = "Failed when run with seed=" + mySeed + " in iteration " + i; System.err.println(messa... | testRenderedFlagConsistencyByRandomOperations |
271,603 | void () { MarkupModelEx markupModel = ((EditorEx)getEditor()).getMarkupModel(); List<RangeHighlighterEx> list1; MarkupIterator<RangeHighlighterEx> it1 = markupModel.overlappingIterator(0, Integer.MAX_VALUE); try { list1 = ContainerUtil.collect(it1, h->h.isRenderedInGutter()); } finally { it1.dispose(); } MarkupIterator... | validateState |
271,604 | void () { int bound = getEditor().getDocument().getTextLength() + 1; int offset1 = myRandom.nextInt(bound); int offset2 = myRandom.nextInt(bound); getEditor().getMarkupModel().addRangeHighlighter(null, Math.min(offset1, offset2), Math.max(offset1, offset2), 0, HighlighterTargetArea.EXACT_RANGE); } | run |
271,605 | void () { RangeHighlighter[] highlighters = getEditor().getMarkupModel().getAllHighlighters(); int size = highlighters.length; if (size > 0) { highlighters[myRandom.nextInt(size)].dispose(); } } | run |
271,606 | void () { RangeHighlighter[] highlighters = getEditor().getMarkupModel().getAllHighlighters(); int size = highlighters.length; if (size > 0) { RangeHighlighter h = highlighters[myRandom.nextInt(size)]; h.setGutterIconRenderer(h.getGutterIconRenderer() == null ? DUMMY_GUTTER_ICON_RENDERER : null); } } | run |
271,607 | void () { Document document = getEditor().getDocument(); int offset = myRandom.nextInt(document.getTextLength() + 1); runWriteCommand(() -> document.insertString(offset, StringUtil.repeat(" ", myRandom.nextInt(MAX_CHARS_PER_OPERATION) + 1))); } | run |
271,608 | void () { Document document = getEditor().getDocument(); int textLength = document.getTextLength(); if (textLength <= 0) return; int offset = myRandom.nextInt(textLength); runWriteCommand(() -> document.deleteString(offset, Math.min(textLength, offset + 1 + myRandom.nextInt(MAX_CHARS_PER_OPERATION)))); } | run |
271,609 | void () { DocumentEx document = (DocumentEx)getEditor().getDocument(); int textLength = document.getTextLength(); if (textLength <= 0) return; int startOffset = myRandom.nextInt(textLength); int endOffset = Math.min(textLength, startOffset + 1 + myRandom.nextInt(MAX_CHARS_PER_OPERATION)); int targetOffset = myRandom.ne... | run |
271,610 | boolean (Object obj) { return this == obj; } | equals |
271,611 | int () { return 0; } | hashCode |
271,612 | Icon () { return EmptyIcon.ICON_0; } | getIcon |
271,613 | void () { LOG.debug("Seed is " + mySeed); int i = 0; try { initText(""); ((DocumentImpl)getEditor().getDocument()).setAcceptSlashR(true); configureSoftWraps(10); EditorImpl editor = (EditorImpl)getEditor(); for (i = 0; i < ITERATIONS; i++) { doRandomAction(editor, myRandom, ACTIONS); editor.validateState(); } if (edito... | testRandomActions |
271,614 | void (EditorEx editor, Random random, List<? extends Action> actions) { actions.get(random.nextInt(actions.size())).perform(editor, random); } | doRandomAction |
271,615 | void (EditorEx editor, Random random) { StringBuilder text = new StringBuilder(); int count = 1 + random.nextInt(MAX_CHARS_TO_ADD); for (int i = 0; i < count; i++) { text.append(CHARS_TO_USE.charAt(random.nextInt(CHARS_TO_USE.length()))); } Document document = editor.getDocument(); int offset = random.nextInt(document.... | perform |
271,616 | void (EditorEx editor, Random random) { Document document = editor.getDocument(); int textLength = document.getTextLength(); if (textLength <= 0) return; int count = 1 + random.nextInt(Math.min(MAX_CHARS_TO_REMOVE, textLength)); int offset = random.nextInt(textLength - count + 1); WriteCommandAction.writeCommandAction(... | perform |
271,617 | void (EditorEx editor, Random random) { DocumentEx document = editor.getDocument(); int textLength = document.getTextLength(); if (textLength <= 1) return; int count = 1 + random.nextInt(textLength - 1); int srcStart = random.nextInt(textLength - count + 1); int targetPos = random.nextInt(textLength - count); int targe... | perform |
271,618 | void (final EditorEx editor, Random random) { DocumentEx document = editor.getDocument(); if (document.isInBulkUpdate()) return; int textLength = document.getTextLength(); if (textLength <= 0) return; final int startOffset = random.nextInt(textLength + 1); final int endOffset = random.nextInt(textLength + 1); if (start... | perform |
271,619 | void (final EditorEx editor, Random random) { DocumentEx document = editor.getDocument(); if (document.isInBulkUpdate()) return; int lineCount = Math.max(1, document.getLineCount()); final int startLine = random.nextInt(lineCount); final int endLine = random.nextInt(lineCount); final FoldingModel foldingModel = editor.... | perform |
271,620 | void (final EditorEx editor, Random random) { if (editor.getDocument().isInBulkUpdate()) return; List<CustomFoldRegion> customRegions = ContainerUtil.findAll(editor.getFoldingModel().getAllFoldRegions(), CustomFoldRegion.class); int count = customRegions.size(); if (count > 0) { CustomFoldRegion region = customRegions.... | perform |
271,621 | void (final EditorEx editor, Random random) { DocumentEx document = editor.getDocument(); if (document.isInBulkUpdate()) return; final FoldingModel foldingModel = editor.getFoldingModel(); FoldRegion[] foldRegions = foldingModel.getAllFoldRegions(); if (foldRegions.length == 0) return; final FoldRegion region = foldReg... | perform |
271,622 | void (final EditorEx editor, Random random) { DocumentEx document = editor.getDocument(); if (document.isInBulkUpdate()) return; final FoldingModel foldingModel = editor.getFoldingModel(); FoldRegion[] foldRegions = foldingModel.getAllFoldRegions(); if (foldRegions.length == 0) return; int operations = random.nextInt(f... | perform |
271,623 | void (final EditorEx editor, Random random) { DocumentEx document = editor.getDocument(); if (document.isInBulkUpdate()) return; FoldingModelEx foldingModel = editor.getFoldingModel(); foldingModel.runBatchFoldingOperation(foldingModel::clearFoldRegions); } | perform |
271,624 | void (EditorEx editor, Random random) { DocumentEx document = editor.getDocument(); document.setInBulkUpdate(!document.isInBulkUpdate()); } | perform |
271,625 | void (EditorEx editor, Random random) { DocumentEx document = editor.getDocument(); if (document.isInBulkUpdate()) return; JViewport viewport = editor.getScrollPane().getViewport(); viewport.setExtentSize(viewport.getExtentSize().getWidth() == 0 ? new Dimension(1000, 1000) : new Dimension(0, 0)); } | perform |
271,626 | void (EditorEx editor, Random random) { int offset = random.nextInt(editor.getDocument().getTextLength() + 1); editor.getInlayModel().addInlineElement(offset, false, new MyInlayRenderer()); } | perform |
271,627 | void (EditorEx editor, Random random) { List<Inlay<?>> inlays = editor.getInlayModel().getInlineElementsInRange(0, editor.getDocument().getTextLength()); if (!inlays.isEmpty()) { Disposer.dispose(inlays.get(random.nextInt(inlays.size()))); } } | perform |
271,628 | void (EditorEx editor, Random random) { List<Inlay<? extends MyInlayRenderer>> inlays = editor.getInlayModel().getInlineElementsInRange(0, editor.getDocument().getTextLength(), MyInlayRenderer.class); if (!inlays.isEmpty()) { Inlay<? extends MyInlayRenderer> inlay = inlays.get(random.nextInt(inlays.size())); inlay.getR... | perform |
271,629 | void (EditorEx editor, Random random) { editor.getInlayModel().execute(true, () -> { int count = 1 + random.nextInt(MAX_INLAY_OPERATIONS_IN_BATCH); for (int i = 0; i < count; i++) { doRandomAction(editor, random, INLAY_PRIMITIVE_ACTIONS); } }); } | perform |
271,630 | void (EditorEx editor, Random random) { DocumentEx document = editor.getDocument(); if (document.isInBulkUpdate()) return; editor.getCaretModel().moveToOffset(random.nextInt(document.getTextLength() + 1)); } | perform |
271,631 | int (@NotNull Inlay inlay) { return width; } | calcWidthInPixels |
271,632 | void (@NotNull Inlay inlay, @NotNull Graphics g, @NotNull Rectangle targetRegion, @NotNull TextAttributes textAttributes) {} | paint |
271,633 | int (@NotNull CustomFoldRegion region) { Integer value = region.getUserData(REGION_WIDTH); return value == null ? 0 : value; } | calcWidthInPixels |
271,634 | int (@NotNull CustomFoldRegion region) { return 1; } | calcHeightInPixels |
271,635 | void (@NotNull CustomFoldRegion region, @NotNull Graphics2D g, @NotNull Rectangle2D targetRegion, @NotNull TextAttributes textAttributes) {} | paint |
271,636 | void () { myModel.runBatchFoldingOperation(() -> { myModel.addFoldRegion(0, 4, "/*...*/"); myModel.addFoldRegion(5, 9, "/*...*/"); }); assertSize(2, myModel.getAllFoldRegions()); runWriteCommand(() -> getEditor().getDocument().deleteString(0, 5)); assertSize(1, myModel.getAllFoldRegions()); } | testCleanupInvalidRegions |
271,637 | void () { myModel.runBatchFoldingOperation(() -> { FoldRegion region = myModel.addFoldRegion(5, 10, "."); assertNotNull(region); region = myModel.addFoldRegion(7, 11, "."); assertNull(region); region = myModel.addFoldRegion(20, 30, "."); assertNotNull(region); region = myModel.addFoldRegion(9, 12, "."); assertNull(regi... | testIntersects |
271,638 | void () { myModel.runBatchFoldingOperation(() -> { FoldRegion region = myModel.addFoldRegion(0, 10, "."); assertNotNull(region); region = myModel.addFoldRegion(1, 5, "."); assertNotNull(region); region = myModel.addFoldRegion(6, 11, "."); assertNull(region); }); } | testIntersectsWithRegionFarInStorageOrder |
271,639 | void () { DefaultLogger.disableStderrDumping(getTestRootDisposable()); FoldRegion region = null; try { region = myModel.addFoldRegion(5, 5, "..."); } catch (AssertionError ignored) { } assertNull(region); } | testAddEmptyRegion |
271,640 | void () { addCollapsedFoldRegion(5, 7, "..."); FoldRegion[] regions = myModel.getAllFoldRegions(); assertEquals(1, regions.length); FoldRegion region = regions[0]; assertNotNull(region); assertFalse(myModel.isOffsetCollapsed(4)); assertTrue(myModel.isOffsetCollapsed(5)); assertTrue(myModel.isOffsetCollapsed(6)); assert... | testCollapsedRegionQueries |
271,641 | void () { addCollapsedFoldRegion(5, 7, "AA"); assertFalse(myModel.isOffsetCollapsed(4)); assertTrue(myModel.isOffsetCollapsed(5)); assertTrue(myModel.isOffsetCollapsed(6)); assertFalse(myModel.isOffsetCollapsed(7)); assertFalse(myModel.isOffsetCollapsed(8)); assertFalse(myModel.isOffsetCollapsed(10)); assertFalse(myMod... | testAdjacentRegions |
271,642 | void () { FoldRegion region = addCollapsedFoldRegion(5, 15, "..."); addCollapsedFoldRegion(10, 12, "???"); FoldRegion[] topLevelRegions = myModel.fetchTopLevel(); Assert.assertArrayEquals(new FoldRegion[]{region}, topLevelRegions); } | testTopLevel |
271,643 | void () { addCollapsedFoldRegion(1, 3, "..."); addCollapsedFoldRegion(5, 6, "..."); assertEquals(-1, myModel.getLastCollapsedRegionBefore(0)); assertEquals(-1, myModel.getLastCollapsedRegionBefore(1)); assertEquals(-1, myModel.getLastCollapsedRegionBefore(2)); assertEquals(0, myModel.getLastCollapsedRegionBefore(3)); a... | testLastCollapsedRegionBefore |
271,644 | void () { getEditor().getSelectionModel().setSelection(0, 5); addCollapsedFoldRegion(3, 6, "..."); assertFalse(getEditor().getSelectionModel().hasSelection()); } | testSelectionIsRemovedWhenInterruptedByFolding |
271,645 | void () { addCollapsedFoldRegion(0, 10, "..."); addCollapsedFoldRegion(1, 9, "..."); runWriteCommand(() -> getEditor().getDocument().deleteString(0, 1)); addFoldRegion(20, 21, "..."); // an arbitrary action to rebuild folding caches assertTrue(myModel.isOffsetCollapsed(5)); } | testModelRemainsConsistentOnTextRemoval |
271,646 | void () { FoldRegion c = addCollapsedFoldRegion(0, 10, "..."); FoldRegion e = addFoldRegion(1, 10, "..."); runWriteCommand(() -> getEditor().getDocument().deleteString(0, 1)); assertFalse(e.isValid()); assertTrue(c.isValid()); FoldRegion survivor = assertOneElement(myModel.getAllFoldRegions()); assertSame(c, survivor);... | testAmongIdenticalRegionsExpandedOnesShouldBeKilledFirst |
271,647 | void () { FoldRegion e = addFoldRegion(0, 10, "..."); FoldRegion c = addCollapsedFoldRegion(1, 10, "..."); runWriteCommand(() -> getEditor().getDocument().deleteString(0, 1)); assertFalse(e.isValid()); assertTrue(c.isValid()); FoldRegion survivor = assertOneElement(myModel.getAllFoldRegions()); assertSame(c, survivor);... | testAmongIdenticalRegionsExpandedOnesShouldBeKilledFirst2 |
271,648 | void () { addFoldRegion(0, 5, "..."); addFoldRegion(0, 4, "..."); assertNumberOfValidFoldRegions(2); runWriteCommand(() -> getEditor().getDocument().deleteString(4, 5)); assertNumberOfValidFoldRegions(1); } | testIdenticalRegionsAreRemoved |
271,649 | void () { Ref<FoldRegion> regionRef = new Ref<>(); runFoldingOperation(() -> { FoldRegion region = myModel.createFoldRegion(0, 1, "...", null, true); assertNotNull(region); assertTrue(region.isValid()); assertFalse(region.isExpanded()); regionRef.set(region); }); List<FoldRegion> notifications = new ArrayList<>(); myMo... | testNotificationIsSentOnRemovalOfNonExpandingRegion |
271,650 | void (@NotNull FoldRegion region) { notifications.add(region); } | onFoldRegionStateChange |
271,651 | void () { addCollapsedFoldRegion(10, 15, "..."); addCollapsedFoldRegion(10, 14, "..."); runWriteCommand(() -> getEditor().getDocument().deleteString(14, 15)); FoldRegion region = myModel.getCollapsedRegionAtOffset(10); assertNotNull(region); assertTrue(region.isValid()); assertEquals(10, region.getStartOffset()); asser... | testTopLevelRegionRemainsTopLevelAfterMergingIdenticalRegions |
271,652 | void (int expectedValue) { int actualValue = 0; for (FoldRegion region : myModel.getAllFoldRegions()) { if (region.isValid()) { actualValue++; } } assertEquals(expectedValue, actualValue); } | assertNumberOfValidFoldRegions |
271,653 | void () { FoldingModelImpl model = (FoldingModelImpl)getEditor().getFoldingModel(); model.runBatchFoldingOperation( () -> { FoldRegion f1 = model.addFoldRegion(1, 10, "..."); assertNotNull(f1); FoldRegion f2 = model.addFoldRegion(5, 11, "..."); assertNull(f2); FoldRegion c1 = model.createFoldRegion(2, 9, "...", null, f... | testCantCreateOverlappingRegions |
271,654 | void () { FoldRegion inner = addFoldRegion(10, 15, "inner"); FoldRegion outer = addCollapsedFoldRegion(10, 20, "outer"); myModel.runBatchFoldingOperation(() -> inner.setExpanded(false)); assertSame(outer, myModel.getCollapsedRegionAtOffset(10)); } | testCollapseInnerRegion |
271,655 | void () { addFoldRegion(10, 20, "1"); addFoldRegion(15, 20, "2"); addFoldRegion(16, 17, "3"); WriteAction.run(() -> getEditor().getDocument().deleteString(10, 15)); FoldRegion[] regions = getEditor().getFoldingModel().getAllFoldRegions(); assertSize(2, regions); assertEquals(TextRange.create(10, 15), regions[0].getText... | testNoIdenticalRegionsSpecialCase |
271,656 | void () { String text = getEditor().getDocument().getText().codePoints().mapToObj(c -> c + "\n").collect(Collectors.joining()); runWriteCommand(()-> getEditor().getDocument().setText(text)); addFoldRegion(20, 151, "1"); addFoldRegion(289, 357, "2"); addCollapsedFoldRegion(282, 357, "3"); FoldRegion[] regions = getEdito... | test1 |
271,657 | void () { addFoldRegion(10, 20, "outer"); FoldRegion inner = addFoldRegion(15, 20, "inner"); myModel.runBatchFoldingOperation(() -> inner.setExpanded(false)); Assert.assertArrayEquals(new FoldRegion[]{inner}, myModel.fetchTopLevel()); } | testInnerRegionAtTheEndOfOuterRegion |
271,658 | void () { addFoldRegion(10, 20, "outer"); FoldRegion inner = addCollapsedFoldRegion(10, 15, "inner"); addCollapsedFoldRegion(11, 12, "innermost"); Assert.assertArrayEquals(new FoldRegion[]{inner}, myModel.fetchTopLevel()); } | testNestedRegions |
271,659 | void () { FoldRegion inner = addCollapsedFoldRegion(10, 15, "inner"); addFoldRegion(10, 20, "outer"); runWriteCommand(() -> getEditor().getDocument().deleteString(15, 20)); Assert.assertArrayEquals(new FoldRegion[]{inner}, myModel.fetchTopLevel()); } | testIdenticalRegionsOtherCase |
271,660 | void () { FoldRegion region = addCollapsedFoldRegion(5, 10, "..."); myModel.runBatchFoldingOperation(() -> myModel.clearFoldRegions()); assertFalse(region.isValid()); } | testClearingInvalidatesFoldRegions |
271,661 | void () { FoldingGroup group = FoldingGroup.newGroup("test"); FoldRegion[] regions = new FoldRegion[2]; myModel.runBatchFoldingOperation(() -> { regions[0] = myModel.createFoldRegion(1, 2, "a", group, false); regions[1] = myModel.createFoldRegion(3, 4, "b", group, false); }); assertNotNull(regions[0]); assertNotNull(re... | testGroupIsUpdatedOnRegionDisposal |
271,662 | void () { FoldingGroup group = FoldingGroup.newGroup("test"); FoldRegion[] regions = new FoldRegion[3]; myModel.runBatchFoldingOperation(() -> { regions[0] = myModel.createFoldRegion(1, 4, "a", group, false); regions[1] = myModel.createFoldRegion(3, 4, "b", group, false); regions[2] = myModel.createFoldRegion(20, 30, "... | testAllRegionsFromInvalidNodeAreRemovedFromGroups |
271,663 | void () { FoldRegion region = addFoldRegion(0, 0, "."); assertNull(region); } | testAddingEmptyRegion |
271,664 | void () { FoldingGroup group = FoldingGroup.newGroup("test"); getEditor().getFoldingModel().runBatchFoldingOperation( () -> myModel.createFoldRegion(0, 10, "...", group, false) ); addCollapsedFoldRegion(1, 10, "..."); runWriteCommand(() -> getEditor().getDocument().deleteString(0, 1)); List<FoldRegion> regions = myMode... | testRegionBecomingInvalidIsRemovedFromGroup |
271,665 | void () { CaretModel caretModel = getEditor().getCaretModel(); caretModel.moveToVisualPosition(new VisualPosition(0, 0)); caretModel.addCaret(new VisualPosition(0, 1)); caretModel.addCaret(new VisualPosition(0, 2)); caretModel.addCaret(new VisualPosition(0, 3)); addCollapsedFoldRegion(0, 4, "..."); List<Caret> carets =... | testMultipleCaretsUpdateOnRegionCollapsing |
271,666 | void () { initText("\ntext"); addCollapsedFoldRegion(0, getEditor().getDocument().getTextLength(), "..."); mouse().clickAt(0, 1); assertEquals(new VisualPosition(0, 0), getEditor().getCaretModel().getVisualPosition()); } | testMousePositionAfterClickOnCollapsedFolding |
271,667 | void () { initText(""" ( foo [ bar<caret> ] )"""); foldOccurrences("(?s)\\(.*\\)", "..."); foldOccurrences("(?s)\\[.*\\]", "..."); checkResultByText(""" <caret>( foo [ bar ] )"""); getEditor().getCaretModel().moveToOffset(getEditor().getDocument().getText().indexOf("foo")); verifyFoldingState("[FoldRegion -(0:23), plac... | testExpandRegionDoesNotImpactOutsideCaret |
271,668 | void () { AtomicInteger invocationCount = new AtomicInteger(); myModel.addListener(new FoldingListener() { @Override public void beforeFoldRegionDisposed(@NotNull FoldRegion region) { invocationCount.incrementAndGet(); } }, getTestRootDisposable()); Ref<FoldRegion> regionRef = new Ref<>(); myModel.runBatchFoldingOperat... | testDisposalListenerMethodCalledOnExplicitRemoval |
271,669 | void (@NotNull FoldRegion region) { invocationCount.incrementAndGet(); } | beforeFoldRegionDisposed |
271,670 | void () { AtomicInteger invocationCount = new AtomicInteger(); myModel.addListener(new FoldingListener() { @Override public void beforeFoldRegionDisposed(@NotNull FoldRegion region) { invocationCount.incrementAndGet(); } }, getTestRootDisposable()); Ref<FoldRegion> regionRef = new Ref<>(); myModel.runBatchFoldingOperat... | testDisposalListenerMethodCalledOnImplicitRemoval |
271,671 | void (@NotNull FoldRegion region) { invocationCount.incrementAndGet(); } | beforeFoldRegionDisposed |
271,672 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); assertEquals(2, marker.getStartOffset()); assertEquals(5, marker.getEndOffset()); assertTrue(marker.isValid()); } | testCreation |
271,673 | void () { RangeMarker marker = createMarker("01[234]56789"); deleteString(marker.getDocument(), 0, 1); assertEquals(1, marker.getStartOffset()); assertEquals(4, marker.getEndOffset()); assertTrue(marker.isValid()); } | testDeleteBeforeStart |
271,674 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); insertString(marker.getDocument(), 4, "xxx"); assertEquals(2, marker.getStartOffset()); assertEquals(8, marker.getEndOffset()); assertTrue(marker.isValid()); } | testInsertIntoRange |
271,675 | void () { RangeMarker marker = createMarker("0123456789", 2, 2); insertString(marker.getDocument(), 2, "xxx"); assertEquals(2, marker.getStartOffset()); assertEquals(2, marker.getEndOffset()); assertTrue(marker.isValid()); } | testInsertIntoPoint |
271,676 | void () { RangeMarker marker = createMarker("0123456789", 2, 2); deleteString(marker.getDocument(), 1, 3); assertFalse(marker.isValid()); } | testDeletePoint |
271,677 | void () { RangeMarker marker = createMarker("0123456789", 1, 7); deleteString(marker.getDocument(), 2, 5); assertTrue(marker.isValid()); } | testDeleteRangeInside |
271,678 | void () { RangeMarker marker = createMarker("0123456789", 1, 7); replaceString(marker.getDocument(), 2, 5, " "); assertTrue(marker.isValid()); } | testReplaceRangeToSingleChar |
271,679 | void () { RangeMarker marker = createMarker("0123456789", 1, 7); replaceString(marker.getDocument(), 1, 7, "abc"); assertValidMarker(marker, 1, 4); } | testReplaceWholeRange |
271,680 | void () { RangeMarker marker = createMarker("01[]23456789"); deleteString(marker.getDocument(), 1, 3); assertFalse(marker.isValid()); insertString(marker.getDocument(), 2, "xxx"); assertEquals(2, marker.getStartOffset()); assertEquals(2, marker.getEndOffset()); assertFalse(marker.isValid()); } | testUpdateInvalid |
271,681 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); insertString(marker.getDocument(), 6, "xxx"); assertEquals(2, marker.getStartOffset()); assertEquals(5, marker.getEndOffset()); assertTrue(marker.isValid()); } | testInsertAfterEnd |
271,682 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); deleteString(marker.getDocument(), 4, 6); assertValidMarker(marker, 2, 4); } | testDeleteEndPart |
271,683 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); deleteString(marker.getDocument(), 0, 4); assertValidMarker(marker, 0, 1); } | testDeleteStartPart |
271,684 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); replaceString(marker.getDocument(), 0, 4, "xxxx"); assertValidMarker(marker, 4, 5); } | testReplaceStartPartInvalid |
271,685 | void () { RangeMarker marker = createMarker("0123456789", 0, 5); deleteString(marker.getDocument(), 0, 1); assertValidMarker(marker, 0, 4); } | testDeleteFirstChar |
271,686 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); insertString(marker.getDocument(), 0, "xxx"); assertEquals(5, marker.getStartOffset()); assertEquals(8, marker.getEndOffset()); assertTrue(marker.isValid()); } | testInsertBeforeStart |
271,687 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); insertString(marker.getDocument(), 2, "xxx"); assertValidMarker(marker, 5, 8); } | testInsertIntoStart |
271,688 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); marker.setGreedyToLeft(true); insertString(marker.getDocument(), 2, "xxx"); assertEquals(2, marker.getStartOffset()); assertEquals(8, marker.getEndOffset()); assertTrue(marker.isValid()); } | testInsertIntoStartExpandToLeft |
271,689 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); insertString(marker.getDocument(), 5, "xxx"); assertEquals(2, marker.getStartOffset()); assertEquals(5, marker.getEndOffset()); assertTrue(marker.isValid()); } | testInsertIntoEnd |
271,690 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); marker.setGreedyToRight(true); insertString(marker.getDocument(), 5, "xxx"); assertEquals(2, marker.getStartOffset()); assertEquals(8, marker.getEndOffset()); assertTrue(marker.isValid()); } | testInsertIntoEndExpandRight |
271,691 | void () { RangeMarker marker = createMarker("package safd;\n\n[import javax.swing.JPanel;]\nimport java.util.ArrayList;\n\nclass T{}"); replaceString(marker.getDocument(), 15, 15 + "import javax.swing.JPanel;\nimport java.util.ArrayList;".length(), "import java.util.ArrayList;"); assertEquals(15, marker.getStartOffset(... | testNoNegative |
271,692 | void () { String s = "12345\n \n12345"; RangeMarker marker = createMarker(s, 6, 8); replaceString(marker.getDocument(), 0, s.length(), s.replaceAll(" ", "")); assertValidMarker(marker, 6, 7); } | testReplaceRightIncludingFirstChar |
271,693 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); deleteString(marker.getDocument(), 4, 6); assertValidMarker(marker, 2, 4); } | testDeleteRightPart |
271,694 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); deleteString(marker.getDocument(), 4, 5); assertValidMarker(marker, 2, 4); } | testDeleteRightPart2 |
271,695 | void (Document document, int startOffset, int endOffset) { WriteAction.run(() -> document.deleteString(startOffset, endOffset)); } | deleteString |
271,696 | void (Document document, int startOffset, int endOffset, String xxx) { WriteAction.run(() -> document.replaceString(startOffset, endOffset, xxx)); } | replaceString |
271,697 | void (Document document, int offset, String xxx) { WriteAction.run(() -> document.insertString(offset, xxx)); } | insertString |
271,698 | void (DocumentEx document, int srcStart, int srcEnd, int dstOffset) { WriteAction.run(() -> document.moveText(srcStart, srcEnd, dstOffset)); } | moveText |
271,699 | void () { RangeMarker marker = createMarker("0123456789", 2, 5); replaceString(marker.getDocument(), 4, 6, "xxx"); assertValidMarker(marker, 2, 4); } | testReplaceRightPartInvalid |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.