提交 d2a413ee 编写于 作者: B Benjamin Pasero

more use of IEnvironmentService

上级 c1219366
......@@ -7,7 +7,7 @@ import { localize } from 'vs/nls';
import product from 'vs/platform/product';
import pkg from 'vs/platform/package';
import * as path from 'path';
import { ParsedArgs } from 'vs/code/node/argv';
import { parseArgs, ParsedArgs } from 'vs/code/node/argv';
import { TPromise } from 'vs/base/common/winjs.base';
import { sequence } from 'vs/base/common/async';
import { IPager } from 'vs/base/common/paging';
......@@ -144,7 +144,7 @@ const eventPrefix = 'monacoworkbench';
export function main(argv: ParsedArgs): TPromise<void> {
const services = new ServiceCollection();
services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService));
services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, parseArgs(process.argv)));
const instantiationService: IInstantiationService = new InstantiationService(services);
......
......@@ -14,6 +14,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
import { parseArgs } from 'vs/code/node/argv';
import { IEventService } from 'vs/platform/event/common/event';
import { EventService } from 'vs/platform/event/common/eventService';
import { ExtensionManagementChannel } from 'vs/platform/extensionManagement/common/extensionManagementIpc';
......@@ -57,7 +58,7 @@ function main(server: Server): void {
const services = new ServiceCollection();
services.set(IEventService, new SyncDescriptor(EventService));
services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService));
services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, parseArgs(process.argv)));
services.set(IConfigurationService, new SyncDescriptor(NodeConfigurationService));
services.set(IRequestService, new SyncDescriptor(RequestService));
......
......@@ -12,7 +12,7 @@ export interface IEnvironmentService {
_serviceBrand: any;
appRoot: string;
userHome: string;
userDataPath: string;
......@@ -24,6 +24,9 @@ export interface IEnvironmentService {
extensionDevelopmentPath: string;
isBuilt: boolean;
verbose: boolean;
debugBrkFileWatcherPort: number;
createPaths(): TPromise<void>;
}
\ No newline at end of file
......@@ -10,7 +10,7 @@ import pkg from 'vs/platform/package';
import * as os from 'os';
import * as path from 'path';
import {mkdirp} from 'vs/base/node/pfs';
import {parseArgs} from 'vs/code/node/argv';
import {ParsedArgs} from 'vs/code/node/argv';
import URI from 'vs/base/common/uri';
import {TPromise} from 'vs/base/common/winjs.base';
......@@ -43,10 +43,11 @@ export class EnvironmentService implements IEnvironmentService {
get extensionDevelopmentPath(): string { return this._extensionDevelopmentPath; }
get isBuilt(): boolean { return !process.env['VSCODE_DEV']; }
get verbose(): boolean { return this.argv.verbose; }
constructor() {
const argv = parseArgs(process.argv);
get debugBrkFileWatcherPort(): number { return typeof this.argv.debugBrkFileWatcherPort === 'string' ? Number(this.argv.debugBrkFileWatcherPort) : void 0; }
constructor(private argv: ParsedArgs) {
this._appRoot = path.dirname(URI.parse(require.toUrl('')).fsPath);
this._userDataPath = paths.getUserDataPath(process.platform, pkg.name, process.argv);
......@@ -62,8 +63,7 @@ export class EnvironmentService implements IEnvironmentService {
}
createPaths(): TPromise<void> {
const promises = [this.userHome, this.extensionsPath]
.map(p => mkdirp(p));
const promises = [this.userHome, this.extensionsPath].map(p => mkdirp(p));
return TPromise.join(promises) as TPromise<any>;
}
......
......@@ -47,9 +47,14 @@ export interface IProductConfiguration {
npsSurveyUrl: string;
}
const rootPath = path.dirname(uri.parse(require.toUrl('')).fsPath);
const productJsonPath = path.join(rootPath, 'product.json');
const product = require.__$__nodeRequire(productJsonPath) as IProductConfiguration;
let product: IProductConfiguration;
try {
const rootPath = path.dirname(uri.parse(require.toUrl('')).fsPath);
const productJsonPath = path.join(rootPath, 'product.json');
product = require.__$__nodeRequire(productJsonPath) as IProductConfiguration;
} catch (error) {
product = Object.create(null); // can happen in environments where product.json is missing (e.g. when used from tests)
}
if (process.env['VSCODE_DEV']) {
product.nameShort += ' Dev';
......
......@@ -11,8 +11,8 @@ import {IMessage, IExtensionDescription, IExtensionsStatus} from 'vs/platform/ex
import {ExtensionsRegistry} from 'vs/platform/extensions/common/extensionsRegistry';
import {IMessageService} from 'vs/platform/message/common/message';
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import {ExtHostContext, ExtHostExtensionServiceShape} from './extHost.protocol';
import {IEnvironmentService} from 'vs/platform/environment/common/environment';
/**
* Represents a failed extension in the ext host.
......@@ -33,7 +33,7 @@ class MainProcessSuccessExtension extends ActivatedExtension {
}
}
function messageWithSource(msg:IMessage): string {
function messageWithSource(msg: IMessage): string {
return (msg.source ? '[' + msg.source + ']: ' : '') + msg.message;
}
......@@ -49,13 +49,12 @@ export class MainProcessExtensionService extends AbstractExtensionService<Activa
* This class is constructed manually because it is a service, so it doesn't use any ctor injection
*/
constructor(
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IThreadService threadService: IThreadService,
@IMessageService messageService: IMessageService
@IMessageService messageService: IMessageService,
@IEnvironmentService private environmentService: IEnvironmentService
) {
super(false);
let config = contextService.getConfiguration();
this._isDev = !config.env.isBuilt || !!config.env.extensionDevelopmentPath;
this._isDev = !environmentService.isBuilt || !!environmentService.extensionDevelopmentPath;
this._messageService = messageService;
this._threadService = threadService;
......
......@@ -16,6 +16,7 @@ import uri from 'vs/base/common/uri';
import strings = require('vs/base/common/strings');
import {IResourceInput} from 'vs/platform/editor/common/editor';
import {EventService} from 'vs/platform/event/common/eventService';
import {ParsedArgs, parseArgs} from 'vs/code/node/argv';
import {WorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService';
import {IWorkspace, IConfiguration, IEnvironment} from 'vs/platform/workspace/common/workspace';
import {ConfigurationService} from 'vs/workbench/services/configuration/node/configurationService';
......@@ -56,6 +57,12 @@ export interface IMainEnvironment extends IEnvironment {
export function startup(environment: IMainEnvironment, globalSettings: IGlobalSettings): winjs.TPromise<void> {
// Args (TODO@Ben clean up explicit overwrite of args)
const parsedArgs = parseArgs(process.argv);
if (typeof environment.extensionDevelopmentPath === 'string') {
parsedArgs.extensionDevelopmentPath = environment.extensionDevelopmentPath;
}
// Shell Configuration
const shellConfiguration: IConfiguration = {
env: environment
......@@ -79,7 +86,7 @@ export function startup(environment: IMainEnvironment, globalSettings: IGlobalSe
}
// Open workbench
return openWorkbench(getWorkspace(environment), shellConfiguration, shellOptions);
return openWorkbench(parsedArgs, getWorkspace(environment), shellConfiguration, shellOptions);
}
function toInputs(paths: IPath[]): IResourceInput[] {
......@@ -128,9 +135,9 @@ function getWorkspace(environment: IMainEnvironment): IWorkspace {
};
}
function openWorkbench(workspace: IWorkspace, configuration: IConfiguration, options: IOptions): winjs.TPromise<void> {
function openWorkbench(args: ParsedArgs, workspace: IWorkspace, configuration: IConfiguration, options: IOptions): winjs.TPromise<void> {
const eventService = new EventService();
const environmentService = new EnvironmentService();
const environmentService = new EnvironmentService(args);
const contextService = new WorkspaceContextService(eventService, workspace, configuration, options);
const configurationService = new ConfigurationService(contextService, eventService);
......
......@@ -237,12 +237,12 @@ export class WorkbenchShell {
serviceCollection.set(IWindowService, this.windowService);
// Storage
const disableWorkspaceStorage = this.configuration.env.extensionTestsPath || (!this.workspace && !this.configuration.env.extensionDevelopmentPath); // without workspace or in any extension test, we use inMemory storage unless we develop an extension where we want to preserve state
const disableWorkspaceStorage = this.configuration.env.extensionTestsPath || (!this.workspace && !this.environmentService.extensionDevelopmentPath); // without workspace or in any extension test, we use inMemory storage unless we develop an extension where we want to preserve state
this.storageService = instantiationService.createInstance(Storage, window.localStorage, disableWorkspaceStorage ? inMemoryLocalStorageInstance : window.localStorage);
serviceCollection.set(IStorageService, this.storageService);
// Telemetry
if (this.configuration.env.isBuilt && !this.configuration.env.extensionDevelopmentPath && !!this.configuration.env.enableTelemetry) {
if (this.configuration.env.isBuilt && !this.environmentService.extensionDevelopmentPath && !!this.configuration.env.enableTelemetry) {
const channel = getDelayedChannel<ITelemetryAppenderChannel>(sharedProcess.then(c => c.getChannel('telemetryAppender')));
const commit = this.contextService.getConfiguration().env.commitHash;
const version = this.contextService.getConfiguration().env.version;
......
......@@ -32,6 +32,7 @@ import {IEditorGroupService} from 'vs/workbench/services/group/common/groupServi
import {IModelService} from 'vs/editor/common/services/modelService';
import {ModelBuilder} from 'vs/editor/node/model/modelBuilder';
import product from 'vs/platform/product';
import {IEnvironmentService} from 'vs/platform/environment/common/environment';
export class TextFileService extends AbstractTextFileService {
......@@ -50,7 +51,8 @@ export class TextFileService extends AbstractTextFileService {
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
@IEditorGroupService editorGroupService: IEditorGroupService,
@IWindowService private windowService: IWindowService,
@IModelService modelService: IModelService
@IModelService modelService: IModelService,
@IEnvironmentService private environmentService: IEnvironmentService
) {
super(contextService, instantiationService, configurationService, telemetryService, editorService, editorGroupService, eventService, fileService, modelService);
......@@ -173,7 +175,7 @@ export class TextFileService extends AbstractTextFileService {
}
public confirmSave(resources?: URI[]): ConfirmResult {
if (!!this.contextService.getConfiguration().env.extensionDevelopmentPath) {
if (!!this.environmentService.extensionDevelopmentPath) {
return ConfirmResult.DONT_SAVE; // no veto when we are in extension dev mode because we cannot assum we run interactive (e.g. tests)
}
......
......@@ -12,6 +12,7 @@ import { IOutputService } from 'vs/workbench/parts/output/common/output';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IEventService } from 'vs/platform/event/common/event';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IMessageService } from 'vs/platform/message/common/message';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
......@@ -202,6 +203,7 @@ export class ElectronGitService extends GitService {
@IWorkspaceContextService contextService: IWorkspaceContextService,
@ILifecycleService lifecycleService: ILifecycleService,
@IStorageService storageService: IStorageService,
@IEnvironmentService environmentService: IEnvironmentService,
@IConfigurationService configurationService: IConfigurationService
) {
const conf = configurationService.getConfiguration<IGitConfiguration>('git');
......@@ -218,7 +220,7 @@ export class ElectronGitService extends GitService {
const gitPath = conf.path || null;
const encoding = filesConf.encoding || 'utf8';
const workspaceRoot = workspace.resource.fsPath;
const verbose = !contextService.getConfiguration().env.isBuilt || contextService.getConfiguration().env.verboseLogging;
const verbose = !environmentService.isBuilt || environmentService.verbose;
if (ElectronGitService.USE_REMOTE_PROCESS_SERVICE) {
raw = createRemoteRawGitService(gitPath, workspaceRoot, encoding, verbose);
......
......@@ -20,6 +20,7 @@ import {IEventService} from 'vs/platform/event/common/event';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import {Action} from 'vs/base/common/actions';
import {IMessageService, IMessageWithAction, Severity} from 'vs/platform/message/common/message';
import {IEnvironmentService} from 'vs/platform/environment/common/environment';
import {shell} from 'electron';
......@@ -38,14 +39,14 @@ export class FileService implements IFileService {
@IConfigurationService private configurationService: IConfigurationService,
@IEventService private eventService: IEventService,
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IEnvironmentService private environmentService: IEnvironmentService,
@IMessageService private messageService: IMessageService
) {
const configuration = this.configurationService.getConfiguration<IFilesConfiguration>();
const env = this.contextService.getConfiguration().env;
// adjust encodings (TODO@Ben knowledge on settings location ('.vscode') is hardcoded)
// adjust encodings
let encodingOverride: IEncodingOverride[] = [];
encodingOverride.push({ resource: uri.file(env.appSettingsHome), encoding: encoding.UTF8 });
encodingOverride.push({ resource: uri.file(environmentService.appSettingsHome), encoding: encoding.UTF8 });
if (this.contextService.getWorkspace()) {
encodingOverride.push({ resource: uri.file(paths.join(this.contextService.getWorkspace().resource.fsPath, '.vscode')), encoding: encoding.UTF8 });
}
......@@ -61,12 +62,12 @@ export class FileService implements IFileService {
encoding: configuration.files && configuration.files.encoding,
encodingOverride: encodingOverride,
watcherIgnoredPatterns: watcherIgnoredPatterns,
verboseLogging: env.verboseLogging,
debugBrkFileWatcherPort: env.debugBrkFileWatcherPort
verboseLogging: environmentService.verbose,
debugBrkFileWatcherPort: environmentService.debugBrkFileWatcherPort
};
if (typeof env.debugBrkFileWatcherPort === 'number') {
console.warn(`File Watcher STOPPED on first line for debugging on port ${env.debugBrkFileWatcherPort}`);
if (typeof environmentService.debugBrkFileWatcherPort === 'number') {
console.warn(`File Watcher STOPPED on first line for debugging on port ${environmentService.debugBrkFileWatcherPort}`);
}
// create service
......
......@@ -25,6 +25,7 @@ import {ILifecycleService} from 'vs/platform/lifecycle/common/lifecycle';
import {Registry} from 'vs/platform/platform';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService';
import {IEnvironmentService} from 'vs/platform/environment/common/environment';
/**
* Stores the selection & view state of an editor and allows to compare it to other selection states.
......@@ -85,7 +86,8 @@ export abstract class BaseHistoryService {
private eventService: IEventService,
protected editorGroupService: IEditorGroupService,
protected editorService: IWorkbenchEditorService,
protected contextService: IWorkspaceContextService
protected contextService: IWorkspaceContextService,
private environmentService: IEnvironmentService
) {
this.toUnbind = [];
this.activeEditorListeners = [];
......@@ -154,7 +156,7 @@ export abstract class BaseHistoryService {
let title = this.doGetWindowTitle(input);
// Extension Development Host gets a special title to identify itself
if (this.contextService.getConfiguration().env.extensionDevelopmentPath) {
if (this.environmentService.extensionDevelopmentPath) {
return nls.localize('devExtensionWindowTitle', "[Extension Development Host] - {0}", title);
}
......@@ -234,12 +236,13 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic
@IEventService eventService: IEventService,
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
@IEditorGroupService editorGroupService: IEditorGroupService,
@IEnvironmentService environmentService: IEnvironmentService,
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IStorageService private storageService: IStorageService,
@ILifecycleService private lifecycleService: ILifecycleService,
@IInstantiationService private instantiationService: IInstantiationService
) {
super(eventService, editorGroupService, editorService, contextService);
super(eventService, editorGroupService, editorService, contextService, environmentService);
this.index = -1;
this.stack = [];
......
......@@ -19,6 +19,7 @@ import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import {IConfigurationService} from 'vs/platform/configuration/common/configuration';
import {IRawSearch, ISerializedSearchComplete, ISerializedSearchProgressItem, ISerializedFileMatch, IRawSearchService} from './search';
import {ISearchChannel, SearchChannelClient} from './searchIpc';
import {IEnvironmentService} from 'vs/platform/environment/common/environment';
export class SearchService implements ISearchService {
public _serviceBrand: any;
......@@ -28,11 +29,11 @@ export class SearchService implements ISearchService {
constructor(
@IModelService private modelService: IModelService,
@IUntitledEditorService private untitledEditorService: IUntitledEditorService,
@IEnvironmentService private environmentService: IEnvironmentService,
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IConfigurationService private configurationService: IConfigurationService
) {
let config = contextService.getConfiguration();
this.diskSearch = new DiskSearch(!config.env.isBuilt || config.env.verboseLogging);
this.diskSearch = new DiskSearch(!environmentService.isBuilt || environmentService.verbose);
}
public search(query: ISearchQuery): PPromise<ISearchComplete, ISearchProgressItem> {
......
......@@ -18,11 +18,12 @@ import {IMainProcessExtHostIPC, create} from 'vs/platform/extensions/common/ipcR
import {IMessageService, Severity} from 'vs/platform/message/common/message';
import {AbstractThreadService} from 'vs/workbench/services/thread/common/abstractThreadService';
import {ILifecycleService, ShutdownEvent} from 'vs/platform/lifecycle/common/lifecycle';
import {IConfiguration, IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import {IWindowService} from 'vs/workbench/services/window/electron-browser/windowService';
import {ChildProcess, fork} from 'child_process';
import {ipcRenderer as ipc} from 'electron';
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
import {IEnvironmentService} from 'vs/platform/environment/common/environment';
export const EXTENSION_LOG_BROADCAST_CHANNEL = 'vscode:extensionLog';
export const EXTENSION_ATTACH_BROADCAST_CHANNEL = 'vscode:extensionAttach';
......@@ -47,11 +48,12 @@ export class MainThreadService extends AbstractThreadService implements IThreadS
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IMessageService messageService: IMessageService,
@IWindowService windowService: IWindowService,
@IEnvironmentService private environmentService: IEnvironmentService,
@ILifecycleService lifecycleService: ILifecycleService
) {
super(true);
this.extensionHostProcessManager = new ExtensionHostProcessManager(contextService, messageService, windowService, lifecycleService);
this.extensionHostProcessManager = new ExtensionHostProcessManager(contextService, messageService, windowService, lifecycleService, environmentService);
let logCommunication = logExtensionHostCommunication || contextService.getConfiguration().env.logExtensionHostCommunication;
......@@ -82,7 +84,7 @@ export class MainThreadService extends AbstractThreadService implements IThreadS
this.extensionHostProcessManager.terminate();
}
protected _callOnRemote(proxyId: string, path: string, args:any[]): TPromise<any> {
protected _callOnRemote(proxyId: string, path: string, args: any[]): TPromise<any> {
return this.remoteCom.callOnRemote(proxyId, path, args);
}
}
......@@ -105,12 +107,13 @@ class ExtensionHostProcessManager {
private contextService: IWorkspaceContextService,
private messageService: IMessageService,
private windowService: IWindowService,
private lifecycleService: ILifecycleService
private lifecycleService: ILifecycleService,
private environmentService: IEnvironmentService
) {
// handle extension host lifecycle a bit special when we know we are developing an extension that runs inside
const config = this.contextService.getConfiguration();
this.isExtensionDevelopmentHost = !!config.env.extensionDevelopmentPath;
this.isExtensionDevelopmentHost = !!environmentService.extensionDevelopmentPath;
this.isExtensionDevelopmentDebugging = !!config.env.debugBrkExtensionHost;
this.isExtensionDevelopmentTestFromCli = this.isExtensionDevelopmentHost && !!config.env.extensionTestsPath && !config.env.debugBrkExtensionHost;
......@@ -120,14 +123,12 @@ class ExtensionHostProcessManager {
}
public startExtensionHostProcess(onExtensionHostMessage: (msg: any) => void): void {
let config = this.contextService.getConfiguration();
let opts: any = {
env: objects.mixin(objects.clone(process.env), { AMD_ENTRYPOINT: 'vs/workbench/node/extensionHostProcess', PIPE_LOGGING: 'true', VERBOSE_LOGGING: true })
};
// Help in case we fail to start it
if (!config.env.isBuilt || this.isExtensionDevelopmentHost) {
if (!this.environmentService.isBuilt || this.isExtensionDevelopmentHost) {
this.initializeTimer = setTimeout(() => {
const msg = this.isExtensionDevelopmentDebugging ? nls.localize('extensionHostProcess.startupFailDebug', "Extension host did not start in 10 seconds, it might be stopped on the first line and needs a debugger to continue.") : nls.localize('extensionHostProcess.startupFail', "Extension host did not start in 10 seconds, that might be a problem.");
......@@ -139,7 +140,7 @@ class ExtensionHostProcessManager {
this.initializeExtensionHostProcess = new TPromise<ChildProcess>((c, e) => {
// Resolve additional execution args (e.g. debug)
return this.resolveDebugPort(config, (port) => {
return this.resolveDebugPort(this.contextService.getConfiguration().env.debugExtensionHostPort, port => {
if (port) {
opts.execArgv = ['--nolazy', (this.isExtensionDevelopmentDebugging ? '--debug-brk=' : '--debug=') + port];
}
......@@ -154,7 +155,7 @@ class ExtensionHostProcessManager {
payload: {
port: port
}
}, config.env.extensionDevelopmentPath /* target */);
}, this.environmentService.extensionDevelopmentPath /* target */);
}
// Messages from Extension host
......@@ -220,11 +221,11 @@ class ExtensionHostProcessManager {
}
// Broadcast to other windows if we are in development mode
else if (!config.env.isBuilt || this.isExtensionDevelopmentHost) {
else if (!this.environmentService.isBuilt || this.isExtensionDevelopmentHost) {
this.windowService.broadcast({
channel: EXTENSION_LOG_BROADCAST_CHANNEL,
payload: logEntry
}, config.env.extensionDevelopmentPath /* target */);
}, this.environmentService.extensionDevelopmentPath /* target */);
}
}
......@@ -278,19 +279,19 @@ class ExtensionHostProcessManager {
}, () => this.terminate());
}
private resolveDebugPort(config: IConfiguration, clb: (port: number) => void): void {
private resolveDebugPort(extensionHostPort: number, clb: (port: number) => void): void {
// Check for a free debugging port
if (typeof config.env.debugExtensionHostPort === 'number') {
return findFreePort(config.env.debugExtensionHostPort, 10 /* try 10 ports */, 5000 /* try up to 5 seconds */, (port) => {
if (typeof extensionHostPort === 'number') {
return findFreePort(extensionHostPort, 10 /* try 10 ports */, 5000 /* try up to 5 seconds */, (port) => {
if (!port) {
console.warn('%c[Extension Host] %cCould not find a free port for debugging', 'color: blue', 'color: black');
return clb(void 0);
}
if (port !== config.env.debugExtensionHostPort) {
console.warn('%c[Extension Host] %cProvided debugging port ' + config.env.debugExtensionHostPort + ' is not free, using ' + port + ' instead.', 'color: blue', 'color: black');
if (port !== extensionHostPort) {
console.warn('%c[Extension Host] %cProvided debugging port ' + extensionHostPort + ' is not free, using ' + port + ' instead.', 'color: blue', 'color: black');
}
if (this.isExtensionDevelopmentDebugging) {
......@@ -329,7 +330,7 @@ class ExtensionHostProcessManager {
}
}
private _onWillShutdown(event: ShutdownEvent): void{
private _onWillShutdown(event: ShutdownEvent): void {
// If the extension development host was started without debugger attached we need
// to communicate this back to the main side to terminate the debug session
......@@ -337,7 +338,7 @@ class ExtensionHostProcessManager {
this.windowService.broadcast({
channel: EXTENSION_TERMINATE_BROADCAST_CHANNEL,
payload: true
}, this.contextService.getConfiguration().env.extensionDevelopmentPath /* target */);
}, this.environmentService.extensionDevelopmentPath /* target */);
event.veto(TPromise.timeout(100 /* wait a bit for IPC to get delivered */).then(() => false));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册