@@ -13,10 +13,12 @@ import { extname } from "vs/base/common/path";
1313import { UriComponents , URI } from "vs/base/common/uri" ;
1414import { IPCServer , ClientConnectionEvent } from "vs/base/parts/ipc/common/ipc" ;
1515import { validatePaths } from "vs/code/node/paths" ;
16+ import { LogsDataCleaner } from "vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner" ;
1617import { parseMainProcessArgv } from "vs/platform/environment/node/argvHelper" ;
17- import { ParsedArgs } from "vs/platform/environment/common/environment" ;
18+ import { IEnvironmentService , ParsedArgs } from "vs/platform/environment/common/environment" ;
1819import { EnvironmentService } from "vs/platform/environment/node/environmentService" ;
1920import { InstantiationService } from "vs/platform/instantiation/common/instantiationService" ;
21+ import { ServiceCollection } from "vs/platform/instantiation/common/serviceCollection" ;
2022import { getLogLevel , ILogService } from "vs/platform/log/common/log" ;
2123import { LogLevelSetterChannel } from "vs/platform/log/common/logIpc" ;
2224import { SpdLogService } from "vs/platform/log/node/spdlogService" ;
@@ -111,7 +113,9 @@ export class Server {
111113 return process . exit ( 1 ) ;
112114 }
113115
116+ const services = new ServiceCollection ( ) ;
114117 this . environmentService = new EnvironmentService ( args , process . execPath ) ;
118+ services . set ( IEnvironmentService , this . environmentService ) ;
115119
116120 this . logService = new SpdLogService (
117121 RemoteExtensionLogFileName ,
@@ -120,8 +124,9 @@ export class Server {
120124 ) ;
121125 this . ipc . registerChannel ( "loglevel" , new LogLevelSetterChannel ( this . logService ) ) ;
122126
123- const instantiationService = new InstantiationService ( ) ;
127+ const instantiationService = new InstantiationService ( services ) ;
124128 instantiationService . invokeFunction ( ( ) => {
129+ instantiationService . createInstance ( LogsDataCleaner ) ;
125130 this . ipc . registerChannel (
126131 REMOTE_FILE_SYSTEM_CHANNEL_NAME ,
127132 new FileProviderChannel ( this . logService ) ,
@@ -154,6 +159,8 @@ export class Server {
154159 const remoteAuthority = request . headers . host as string ;
155160 const transformer = getUriTransformer ( remoteAuthority ) ;
156161
162+ const webviewEndpoint = "" ;
163+
157164 const cwd = process . env . VSCODE_CWD || process . cwd ( ) ;
158165 const workspacePath = parsedUrl . query . workspace as string | undefined ;
159166 const folderPath = ! workspacePath ? parsedUrl . query . folder as string | undefined || cwd : undefined ;
@@ -163,6 +170,7 @@ export class Server {
163170 workspaceUri : workspacePath ? transformer . transformOutgoing ( URI . file ( sanitizeFilePath ( workspacePath , cwd ) ) ) : undefined ,
164171 folderUri : folderPath ? transformer . transformOutgoing ( URI . file ( sanitizeFilePath ( folderPath , cwd ) ) ) : undefined ,
165172 remoteAuthority,
173+ webviewEndpoint,
166174 } ,
167175 REMOTE_USER_DATA_URI : transformer . transformOutgoing ( this . environmentService . webUserDataHome ) ,
168176 PRODUCT_CONFIGURATION : require . __$__nodeRequire ( path . resolve ( getPathFromAmdModule ( require , "" ) , "../product.json" ) ) ,
@@ -173,7 +181,7 @@ export class Server {
173181 html = html . replace ( `"{{${ key } }}"` , `'${ JSON . stringify ( options [ key ] ) } '` ) ;
174182 } ) ;
175183
176- html = html . replace ( '{{WEBVIEW_ENDPOINT}}' , "" ) ; // TODO
184+ html = html . replace ( '{{WEBVIEW_ENDPOINT}}' , webviewEndpoint ) ;
177185
178186 return [ html , {
179187 "Content-Type" : "text/html" ,
0 commit comments