Revert "scm: make tree rendering opt-in via proposed API"

This reverts commit afa911d942.
This commit is contained in:
Joao Moreno
2019-10-11 19:10:27 +02:00
parent bede31d0d9
commit 4a81920398
8 changed files with 26 additions and 90 deletions

View File

@@ -9,7 +9,7 @@ import { debounce } from 'vs/base/common/decorators';
import { DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle';
import { asPromise } from 'vs/base/common/async';
import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
import { MainContext, MainThreadSCMShape, SCMRawResource, SCMRawResourceSplice, SCMRawResourceSplices, IMainContext, ExtHostSCMShape, ICommandDto, SCMProviderProps } from './extHost.protocol';
import { MainContext, MainThreadSCMShape, SCMRawResource, SCMRawResourceSplice, SCMRawResourceSplices, IMainContext, ExtHostSCMShape, ICommandDto } from './extHost.protocol';
import { sortedDiff, equals } from 'vs/base/common/arrays';
import { comparePaths } from 'vs/base/common/comparers';
import * as vscode from 'vscode';
@@ -452,15 +452,10 @@ class ExtHostSourceControl implements vscode.SourceControl {
private _commands: ExtHostCommands,
private _id: string,
private _label: string,
private _rootUri: vscode.Uri | undefined,
_props: SCMProviderProps
private _rootUri?: vscode.Uri
) {
if (!_extension.enableProposedApi && _props.treeRendering) {
throw new Error(`[${_extension.identifier.value}]: Proposed API is only available when running out of dev or with the following command line switch: --enable-proposed-api ${_extension.identifier.value}`);
}
this._inputBox = new ExtHostSCMInputBox(_extension, this._proxy, this.handle);
this._proxy.$registerSourceControl(this.handle, _id, _label, _rootUri, _props);
this._proxy.$registerSourceControl(this.handle, _id, _label, _rootUri);
}
private updatedResourceGroups = new Set<ExtHostSourceControlResourceGroup>();
@@ -522,12 +517,6 @@ class ExtHostSourceControl implements vscode.SourceControl {
}
}
function asProps(options: vscode.SourceControlOptions | undefined): SCMProviderProps {
return {
treeRendering: options && !!options.treeRendering || false
};
}
export class ExtHostSCM implements ExtHostSCMShape {
private static _handlePool: number = 0;
@@ -587,11 +576,11 @@ export class ExtHostSCM implements ExtHostSCMShape {
});
}
createSourceControl(extension: IExtensionDescription, id: string, label: string, rootUri: vscode.Uri | undefined, options?: vscode.SourceControlOptions): vscode.SourceControl {
createSourceControl(extension: IExtensionDescription, id: string, label: string, rootUri: vscode.Uri | undefined): vscode.SourceControl {
this.logService.trace('ExtHostSCM#createSourceControl', extension.identifier.value, id, label, rootUri);
const handle = ExtHostSCM._handlePool++;
const sourceControl = new ExtHostSourceControl(extension, this._proxy, this._commands, id, label, rootUri, asProps(options));
const sourceControl = new ExtHostSourceControl(extension, this._proxy, this._commands, id, label, rootUri);
this._sourceControls.set(handle, sourceControl);
const sourceControls = this._sourceControlsByExtension.get(ExtensionIdentifier.toKey(extension.identifier)) || [];