Merge from vscode 817eb6b0c720a4ecbc13c020afbbebfed667aa09 (#7356)

This commit is contained in:
Anthony Dresser
2019-09-24 21:36:17 -07:00
committed by GitHub
parent a29ae4d3b9
commit 6a6048d40f
541 changed files with 7045 additions and 7287 deletions

View File

@@ -27,7 +27,6 @@ import { ExtHostDocumentContentProvider } from 'vs/workbench/api/common/extHostD
import { ExtHostDocumentSaveParticipant } from 'vs/workbench/api/common/extHostDocumentSaveParticipant';
import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments';
import { IExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors';
import { ExtensionActivatedByAPI } from 'vs/workbench/api/common/extHostExtensionActivator';
import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService';
import { ExtHostFileSystem } from 'vs/workbench/api/common/extHostFileSystem';
import { ExtHostFileSystemEventService } from 'vs/workbench/api/common/extHostFileSystemEventService';
@@ -250,6 +249,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
openExternal(uri: URI) {
return extHostWindow.openUri(uri, { allowTunneling: !!initData.remote.isRemote });
},
resolveExternalUri(uri: URI) {
checkProposedApiEnabled(extension);
return extHostWindow.resolveExternalUri(uri, { allowTunneling: !!initData.remote.isRemote });
},
get remoteName() {
return getRemoteName(initData.remote.authority);
},
@@ -272,12 +275,12 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
getExtension(extensionId: string): Extension<any> | undefined {
const desc = extensionRegistry.getExtensionDescription(extensionId);
if (desc) {
return new Extension(extensionService, desc, extensionKind);
return new Extension(extensionService, extension.identifier, desc, extensionKind);
}
return undefined;
},
get all(): Extension<any>[] {
return extensionRegistry.getAllExtensionDescriptions().map((desc) => new Extension(extensionService, desc, extensionKind));
return extensionRegistry.getAllExtensionDescriptions().map((desc) => new Extension(extensionService, extension.identifier, desc, extensionKind));
},
get onDidChange() {
return extensionRegistry.onDidChange;
@@ -760,7 +763,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
registerDebugAdapterTrackerFactory(debugType: string, factory: vscode.DebugAdapterTrackerFactory) {
return undefined;
},
startDebugging(folder: vscode.WorkspaceFolder | undefined, nameOrConfig: string | vscode.DebugConfiguration, parentSession?: vscode.DebugSession) {
startDebugging(folder: vscode.WorkspaceFolder | undefined, nameOrConfig: string | vscode.DebugConfiguration, parentSessionOrOptions?: vscode.DebugSession | vscode.DebugSessionOptions) {
return undefined;
},
addBreakpoints(breakpoints: vscode.Breakpoint[]) {
@@ -907,6 +910,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
CallHierarchyOutgoingCall: extHostTypes.CallHierarchyOutgoingCall,
CallHierarchyIncomingCall: extHostTypes.CallHierarchyIncomingCall,
CallHierarchyItem: extHostTypes.CallHierarchyItem,
DebugConsoleMode: extHostTypes.DebugConsoleMode,
Decoration: extHostTypes.Decoration,
WebviewEditorState: extHostTypes.WebviewEditorState,
UIKind: UIKind
@@ -917,6 +921,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
class Extension<T> implements vscode.Extension<T> {
private _extensionService: IExtHostExtensionService;
private _originExtensionId: ExtensionIdentifier;
private _identifier: ExtensionIdentifier;
readonly id: string;
@@ -924,8 +929,9 @@ class Extension<T> implements vscode.Extension<T> {
readonly packageJSON: IExtensionDescription;
readonly extensionKind: vscode.ExtensionKind;
constructor(extensionService: IExtHostExtensionService, description: IExtensionDescription, kind: extHostTypes.ExtensionKind) {
constructor(extensionService: IExtHostExtensionService, originExtensionId: ExtensionIdentifier, description: IExtensionDescription, kind: extHostTypes.ExtensionKind) {
this._extensionService = extensionService;
this._originExtensionId = originExtensionId;
this._identifier = description.identifier;
this.id = description.identifier.value;
this.extensionPath = path.normalize(originalFSPath(description.extensionLocation));
@@ -945,6 +951,6 @@ class Extension<T> implements vscode.Extension<T> {
}
activate(): Thenable<T> {
return this._extensionService.activateByIdWithErrors(this._identifier, new ExtensionActivatedByAPI(false)).then(() => this.exports);
return this._extensionService.activateByIdWithErrors(this._identifier, { startup: false, extensionId: this._originExtensionId, activationEvent: 'api' }).then(() => this.exports);
}
}