mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
move mult-root API out of root, #28526
This commit is contained in:
@@ -55,12 +55,6 @@ export interface IExtensionApiFactory {
|
||||
(extension: IExtensionDescription): typeof vscode;
|
||||
}
|
||||
|
||||
function assertProposedApi(extension: IExtensionDescription): void {
|
||||
if (!extension.enableProposedApi) {
|
||||
throw new Error(`[${extension.id}]: Proposed API is only available when running out of dev or with the following command line switch: --enable-proposed-api ${extension.id}`);
|
||||
}
|
||||
}
|
||||
|
||||
function proposedApiFunction<T>(extension: IExtensionDescription, fn: T): T {
|
||||
if (extension.enableProposedApi) {
|
||||
return fn;
|
||||
@@ -371,16 +365,13 @@ export function createApiFactory(
|
||||
return extHostWorkspace.getWorkspaceFolder(resource);
|
||||
},
|
||||
get workspaceFolders() {
|
||||
// proposed api
|
||||
assertProposedApi(extension);
|
||||
apiUsage.publicLog('workspace#workspaceFolders');
|
||||
return extHostWorkspace.getWorkspaceFolders();
|
||||
},
|
||||
onDidChangeWorkspaceFolders: proposedApiFunction(extension, (listener, thisArgs?, disposables?) => {
|
||||
// proposed api
|
||||
onDidChangeWorkspaceFolders: function (listener, thisArgs?, disposables?) {
|
||||
apiUsage.publicLog('workspace#onDidChangeWorkspaceFolders');
|
||||
return extHostWorkspace.onDidChangeWorkspace(listener, thisArgs, disposables);
|
||||
}),
|
||||
},
|
||||
asRelativePath: (pathOrUri) => {
|
||||
return extHostWorkspace.getRelativePath(pathOrUri);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user