List<TestDataFile> (@NotNull DataContext context) { final PsiMethod method = ReadAction.compute(() -> findTargetMethod(context)); if (method == null) { PsiClass parametrizedTestClass = ReadAction.compute(() -> findParametrizedClass(context)); return parametrizedTestClass == null ? Collections.emptyList() : TestDataGuessByTestDiscoveryUtil.collectTestDataByExistingFiles(parametrizedTestClass); } final String name = ReadAction.compute(() -> method.getName()); if (name.startsWith("test")) { String testDataPath = ReadAction.compute(() -> TestDataLineMarkerProvider.getTestDataBasePath(method.getContainingClass())); final TestDataReferenceCollector collector = new TestDataReferenceCollector(testDataPath, name.substring(4)); return collector.collectTestDataReferences(method); } return ReadAction.compute(() -> { final Location<?> location = Location.DATA_KEY.getData(context); if (location instanceof PsiMemberParameterizedLocation) { PsiClass parametrizedTestClass = findParametrizedClass(context); if (parametrizedTestClass != null) { String testDataPath = TestDataLineMarkerProvider.getTestDataBasePath(parametrizedTestClass); String paramSetName = ((PsiMemberParameterizedLocation)location).getParamSetName(); String baseFileName = StringUtil.trimEnd(StringUtil.trimStart(paramSetName, "["), "]"); return TestDataGuessByExistingFilesUtil.suggestTestDataFiles(baseFileName, testDataPath, parametrizedTestClass); } } return Collections.emptyList(); }); }