Skip to content

Commit

Permalink
Fix #42219 - don't invoke ripgrep on workspace folders that don't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Feb 15, 2018
1 parent 3412eab commit 70e020b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vs/workbench/services/search/node/searchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { onUnexpectedError } from 'vs/base/common/errors';
import { Schemas } from 'vs/base/common/network';
import * as pfs from 'vs/base/node/pfs';
import { ILogService } from 'vs/platform/log/common/log';

export class SearchService implements ISearchService {
Expand Down Expand Up @@ -267,7 +268,7 @@ export class DiskSearch implements ISearchResultProvider {
this.raw = new SearchChannelClient(channel);
}

public search(query: ISearchQuery): PPromise<ISearchComplete, ISearchProgressItem> {
public async search(query: ISearchQuery): PPromise<ISearchComplete, ISearchProgressItem> {
let request: PPromise<ISerializedSearchComplete, ISerializedSearchProgressItem>;

let rawSearch: IRawSearch = {
Expand All @@ -287,7 +288,7 @@ export class DiskSearch implements ISearchResultProvider {

if (query.folderQueries) {
for (const q of query.folderQueries) {
if (q.folder.scheme === Schemas.file) {
if (q.folder.scheme === Schemas.file && await pfs.exists(q.folder.path)) {
rawSearch.folderQueries.push({
excludePattern: q.excludePattern,
includePattern: q.includePattern,
Expand Down

0 comments on commit 70e020b

Please sign in to comment.