提交 262134cf 编写于 作者: A Alex Dima

Reduce extension host IInitData

上级 f8007cd6
...@@ -44,7 +44,6 @@ import { IDisposable } from 'vs/base/common/lifecycle'; ...@@ -44,7 +44,6 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import { SerializedError } from 'vs/base/common/errors'; import { SerializedError } from 'vs/base/common/errors';
import { IStat, FileChangeType } from 'vs/platform/files/common/files'; import { IStat, FileChangeType } from 'vs/platform/files/common/files';
import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
import { ParsedArgs } from 'vs/platform/environment/common/environment';
import { CommentRule, CharacterPair, EnterAction } from 'vs/editor/common/modes/languageConfiguration'; import { CommentRule, CharacterPair, EnterAction } from 'vs/editor/common/modes/languageConfiguration';
import { ISingleEditOperation } from 'vs/editor/common/model'; import { ISingleEditOperation } from 'vs/editor/common/model';
import { ILineMatch, IPatternInfo } from 'vs/platform/search/common/search'; import { ILineMatch, IPatternInfo } from 'vs/platform/search/common/search';
...@@ -77,9 +76,8 @@ export interface IInitData { ...@@ -77,9 +76,8 @@ export interface IInitData {
configuration: IConfigurationInitData; configuration: IConfigurationInitData;
telemetryInfo: ITelemetryInfo; telemetryInfo: ITelemetryInfo;
windowId: number; windowId: number;
args: ParsedArgs;
execPath: string;
logLevel: LogLevel; logLevel: LogLevel;
logsPath: string;
} }
export interface IConfigurationInitData extends IConfigurationData { export interface IConfigurationInitData extends IConfigurationData {
......
...@@ -20,7 +20,6 @@ import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; ...@@ -20,7 +20,6 @@ import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace';
import { TernarySearchTree } from 'vs/base/common/map'; import { TernarySearchTree } from 'vs/base/common/map';
import { Barrier } from 'vs/base/common/async'; import { Barrier } from 'vs/base/common/async';
import { ILogService } from 'vs/platform/log/common/log'; import { ILogService } from 'vs/platform/log/common/log';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { ExtHostLogService } from 'vs/workbench/api/node/extHostLogService'; import { ExtHostLogService } from 'vs/workbench/api/node/extHostLogService';
import URI from 'vs/base/common/uri'; import URI from 'vs/base/common/uri';
...@@ -140,8 +139,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { ...@@ -140,8 +139,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
extHostContext: IExtHostContext, extHostContext: IExtHostContext,
extHostWorkspace: ExtHostWorkspace, extHostWorkspace: ExtHostWorkspace,
extHostConfiguration: ExtHostConfiguration, extHostConfiguration: ExtHostConfiguration,
extHostLogService: ExtHostLogService, extHostLogService: ExtHostLogService
environmentService: IEnvironmentService
) { ) {
this._barrier = new Barrier(); this._barrier = new Barrier();
this._registry = new ExtensionDescriptionRegistry(initData.extensions); this._registry = new ExtensionDescriptionRegistry(initData.extensions);
......
...@@ -9,7 +9,6 @@ import { join } from 'vs/base/common/paths'; ...@@ -9,7 +9,6 @@ import { join } from 'vs/base/common/paths';
import { LogLevel } from 'vs/workbench/api/node/extHostTypes'; import { LogLevel } from 'vs/workbench/api/node/extHostTypes';
import { ILogService, DelegatedLogService } from 'vs/platform/log/common/log'; import { ILogService, DelegatedLogService } from 'vs/platform/log/common/log';
import { createSpdLogService } from 'vs/platform/log/node/spdlogService'; import { createSpdLogService } from 'vs/platform/log/node/spdlogService';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { ExtHostLogServiceShape } from 'vs/workbench/api/node/extHost.protocol'; import { ExtHostLogServiceShape } from 'vs/workbench/api/node/extHost.protocol';
...@@ -20,9 +19,9 @@ export class ExtHostLogService extends DelegatedLogService implements ILogServic ...@@ -20,9 +19,9 @@ export class ExtHostLogService extends DelegatedLogService implements ILogServic
constructor( constructor(
private _windowId: number, private _windowId: number,
logLevel: LogLevel, logLevel: LogLevel,
private _environmentService: IEnvironmentService private _logsPath: string
) { ) {
super(createSpdLogService(`exthost${_windowId}`, logLevel, _environmentService.logsPath)); super(createSpdLogService(`exthost${_windowId}`, logLevel, _logsPath));
} }
$setLevel(level: LogLevel): void { $setLevel(level: LogLevel): void {
...@@ -39,7 +38,7 @@ export class ExtHostLogService extends DelegatedLogService implements ILogServic ...@@ -39,7 +38,7 @@ export class ExtHostLogService extends DelegatedLogService implements ILogServic
} }
getLogDirectory(extensionID: string): string { getLogDirectory(extensionID: string): string {
return join(this._environmentService.logsPath, `${extensionID}_${this._windowId}`); return join(this._logsPath, `${extensionID}_${this._windowId}`);
} }
private createLogger(extensionID: string): ExtHostLogger { private createLogger(extensionID: string): ExtHostLogger {
......
...@@ -20,7 +20,6 @@ import * as errors from 'vs/base/common/errors'; ...@@ -20,7 +20,6 @@ import * as errors from 'vs/base/common/errors';
import * as watchdog from 'native-watchdog'; import * as watchdog from 'native-watchdog';
import * as glob from 'vs/base/common/glob'; import * as glob from 'vs/base/common/glob';
import { ExtensionActivatedByEvent } from 'vs/workbench/api/node/extHostExtensionActivator'; import { ExtensionActivatedByEvent } from 'vs/workbench/api/node/extHostExtensionActivator';
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc'; import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc';
import { RPCProtocol } from 'vs/workbench/services/extensions/node/rpcProtocol'; import { RPCProtocol } from 'vs/workbench/services/extensions/node/rpcProtocol';
...@@ -89,8 +88,7 @@ export class ExtensionHostMain { ...@@ -89,8 +88,7 @@ export class ExtensionHostMain {
// services // services
const rpcProtocol = new RPCProtocol(protocol); const rpcProtocol = new RPCProtocol(protocol);
const environmentService = new EnvironmentService(initData.args, initData.execPath); this._extHostLogService = new ExtHostLogService(initData.windowId, initData.logLevel, initData.logsPath);
this._extHostLogService = new ExtHostLogService(initData.windowId, initData.logLevel, environmentService);
this.disposables.push(this._extHostLogService); this.disposables.push(this._extHostLogService);
const extHostWorkspace = new ExtHostWorkspace(rpcProtocol, initData.workspace, this._extHostLogService); const extHostWorkspace = new ExtHostWorkspace(rpcProtocol, initData.workspace, this._extHostLogService);
...@@ -98,7 +96,7 @@ export class ExtensionHostMain { ...@@ -98,7 +96,7 @@ export class ExtensionHostMain {
this._extHostLogService.trace('initData', initData); this._extHostLogService.trace('initData', initData);
this._extHostConfiguration = new ExtHostConfiguration(rpcProtocol.getProxy(MainContext.MainThreadConfiguration), extHostWorkspace, initData.configuration); this._extHostConfiguration = new ExtHostConfiguration(rpcProtocol.getProxy(MainContext.MainThreadConfiguration), extHostWorkspace, initData.configuration);
this._extensionService = new ExtHostExtensionService(initData, rpcProtocol, extHostWorkspace, this._extHostConfiguration, this._extHostLogService, environmentService); this._extensionService = new ExtHostExtensionService(initData, rpcProtocol, extHostWorkspace, this._extHostConfiguration, this._extHostLogService);
// error forwarding and stack trace scanning // error forwarding and stack trace scanning
Error.stackTraceLimit = 100; // increase number of stack frames (from 10, https://github.com/v8/v8/wiki/Stack-Trace-API) Error.stackTraceLimit = 100; // increase number of stack frames (from 10, https://github.com/v8/v8/wiki/Stack-Trace-API)
......
...@@ -381,10 +381,9 @@ export class ExtensionHostProcessWorker { ...@@ -381,10 +381,9 @@ export class ExtensionHostProcessWorker {
// Send configurations scopes only in development mode. // Send configurations scopes only in development mode.
configuration: !this._environmentService.isBuilt || this._environmentService.isExtensionDevelopment ? { ...configurationData, configurationScopes: getScopes() } : configurationData, configuration: !this._environmentService.isBuilt || this._environmentService.isExtensionDevelopment ? { ...configurationData, configurationScopes: getScopes() } : configurationData,
telemetryInfo, telemetryInfo,
args: this._environmentService.args,
execPath: this._environmentService.execPath,
windowId: this._windowService.getCurrentWindowId(), windowId: this._windowService.getCurrentWindowId(),
logLevel: this._logService.getLevel() logLevel: this._logService.getLevel(),
logsPath: this._environmentService.logsPath
}; };
return r; return r;
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册