Skip to content

Commit

Permalink
Fixes microsoft/vscode-remote-release#1400: Allow UI extensions to ru…
Browse files Browse the repository at this point in the history
…n remotely
  • Loading branch information
alexdima committed Sep 23, 2019
1 parent e5383cf commit 00983bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,11 @@ export class ExtensionEnablementService extends Disposable implements IExtension

private _isDisabledByExtensionKind(extension: IExtension): boolean {
if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) {
const server = isUIExtension(extension.manifest, this.productService, this.configurationService) ? this.extensionManagementServerService.localExtensionManagementServer : this.extensionManagementServerService.remoteExtensionManagementServer;
return this.extensionManagementServerService.getExtensionManagementServer(extension.location) !== server;
if (!isUIExtension(extension.manifest, this.productService, this.configurationService)) {
// workspace extensions must run on the remote, but UI extensions can run on either side
const server = this.extensionManagementServerService.remoteExtensionManagementServer;
return this.extensionManagementServerService.getExtensionManagementServer(extension.location) !== server;
}
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,13 @@ export class ExtensionService extends AbstractExtensionService implements IExten
// remove disabled extensions
remoteEnv.extensions = remove(remoteEnv.extensions, extension => this._isDisabled(extension));

// remove UI extensions from the remote extensions
remoteEnv.extensions = remove(remoteEnv.extensions, extension => isUIExtension(extension));

// remove non-UI extensions from the local extensions
localExtensions = remove(localExtensions, extension => !extension.isBuiltin && !isUIExtension(extension));

// in case of overlap, the remote wins
// in case of UI extensions overlap, the local extension wins
remoteEnv.extensions = remove(remoteEnv.extensions, localExtensions.filter(extension => isUIExtension(extension)));

// in case of other extensions overlap, the remote extension wins
localExtensions = remove(localExtensions, remoteEnv.extensions);

// save for remote extension's init data
Expand Down

2 comments on commit 00983bc

@alexdima
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi @sandy081

@sandy081
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.