From 97e4c8098e7f79d3d4ea7b1e7309a955deddb6c4 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 22 Jun 2017 22:13:25 -0700 Subject: [PATCH] Don't try to search when no folders are open --- .../workbench/services/search/node/ripgrepTextSearch.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vs/workbench/services/search/node/ripgrepTextSearch.ts b/src/vs/workbench/services/search/node/ripgrepTextSearch.ts index a9b83dfc488..63ead1b1f9b 100644 --- a/src/vs/workbench/services/search/node/ripgrepTextSearch.ts +++ b/src/vs/workbench/services/search/node/ripgrepTextSearch.ts @@ -41,6 +41,14 @@ export class RipgrepEngine { // TODO@Rob - make promise-based once the old search is gone, and I don't need them to have matching interfaces anymore search(onResult: (match: ISerializedFileMatch) => void, onMessage: (message: ISearchLog) => void, done: (error: Error, complete: ISerializedSearchComplete) => void): void { + if (!this.config.folderQueries.length) { + done(null, { + limitHit: false, + stats: null + }); + return; + } + const rgArgs = getRgArgs(this.config); if (rgArgs.siblingClauses) { this.postProcessExclusions = glob.parseToAsync(rgArgs.siblingClauses, { trimForExclusions: true }); -- GitLab