disable parallel search to close #178

This commit is contained in:
Vadim Lopatin 2016-10-11 15:06:57 +03:00
parent f6edf6712c
commit 20826288ca
1 changed files with 23 additions and 6 deletions

View File

@ -11,6 +11,9 @@ import dlangide.workspace.project;
import std.string; import std.string;
import std.conv; import std.conv;
// parallel search is disabled to fix #178
//version = PARALLEL_SEARCH;
interface SearchResultClickHandler { interface SearchResultClickHandler {
bool onSearchResultClick(int line); bool onSearchResultClick(int line);
} }
@ -221,7 +224,10 @@ class SearchWidget : TabWidget {
ProjectFolder projFolder = cast(ProjectFolder) project; ProjectFolder projFolder = cast(ProjectFolder) project;
import std.parallelism; import std.parallelism;
for (int i = 0; i < projFolder.childCount; i++) { for (int i = 0; i < projFolder.childCount; i++) {
taskPool.put(task(&searchInProject, projFolder.child(i), text)); version (PARALLEL_SEARCH)
taskPool.put(task(&searchInProject, projFolder.child(i), text));
else
searchInProject(projFolder.child(i), text);
} }
} }
else { else {
@ -254,19 +260,30 @@ class SearchWidget : TabWidget {
break; break;
case "Project": case "Project":
foreach(Project project; _frame._wsPanel.workspace.projects) { foreach(Project project; _frame._wsPanel.workspace.projects) {
if(!project.isDependency) if(!project.isDependency) {
taskPool.put(task(&searchInProject, project.items, source)); version (PARALLEL_SEARCH)
taskPool.put(task(&searchInProject, project.items, source));
else
searchInProject(project.items, source);
}
} }
break; break;
case "Dependencies": case "Dependencies":
foreach(Project project; _frame._wsPanel.workspace.projects) { foreach(Project project; _frame._wsPanel.workspace.projects) {
if(project.isDependency) if(project.isDependency) {
taskPool.put(task(&searchInProject, project.items, source)); version (PARALLEL_SEARCH)
taskPool.put(task(&searchInProject, project.items, source));
else
searchInProject(project.items, source);
}
} }
break; break;
case "Everywhere": case "Everywhere":
foreach(Project project; _frame._wsPanel.workspace.projects) { foreach(Project project; _frame._wsPanel.workspace.projects) {
taskPool.put(task(&searchInProject, project.items, source)); version (PARALLEL_SEARCH)
taskPool.put(task(&searchInProject, project.items, source));
else
searchInProject(project.items, source);
} }
break; break;
default: default: