Skip to content

Commit 77accd5

Browse files
committed
Intercept remote extension scanning on client side
1 parent c783d52 commit 77accd5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { ITelemetryData, TelemetryLevel } from 'vs/platform/telemetry/common/tel
2020
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
2121
import { IProductService } from 'vs/platform/product/common/productService';
2222
import { URI } from 'vs/base/common/uri';
23+
import { ImplicitActivationEvents } from 'vs/platform/extensionManagement/common/implicitActivationEvents';
2324

2425
export abstract class AbstractRemoteAgentService extends Disposable implements IRemoteAgentService {
2526

@@ -85,14 +86,24 @@ export abstract class AbstractRemoteAgentService extends Disposable implements I
8586

8687
scanExtensions(skipExtensions: ExtensionIdentifier[] = []): Promise<IExtensionDescription[]> {
8788
return this._withChannel(
88-
(channel, connection) => RemoteExtensionEnvironmentChannelClient.scanExtensions(channel, connection.remoteAuthority, this._environmentService.extensionDevelopmentLocationURI, skipExtensions),
89+
async (channel, connection) => {
90+
const scannedExtensions = await RemoteExtensionEnvironmentChannelClient.scanExtensions(channel, connection.remoteAuthority, this._environmentService.extensionDevelopmentLocationURI, skipExtensions);
91+
scannedExtensions.forEach((extension) => ImplicitActivationEvents.updateManifest(extension));
92+
return scannedExtensions;
93+
},
8994
[]
9095
).then(undefined, () => []);
9196
}
9297

9398
scanSingleExtension(extensionLocation: URI, isBuiltin: boolean): Promise<IExtensionDescription | null> {
9499
return this._withChannel(
95-
(channel, connection) => RemoteExtensionEnvironmentChannelClient.scanSingleExtension(channel, connection.remoteAuthority, isBuiltin, extensionLocation),
100+
async (channel, connection) => {
101+
const scannedExtension = await RemoteExtensionEnvironmentChannelClient.scanSingleExtension(channel, connection.remoteAuthority, isBuiltin, extensionLocation);
102+
if (scannedExtension !== null) {
103+
ImplicitActivationEvents.updateManifest(scannedExtension);
104+
}
105+
return scannedExtension;
106+
},
96107
null
97108
).then(undefined, () => null);
98109
}

0 commit comments

Comments
 (0)