mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Ensure workspace is read from WorkspaceContextService
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
import { isPromiseCanceledError } from 'vs/base/common/errors';
|
||||
import { ISearchService, QueryType } from 'vs/platform/search/common/search';
|
||||
import { IWorkspaceContextService, IWorkspace } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
|
||||
@@ -21,7 +21,7 @@ export class MainThreadWorkspace extends MainThreadWorkspaceShape {
|
||||
|
||||
private _activeSearches: { [id: number]: TPromise<Uri[]> } = Object.create(null);
|
||||
private _searchService: ISearchService;
|
||||
private _workspace: IWorkspace;
|
||||
private _contextService: IWorkspaceContextService;
|
||||
private _textFileService: ITextFileService;
|
||||
private _editorService: IWorkbenchEditorService;
|
||||
private _textModelResolverService: ITextModelResolverService;
|
||||
@@ -38,7 +38,7 @@ export class MainThreadWorkspace extends MainThreadWorkspaceShape {
|
||||
super();
|
||||
|
||||
this._searchService = searchService;
|
||||
this._workspace = contextService.getWorkspace();
|
||||
this._contextService = contextService;
|
||||
this._textFileService = textFileService;
|
||||
this._editorService = editorService;
|
||||
this._fileService = fileService;
|
||||
@@ -46,13 +46,13 @@ export class MainThreadWorkspace extends MainThreadWorkspaceShape {
|
||||
}
|
||||
|
||||
$startSearch(include: string, exclude: string, maxResults: number, requestId: number): Thenable<Uri[]> {
|
||||
|
||||
if (!this._workspace) {
|
||||
const workspace = this._contextService.getWorkspace();
|
||||
if (!workspace) {
|
||||
return;
|
||||
}
|
||||
|
||||
const search = this._searchService.search({
|
||||
folderResources: [this._workspace.resource],
|
||||
folderResources: [workspace.resource],
|
||||
type: QueryType.File,
|
||||
maxResults,
|
||||
includePattern: { [include]: true },
|
||||
|
||||
Reference in New Issue
Block a user