Skip to content

Commit 3a78c09

Browse files
committed
Run log cleaner
1 parent 4685f67 commit 3a78c09

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

server.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ import { extname } from "vs/base/common/path";
1313
import { UriComponents, URI } from "vs/base/common/uri";
1414
import { IPCServer, ClientConnectionEvent } from "vs/base/parts/ipc/common/ipc";
1515
import { validatePaths } from "vs/code/node/paths";
16+
import { LogsDataCleaner } from "vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner";
1617
import { 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";
1819
import { EnvironmentService } from "vs/platform/environment/node/environmentService";
1920
import { InstantiationService } from "vs/platform/instantiation/common/instantiationService";
21+
import { ServiceCollection } from "vs/platform/instantiation/common/serviceCollection";
2022
import { getLogLevel, ILogService } from "vs/platform/log/common/log";
2123
import { LogLevelSetterChannel } from "vs/platform/log/common/logIpc";
2224
import { 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

Comments
 (0)