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); UsageViewManagerImpl manager = (UsageViewManagerImpl)UsageViewManager.getInstance(projectRule.getProject()); ApplicationManager.getApplication().runReadAction(() -> { SearchScope scope = manager.getMaxSearchScopeToWarnOfFallingOutOf(new UsageTarget[]{target}).get(); assertThat(GlobalSearchScopesCore.directoryScope(projectRule.getProject(), dir, true)).isEqualTo(scope); }); }