Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
273,300
Path () { var path = SystemInfo.isWindows ? "C:\\tests\\" + tempDir.getRootPath().getFileName() : tempDir.getRootPath().toString(); return memoryFs.getFs().getPath(path); }
getTestDir
273,301
DirectoryLock (Path configPath, Path systemPath) { var lock = new DirectoryLock(configPath, systemPath, args -> CliResult.OK); activeLocks.add(lock); return lock; }
createLock
273,302
void () { var path = testDir.resolve("same"); var lock = createLock(path, path); assertThatThrownBy(() -> lock.lockOrActivate(currentDir, List.of())).isInstanceOf(IllegalArgumentException.class); }
pathCollision
273,303
void () { assertNotNull( "Resource [" + CsvMetricsExporter.HTML_PLOTTER_NAME + "] must be accessible with CsvMetricsExporter.class.getResource()", CsvMetricsExporter.class.getResource(CsvMetricsExporter.HTML_PLOTTER_NAME) ); }
plotterHtmlIsAccessibleFromCsvMetricsExporterClass
273,304
void () { // sick and tired of hunting tests leaking documents ((UndoManagerImpl)UndoManager.getInstance(getProject())).flushCurrentCommandMerger(); Set<Object> alreadyLeaking = new ReferenceOpenHashSet<>(); Predicate<Object> isReallyLeak = file -> { if (file instanceof PsiFile) { if (!((PsiFile)file).isPhysical()) { r...
testUsageViewDoesNotHoldPsiFilesOrDocuments
273,305
void () { @Language("JAVA") String text = "public class X{ int xxx; } //comment"; PsiFile psiFile = myFixture.addFileToProject("X.java", text); Usage usage = createUsage(psiFile, psiFile.getText().indexOf("xxx")); PsiDocumentManager documentManager = PsiDocumentManager.getInstance(getProject()); Document document = doc...
testUsageViewHandlesDocumentChange
273,306
void () { @Language("JAVA") String text = "public class X{ int xxx; } //comment"; PsiFile psiFile = myFixture.addFileToProject("X.java", text); UsageInfo2UsageAdapter usage = new UsageInfo2UsageAdapter( new UsageInfo(psiFile, psiFile.getText().indexOf("xxx"), StringUtil.indexOfSubstringEnd(psiFile.getText(), "xxx"))); ...
testTextUsageInfoHandlesDocumentChange
273,307
Usage (PsiFile psiFile, int offset) { PsiElement element = psiFile.findElementAt(offset % psiFile.getTextLength()); assertNotNull(element); return new UsageInfo2UsageAdapter(new UsageInfo(element)); }
createUsage
273,308
void () { @Language("JAVA") String fileText = """ public class X{ void foo() { bar(); bar(); } void bar() {} }"""; PsiFile psiFile = myFixture.addFileToProject("X.java", fileText); PsiElement[] members = psiFile.getChildren()[psiFile.getChildren().length - 1].getChildren(); PsiNamedElement bar = (PsiNamedElement)member...
testUsageViewCanRerunAfterTargetWasInvalidatedAndRestored
273,309
void (UsageViewImpl usageView) { ProgressManager.getInstance().run(new Task.Modal(getProject(), "Waiting", false) { @Override public void run(@NotNull ProgressIndicator indicator) { usageView.waitForUpdateRequestsCompletion(); usageView.drainQueuedUsageNodes(); } }); }
waitForUsages
273,310
void (@NotNull ProgressIndicator indicator) { usageView.waitForUpdateRequestsCompletion(); usageView.drainQueuedUsageNodes(); }
run
273,311
void () { @Language("JAVA") String fileText = "public class X{ int xxx; } //comment"; PsiFile psiFile = myFixture.addFileToProject("X.java", fileText); Usage usage = new UsageInfo2UsageAdapter( new UsageInfo(psiFile, psiFile.getText().indexOf("xxx"), StringUtil.indexOfSubstringEnd(psiFile.getText(), "xxx"))); UsageView...
testExcludeUsageMustExcludeChildrenAndParents
273,312
UsageViewImpl (Usage @NotNull ... usages) { UsageViewImpl usageView = (UsageViewImpl)UsageViewManager.getInstance(getProject()) .createUsageView(UsageTarget.EMPTY_ARRAY, usages, new UsageViewPresentation(), null); Disposer.register(myFixture.getTestRootDisposable(), usageView); waitForUsages(usageView); UIUtil.dispatch...
createUsageView
273,313
void () { @Language("JAVA") String text = "public class X{ int xxx; } //comment"; PsiFile psiFile = myFixture.addFileToProject("X.java", text); Usage usage = new UsageInfo2UsageAdapter( new UsageInfo(psiFile, psiFile.getText().indexOf("xxx"), StringUtil.indexOfSubstringEnd(psiFile.getText(), "xxx"))); UsageViewImpl usa...
testExcludeNodeMustExcludeChildrenAndParents
273,314
void () { BinaryFileDecompiler decompiler = file -> { throw new IllegalStateException("oh no"); }; ExtensionTestUtil.addExtension((ExtensionsAreaImpl)ApplicationManager.getApplication().getExtensionArea(), BinaryFileTypeDecompilers.getInstance(), new FileTypeExtensionPoint<>(ArchiveFileType.INSTANCE.getName(), decompil...
testUsageOfDecompiledOrBinaryElementMustNotRequestDecompilationDuringTreeRendering
273,315
void (@NotNull UsageInfo usage, String expected) { assertEquals(expected, myFixture.getUsageViewTreeTextRepresentation(Collections.singleton(usage))); }
assertUsageViewStructureEquals
273,316
void (UsageView usageView) { if (usageView instanceof UsageViewImpl) { ProgressManager.getInstance().run(new Task.Modal(getProject(), "Waiting", false) { @Override public void run(@NotNull ProgressIndicator indicator) { ((UsageViewImpl)usageView).waitForUpdateRequestsCompletion(); ((UsageViewImpl)usageView).drainQueued...
waitForUsages
273,317
void (@NotNull ProgressIndicator indicator) { ((UsageViewImpl)usageView).waitForUpdateRequestsCompletion(); ((UsageViewImpl)usageView).drainQueuedUsageNodes(); ((UsageViewImpl)usageView).searchFinished(); }
run
273,318
Project () { return myFixture.getProject(); }
getProject
273,319
void () { GroupNode groupNode = buildUsageTree(new int[]{2, 3, 0}, UsageGroupingRule.EMPTY_ARRAY); assertNotNull(groupNode); assertNull(groupNode.getParent()); assertEquals("Root [0, 2, 3]", groupNode.toString()); }
testNoGroupingRules
273,320
void () { GroupNode groupNode = buildUsageTree(new int[]{0, 1, 0, 1 , 1}, new UsageGroupingRule[] {new OddEvenGroupingRule()}); assertEquals("Root [Even[0, 0], Odd[1, 1, 1]]", groupNode.toString()); }
testOneGroupingRuleOnly
273,321
void () { GroupNode groupNode = buildUsageTree(new int[]{0, 1, 0, 1 , 1, 1003, 1002, 1001}, new UsageGroupingRule[] {new OddEvenGroupingRule()}); assertEquals("Root [Even[0, 0], Odd[1, 1, 1], 1001, 1002, 1003]", groupNode.toString()); }
testNotGroupedItemsComeToEnd
273,322
void () { GroupNode groupNode = buildUsageTree(new int[]{0, 1, 2, 3, 12, 13, 14, 15, 101, 103, 102, 105, 10001, 10002, 10003}, new UsageGroupingRule[] { new OddEvenGroupingRule(), new LogGroupingRule()}); assertEquals("Root [Even[1[0, 2], 2[12, 14], 3[102]], Odd[1[1, 3], 2[13, 15], 3[101, 103, 105]], 5[10001, 10002, 10...
test2Groupings
273,323
void () { GroupNode groupNode = buildUsageTree(new int[]{10003, 0}, new UsageGroupingRule[] { new OddEvenGroupingRule(), new LogGroupingRule()}); assertEquals("Root [Even[1[0]], 5[10003]]", groupNode.toString()); }
testDifferentRulesDontDependOnOrder
273,324
void () { GroupNode groupNode = buildUsageTree(new int[]{10003, 0, 1, 2, 3, 12, 13, 14, 15, 101, 103, 102, 105, 10001, 10002}, new UsageGroupingRule[] { new OddEvenGroupingRule(), new LogGroupingRule()}); assertEquals("Root [Even[1[0, 2], 2[12, 14], 3[102]], Odd[1[1, 3], 2[13, 15], 3[101, 103, 105]], 5[10001, 10002, 10...
testGroupsFromDifferentRulesAreCorrectlySorted
273,325
Usage (int index) { return new MockUsage(index); }
createUsage
273,326
GroupNode (int[] indices, UsageGroupingRule[] rules) { List<Usage> usages = IntStream.of(indices).mapToObj(UsageNodeTreeBuilderTest::createUsage).collect(Collectors.toList()); UsageViewPresentation presentation = new UsageViewPresentation(); presentation.setUsagesString("searching for mock usages"); ExtensionPoint<Usag...
buildUsageTree
273,327
void (@NotNull ProgressIndicator indicator) { usageView.waitForUpdateRequestsCompletion(); }
run
273,328
UsageGroup (@NotNull Usage usage, UsageTarget @NotNull [] targets) { return new LogUsageGroup(usage.toString().length()); }
getParentGroupFor
273,329
String () { return String.valueOf(myPower); }
getPresentableGroupText
273,330
String () { return getPresentableGroupText(); }
toString
273,331
int (@NotNull UsageGroup o) { if (!(o instanceof LogUsageGroup)) return 1; return myPower - ((LogUsageGroup)o).myPower; }
compareTo
273,332
boolean (Object o) { return o instanceof LogUsageGroup && myPower == ((LogUsageGroup)o).myPower; }
equals
273,333
int () { return myPower; }
hashCode
273,334
String () { return "Even"; }
getPresentableGroupText
273,335
int (@NotNull UsageGroup o) { return o == ODD ? -1 : 0; }
compareTo
273,336
String () { return getPresentableGroupText(); }
toString
273,337
String () { return "Odd"; }
getPresentableGroupText
273,338
int (@NotNull UsageGroup o) { return o == EVEN ? 1 : 0; }
compareTo
273,339
String () { return getPresentableGroupText(); }
toString
273,340
UsageGroup (@NotNull Usage usage, UsageTarget @NotNull [] targets) { MockUsage mockUsage = (MockUsage)usage; if (mockUsage.getId() > 1000) return null; return mockUsage.getId() % 2 == 0 ? EVEN : ODD; }
getParentGroupFor
273,341
int () { return myId; }
getId
273,342
UsagePresentation () { return new UsagePresentation() { @Override public TextChunk @NotNull [] getText() { return TextChunk.EMPTY_ARRAY; } @Override @NotNull public String getPlainText() { return ""; } @Override public Icon getIcon() { return null; } @Override public String getTooltipText() { return null; } }; }
getPresentation
273,343
String () { return ""; }
getPlainText
273,344
Icon () { return null; }
getIcon
273,345
String () { return null; }
getTooltipText
273,346
boolean () { return true; }
isValid
273,347
FileEditorLocation () { return null; }
getLocation
273,348
void () { }
selectInEditor
273,349
void () { }
highlightInEditor
273,350
String () { return String.valueOf(myId); }
toString
273,351
boolean () { return false; }
isReadOnly
273,352
void () { VirtualFile dir = temporaryDirectory.createVirtualDir(); FindModel findModel = new FindModel(); findModel.setDirectoryName(dir.getPath()); findModel.setWithSubdirectories(true); findModel.setProjectScope(false); UsageTarget target = new FindInProjectUtil.StringUsageTarget(projectRule.getProject(), findModel);...
scopeCreatedForFindInDirectory
273,353
void () { Module module = projectRule.getModule(); FindModel findModel = new FindModel(); findModel.setModuleName(module.getName()); findModel.setProjectScope(false); UsageTarget target = new FindInProjectUtil.StringUsageTarget(projectRule.getProject(), findModel); UsageViewManagerImpl manager = (UsageViewManagerImpl)U...
scopeCreatedForFindInModuleContent
273,354
void () { doChangesTest("NameSuggesterTest", "NameUnifierTest", "[<Suggester,Unifier>]"); }
testChanges1
273,355
void () { doChangesTest("CompletionContext", "CompletionResult", "[<Context,Result>]"); }
testChanges2
273,356
void () { doChangesTest("CodeCompletionContext", "CompletionResult", "[<Code,>, <Context,Result>]"); }
testChanges3
273,357
void () { doChangesTest("A", "B", "[<A,B>]"); }
testChanges4
273,358
void () { doChangesTest("PsiManager", "PsiManagerImpl", "[<,Impl>]"); }
testChanges5
273,359
void () { doChangesTest("IBase", "IMain", "[<Base,Main>]"); }
testChanges6
273,360
void () { doChangesTest("FooBarBazAbaCaba", "FooAbaBazBarCaba", "[<BarBaz,>, <,BazBar>]"); }
testChanges7
273,361
void () { doChangesTest("FooBar", "BarFoo", "[<Foo,>, <,Foo>]"); }
testChanges8
273,362
void () { doSuggestionTest("NameSuggesterTest", "NameUnifierTest", "suggester", "unifier"); }
testSuggestions1
273,363
void () { doSuggestionTest("CompletionContext", "CompletionResult", "completionContext", "completionResult"); }
testSuggestions2
273,364
void () { doSuggestionTest("CompletionContext", "CompletionResult", "context", "result"); }
testSuggestions3
273,365
void () { doSuggestionTest("CompletionContext", "CompletionResult", "codeCompletionContext", "codeCompletionResult"); }
testSuggestions4
273,366
void () { doSuggestionTest("CodeCompletionContext", "CompletionResult", "codeCompletionContext", "completionResult"); }
testSuggestions5
273,367
void () { doSuggestionTest("CodeCompletionContext", "CompletionResult", "context", "result"); }
testSuggestions6
273,368
void () { doSuggestionTest("CodeCompletionContext", "CompletionResult", "contextWithAdvances", "resultWithAdvances"); }
testSuggestions7
273,369
void () { doSuggestionTest("CodeCompletionContext", "CompletionResult", "_context", "_result"); }
testSuggestions8
273,370
void () { doSuggestionTest("CodeCompletionContext", "CompletionResult", "p_context", "p_result"); }
testSuggestions9
273,371
void () { doSuggestionTest("IBase", "IMain", "base", "main"); }
testSuggestions10
273,372
void () { doSuggestionTest("Descriptor", "BasicDescriptor", "descriptor", "basicDescriptor"); }
testSuggestions11
273,373
void () { doSuggestionTest("Provider", "ObjectProvider", "provider", "objectProvider"); }
testSuggestions12
273,374
void () { doSuggestionTest("SimpleModel", "Model", "simpleModel", "model"); }
testSuggestions13
273,375
void () { doSuggestionTest("ConfigItem", "Config", "item", "item"); }
testSuggestions14
273,376
void () { doSuggestionTest("Transaction", "TransactionPolicy", "transaction", "transactionPolicy"); }
testSuggestions15
273,377
void () { doSuggestionTest("Transaction", "TransactionPolicyHandler", "transaction", "transactionPolicyHandler"); }
testSuggestions16
273,378
void () { doSuggestionTest("Transaction", "StrictTransactionPolicyHandler", "transaction", "strictTransactionPolicyHandler"); }
testSuggestions17
273,379
void () { doSuggestionTest("Foo", "FooTask", "fooImpl", "fooTaskImpl"); }
testSuggestions18
273,380
void () { doSuggestionTest("Foo", "FooTask", "implFoo", "implFooTask"); }
testSuggestions19
273,381
void () { doSuggestionTest("Foo", "TaskFoo", "fooImpl", "taskFooImpl"); }
testSuggestions20
273,382
void () { doSuggestionTest("Foo", "TaskFoo", "implFoo", "implTaskFoo"); }
testSuggestions21
273,383
void () { doSuggestionTest("Foo", "FooBar", "someFooAwesome", "someFooBarAwesome"); }
testSuggestions22
273,384
void () { doSuggestionTest("Foo", "FooBarBaz", "someFooAwesome", "someFooBarBazAwesome"); }
testSuggestions23
273,385
void () { doSuggestionTest("FooBar", "FooBarBaz", "someFooBarAwesome", "someFooBarBazAwesome"); }
testSuggestions24
273,386
void () { doSuggestionTest("FooBar", "Foo", "someFooBarAwesome", "someFooAwesome"); }
testSuggestions25
273,387
void () { doSuggestionTest("FooBarBaz", "FooBar", "someFooBarBazAwesome", "someFooBarAwesome"); }
testSuggestions26
273,388
void () { doSuggestionTest("FooBarBaz", "AbaBarCaba", "someFooBarBazAwesome", "someAbaBarCabaAwesome"); }
testSuggestions27
273,389
void () { doSuggestionTest("FooBarBaz", "Baz", "someFooBarBazAwesome", "someBazAwesome"); }
testSuggestions28
273,390
void () { doSuggestionTest("FooBarBaz", "Bar", "someFooBarBazAwesome", "someBarAwesome"); }
testSuggestions29
273,391
void () { doSuggestionTest("FooBarBaz", "FooAbaBaz", "someFooBarBazAwesome", "someFooAbaBazAwesome"); }
testSuggestions30
273,392
void () { doSuggestionTest("Foo", "BarFoo", "someFooAwesome", "someBarFooAwesome"); }
testSuggestions31
273,393
void () { doSuggestionTest("FooBar", "BazFooBar", "someFooBarAwesome", "someBazFooBarAwesome"); }
testSuggestions32
273,394
void () { doSuggestionTest("FooBar", "BarFoo", "someFooBarAwesome", "someBarFooAwesome"); }
testSuggestions33
273,395
void () { doSuggestionTest("FooBarBazAbaCaba", "FooAbaBazBarCaba", "someFooBarBazAbaCabaAwesome", "someFooAbaBazBarCabaAwesome"); }
testSuggestions34
273,396
void () { doSuggestionTest("Foo", "Bar", "someFooAwesome", "someBarAwesome"); }
testSuggestions35
273,397
void () { doSuggestionTest("FooBar", "FooBarBaz", "someBarAwesome", "someBarBazAwesome"); }
testSuggestions36
273,398
void () { doSuggestionTest("BarBaz", "FooBarBaz", "someBarAwesome", "someFooBarAwesome"); }
testSuggestions37
273,399
void () { doSuggestionTest("Bar", "FooBarBaz", "someBarAwesome", "someFooBarBazAwesome"); }
testSuggestions38