mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
add $acceptWorkspaceData to push new info about open folders, #28526
This commit is contained in:
@@ -6,26 +6,30 @@
|
||||
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { normalize } from 'vs/base/common/paths';
|
||||
import { isFalsyOrEmpty } from 'vs/base/common/arrays';
|
||||
import { relative } from 'path';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { IResourceEdit } from 'vs/editor/common/services/bulkEdit';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { fromRange, EndOfLine } from 'vs/workbench/api/node/extHostTypeConverters';
|
||||
import { MainContext, MainThreadWorkspaceShape } from './extHost.protocol';
|
||||
import { ExtHostWorkspaceShape, MainContext, MainThreadWorkspaceShape } from './extHost.protocol';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
export class ExtHostWorkspace {
|
||||
export class ExtHostWorkspace extends ExtHostWorkspaceShape {
|
||||
|
||||
private static _requestIdPool = 0;
|
||||
|
||||
private _proxy: MainThreadWorkspaceShape;
|
||||
private _workspacePath: string;
|
||||
|
||||
constructor(threadService: IThreadService, workspacePath: string) {
|
||||
constructor(threadService: IThreadService, folders: URI[]) {
|
||||
super();
|
||||
this._proxy = threadService.get(MainContext.MainThreadWorkspace);
|
||||
this._workspacePath = workspacePath;
|
||||
this._workspacePath = isFalsyOrEmpty(folders) ? undefined : folders[0].fsPath;
|
||||
}
|
||||
|
||||
// --- workspace ---
|
||||
|
||||
getPath(): string {
|
||||
return this._workspacePath;
|
||||
}
|
||||
@@ -55,6 +59,12 @@ export class ExtHostWorkspace {
|
||||
return normalize(result);
|
||||
}
|
||||
|
||||
$acceptWorkspaceData(folders: URI[]): void {
|
||||
// todo@joh do something, align with ctor URI[] vs IWorkspace
|
||||
}
|
||||
|
||||
// --- search ---
|
||||
|
||||
findFiles(include: string, exclude: string, maxResults?: number, token?: vscode.CancellationToken): Thenable<vscode.Uri[]> {
|
||||
const requestId = ExtHostWorkspace._requestIdPool++;
|
||||
const result = this._proxy.$startSearch(include, exclude, maxResults, requestId);
|
||||
|
||||
Reference in New Issue
Block a user