66import * as platform from 'vs/base/common/platform' ;
77import { URI , UriComponents } from 'vs/base/common/uri' ;
88import { IChannel } from 'vs/base/parts/ipc/common/ipc' ;
9- import { IExtensionDescription } from 'vs/platform/extensions/common/extensions' ;
9+ import { IExtensionDescription , ExtensionIdentifier } from 'vs/platform/extensions/common/extensions' ;
1010import { IRemoteAgentEnvironment } from 'vs/platform/remote/common/remoteAgentEnvironment' ;
1111import { IDiagnosticInfoOptions , IDiagnosticInfo } from 'vs/platform/diagnostics/common/diagnostics' ;
1212import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry' ;
1313
1414export interface IGetEnvironmentDataArguments {
15+ remoteAuthority : string ;
16+ }
17+
18+ export interface IScanExtensionsArguments {
1519 language : string ;
1620 remoteAuthority : string ;
1721 extensionDevelopmentPath : UriComponents [ ] | undefined ;
22+ skipExtensions : ExtensionIdentifier [ ] ;
1823}
1924
2025export interface IRemoteAgentEnvironmentDTO {
@@ -28,17 +33,14 @@ export interface IRemoteAgentEnvironmentDTO {
2833 globalStorageHome : UriComponents ;
2934 workspaceStorageHome : UriComponents ;
3035 userHome : UriComponents ;
31- extensions : IExtensionDescription [ ] ;
3236 os : platform . OperatingSystem ;
3337}
3438
3539export class RemoteExtensionEnvironmentChannelClient {
3640
37- static async getEnvironmentData ( channel : IChannel , remoteAuthority : string , extensionDevelopmentPath ?: URI [ ] ) : Promise < IRemoteAgentEnvironment > {
41+ static async getEnvironmentData ( channel : IChannel , remoteAuthority : string ) : Promise < IRemoteAgentEnvironment > {
3842 const args : IGetEnvironmentDataArguments = {
39- language : platform . language ,
40- remoteAuthority,
41- extensionDevelopmentPath
43+ remoteAuthority
4244 } ;
4345
4446 const data = await channel . call < IRemoteAgentEnvironmentDTO > ( 'getEnvironmentData' , args ) ;
@@ -54,11 +56,24 @@ export class RemoteExtensionEnvironmentChannelClient {
5456 globalStorageHome : URI . revive ( data . globalStorageHome ) ,
5557 workspaceStorageHome : URI . revive ( data . workspaceStorageHome ) ,
5658 userHome : URI . revive ( data . userHome ) ,
57- extensions : data . extensions . map ( ext => { ( < any > ext ) . extensionLocation = URI . revive ( ext . extensionLocation ) ; return ext ; } ) ,
5859 os : data . os
5960 } ;
6061 }
6162
63+ static async scanExtensions ( channel : IChannel , remoteAuthority : string , extensionDevelopmentPath : URI [ ] | undefined , skipExtensions : ExtensionIdentifier [ ] ) : Promise < IExtensionDescription [ ] > {
64+ const args : IScanExtensionsArguments = {
65+ language : platform . language ,
66+ remoteAuthority,
67+ extensionDevelopmentPath,
68+ skipExtensions
69+ } ;
70+
71+ const extensions = await channel . call < IExtensionDescription [ ] > ( 'scanExtensions' , args ) ;
72+ extensions . forEach ( ext => { ( < any > ext ) . extensionLocation = URI . revive ( ext . extensionLocation ) ; } ) ;
73+
74+ return extensions ;
75+ }
76+
6277 static getDiagnosticInfo ( channel : IChannel , options : IDiagnosticInfoOptions ) : Promise < IDiagnosticInfo > {
6378 return channel . call < IDiagnosticInfo > ( 'getDiagnosticInfo' , options ) ;
6479 }
0 commit comments