Skip to content

Commit d13dd87

Browse files
committed
Use our retry for the searcher
Also dispose some things for the watcher because it doesn't seem that was done properly. The searcher also now starts immediately so there won't be lag when you perform your first search.
1 parent 4ce4dbb commit d13dd87

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

scripts/vscode.patch

+42-6
Original file line numberDiff line numberDiff line change
@@ -922,29 +922,31 @@ index 484cef9..f728fc8 100644
922922
- process.kill(initData.parentPid, 0); // throws an exception if the main process doesn't exist anymore.
923923
+ // process.kill(initData.parentPid, 0); // throws an exception if the main process doesn't exist anymore.
924924
diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts b/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts
925-
index ca03fc9..b8befc8 100644
925+
index ca03fc9..e3dcd08 100644
926926
--- a/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts
927927
+++ b/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts
928928
@@ -18,0 +19 @@ import { getPathFromAmdModule } from 'vs/base/common/amd';
929929
+const retry = (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.retry;
930930
@@ -35,0 +37 @@ export class FileWatcher {
931931
+ retry.register('Watcher', () => this.startWatching());
932-
@@ -56,0 +59 @@ export class FileWatcher {
932+
@@ -56,0 +59,2 @@ export class FileWatcher {
933+
+ this.toDispose = dispose(this.toDispose);
933934
+ return retry.run('Watcher');
934-
@@ -113 +116 @@ export class FileWatcher {
935+
@@ -113 +117 @@ export class FileWatcher {
935936
- }));
936937
+ })).then(() => retry.recover('Watcher'));
937938
diff --git a/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts b/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts
938-
index 7e3a324..0bc5aac 100644
939+
index 7e3a324..b9ccd63 100644
939940
--- a/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts
940941
+++ b/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts
941942
@@ -18,0 +19 @@ import { getPathFromAmdModule } from 'vs/base/common/amd';
942943
+const retry = (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.retry;
943944
@@ -36,0 +38 @@ export class FileWatcher {
944945
+ retry.register('Watcher', () => this.startWatching());
945-
@@ -59,0 +62 @@ export class FileWatcher {
946+
@@ -59,0 +62,2 @@ export class FileWatcher {
947+
+ this.toDispose = dispose(this.toDispose);
946948
+ return retry.run('Watcher');
947-
@@ -116 +119 @@ export class FileWatcher {
949+
@@ -116 +120 @@ export class FileWatcher {
948950
- }));
949951
+ })).then(() => retry.recover('Watcher'));
950952
diff --git a/src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts b/src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts
@@ -969,6 +971,40 @@ index 3c78990..545d91a 100644
969971
@@ -130 +130 @@ export class KeyboardMapperFactory {
970972
- if (OS === OperatingSystem.Windows) {
971973
+ if (isNative && OS === OperatingSystem.Windows) {
974+
diff --git a/src/vs/workbench/services/search/node/searchService.ts b/src/vs/workbench/services/search/node/searchService.ts
975+
index 3eaafa4..0345bad 100644
976+
--- a/src/vs/workbench/services/search/node/searchService.ts
977+
+++ b/src/vs/workbench/services/search/node/searchService.ts
978+
@@ -11 +11 @@ import { Event } from 'vs/base/common/event';
979+
-import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
980+
+import { Disposable, IDisposable, toDisposable, dispose } from 'vs/base/common/lifecycle';
981+
@@ -32,0 +33 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
982+
+const retry = (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.retry;
983+
@@ -433,0 +435 @@ export class DiskSearch implements ISearchResultProvider {
984+
+ private toDispose: IDisposable[] = [];
985+
@@ -470,6 +472,16 @@ export class DiskSearch implements ISearchResultProvider {
986+
- const client = new Client(
987+
- getPathFromAmdModule(require, 'bootstrap-fork'),
988+
- opts);
989+
-
990+
- const channel = getNextTickChannel(client.getChannel('search'));
991+
- this.raw = new SearchChannelClient(channel);
992+
+ const connect = (): void => {
993+
+ const client = new Client(
994+
+ getPathFromAmdModule(require, 'bootstrap-fork'),
995+
+ opts);
996+
+ client.onDidProcessExit(() => {
997+
+ this.toDispose = dispose(this.toDispose);
998+
+ retry.run('Searcher');
999+
+ }, null, this.toDispose);
1000+
+ this.toDispose.push(client);
1001+
+
1002+
+ const channel = getNextTickChannel(client.getChannel('search'));
1003+
+ this.raw = new SearchChannelClient(channel);
1004+
+ this.raw.clearCache('test-connectivity').then(() => retry.recover('Searcher'));
1005+
+ };
1006+
+ retry.register('Searcher', connect);
1007+
+ connect();
9721008
diff --git a/src/vs/workbench/services/timer/electron-browser/timerService.ts b/src/vs/workbench/services/timer/electron-browser/timerService.ts
9731009
index 6e6fbcc..645bd72 100644
9741010
--- a/src/vs/workbench/services/timer/electron-browser/timerService.ts

0 commit comments

Comments
 (0)