Create workspace object always and adopt accordingly

This commit is contained in:
Sandeep Somavarapu
2017-09-13 21:26:14 +02:00
parent 923c987072
commit 8625945db5
20 changed files with 116 additions and 155 deletions

View File

@@ -59,11 +59,10 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape {
// --- search ---
$startSearch(include: string, exclude: string, maxResults: number, requestId: number): Thenable<URI[]> {
if (this._contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
const workspace = this._contextService.getWorkspace();
if (!workspace.roots.length) {
return undefined;
}
const workspace = this._contextService.getWorkspace();
const query: ISearchQuery = {
folderQueries: workspace.roots.map(root => ({ folder: root })),
type: QueryType.File,