mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
merge master
This commit is contained in:
@@ -489,14 +489,14 @@ export function createApiFactory(
|
||||
get inputBox() {
|
||||
return extHostSCM.getLastInputBox(extension);
|
||||
},
|
||||
createSourceControl(id: string, label: string) {
|
||||
createSourceControl(id: string, label: string, rootUri?: vscode.Uri) {
|
||||
mainThreadTelemetry.$publicLog('registerSCMProvider', {
|
||||
extensionId: extension.id,
|
||||
providerId: id,
|
||||
providerLabel: label
|
||||
});
|
||||
|
||||
return extHostSCM.createSourceControl(extension, id, label);
|
||||
return extHostSCM.createSourceControl(extension, id, label, rootUri);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ export type SCMRawResourceSplices = [
|
||||
];
|
||||
|
||||
export interface MainThreadSCMShape extends IDisposable {
|
||||
$registerSourceControl(handle: number, id: string, label: string): void;
|
||||
$registerSourceControl(handle: number, id: string, label: string, rootUri: string | undefined): void;
|
||||
$updateSourceControl(handle: number, features: SCMProviderFeatures): void;
|
||||
$unregisterSourceControl(handle: number): void;
|
||||
|
||||
|
||||
@@ -287,6 +287,10 @@ class ExtHostSourceControl implements vscode.SourceControl {
|
||||
return this._label;
|
||||
}
|
||||
|
||||
get rootUri(): vscode.Uri | undefined {
|
||||
return this._rootUri;
|
||||
}
|
||||
|
||||
private _inputBox: ExtHostSCMInputBox;
|
||||
get inputBox(): ExtHostSCMInputBox { return this._inputBox; }
|
||||
|
||||
@@ -356,9 +360,10 @@ class ExtHostSourceControl implements vscode.SourceControl {
|
||||
private _commands: ExtHostCommands,
|
||||
private _id: string,
|
||||
private _label: string,
|
||||
private _rootUri?: vscode.Uri
|
||||
) {
|
||||
this._inputBox = new ExtHostSCMInputBox(this._proxy, this.handle);
|
||||
this._proxy.$registerSourceControl(this.handle, _id, _label);
|
||||
this._proxy.$registerSourceControl(this.handle, _id, _label, _rootUri && _rootUri.toString());
|
||||
}
|
||||
|
||||
private updatedResourceGroups = new Set<ExtHostSourceControlResourceGroup>();
|
||||
@@ -468,9 +473,9 @@ export class ExtHostSCM {
|
||||
});
|
||||
}
|
||||
|
||||
createSourceControl(extension: IExtensionDescription, id: string, label: string): vscode.SourceControl {
|
||||
createSourceControl(extension: IExtensionDescription, id: string, label: string, rootUri: vscode.Uri | undefined): vscode.SourceControl {
|
||||
const handle = ExtHostSCM._handlePool++;
|
||||
const sourceControl = new ExtHostSourceControl(this._proxy, this._commands, id, label);
|
||||
const sourceControl = new ExtHostSourceControl(this._proxy, this._commands, id, label, rootUri);
|
||||
this._sourceControls.set(handle, sourceControl);
|
||||
|
||||
const sourceControls = this._sourceControlsByExtension.get(extension.id) || [];
|
||||
|
||||
@@ -115,6 +115,8 @@ export function fromViewColumn(column?: vscode.ViewColumn): EditorPosition {
|
||||
editorColumn = EditorPosition.TWO;
|
||||
} else if (column === <number>types.ViewColumn.Three) {
|
||||
editorColumn = EditorPosition.THREE;
|
||||
} else if (column === <number>types.ViewColumn.Active) {
|
||||
editorColumn = undefined;
|
||||
}
|
||||
return editorColumn;
|
||||
}
|
||||
@@ -156,7 +158,7 @@ export namespace MarkdownString {
|
||||
}
|
||||
|
||||
function isCodeblock(thing: any): thing is Codeblock {
|
||||
return typeof thing === 'object'
|
||||
return thing && typeof thing === 'object'
|
||||
&& typeof (<Codeblock>thing).language === 'string'
|
||||
&& typeof (<Codeblock>thing).value === 'string';
|
||||
}
|
||||
|
||||
@@ -953,6 +953,7 @@ export class CompletionList {
|
||||
}
|
||||
|
||||
export enum ViewColumn {
|
||||
Active = -1,
|
||||
One = 1,
|
||||
Two = 2,
|
||||
Three = 3
|
||||
|
||||
Reference in New Issue
Block a user