提交 8f18471e 编写于 作者: B Benjamin Pasero

introduce debugBrkFileWatcherPort (for #5819)

上级 3b300f7f
...@@ -123,6 +123,7 @@ export interface IEnvironment { ...@@ -123,6 +123,7 @@ export interface IEnvironment {
disableExtensions: boolean; disableExtensions: boolean;
logExtensionHostCommunication: boolean; logExtensionHostCommunication: boolean;
debugBrkFileWatcherPort: number;
verboseLogging: boolean; verboseLogging: boolean;
enablePerformance: boolean; enablePerformance: boolean;
......
...@@ -20,6 +20,7 @@ export interface ParsedArgs extends minimist.ParsedArgs { ...@@ -20,6 +20,7 @@ export interface ParsedArgs extends minimist.ParsedArgs {
performance: boolean; performance: boolean;
verbose: boolean; verbose: boolean;
logExtensionHostCommunication: boolean; logExtensionHostCommunication: boolean;
debugBrkFileWatcherPort: string;
'disable-extensions': boolean; 'disable-extensions': boolean;
extensionHomePath: string; extensionHomePath: string;
extensionDevelopmentPath: string; extensionDevelopmentPath: string;
......
...@@ -28,6 +28,7 @@ export interface ICommandLineArguments { ...@@ -28,6 +28,7 @@ export interface ICommandLineArguments {
verboseLogging: boolean; verboseLogging: boolean;
debugExtensionHostPort: number; debugExtensionHostPort: number;
debugBrkExtensionHost: boolean; debugBrkExtensionHost: boolean;
debugBrkFileWatcherPort: number;
logExtensionHostCommunication: boolean; logExtensionHostCommunication: boolean;
disableExtensions: boolean; disableExtensions: boolean;
extensionsHomePath: string; extensionsHomePath: string;
...@@ -169,6 +170,7 @@ export class EnvService implements IEnvironmentService { ...@@ -169,6 +170,7 @@ export class EnvService implements IEnvironmentService {
const debugExtensionHostPort = getNumericValue(argv.debugPluginHost, 5870, this.isBuilt ? void 0 : 5870); const debugExtensionHostPort = getNumericValue(argv.debugPluginHost, 5870, this.isBuilt ? void 0 : 5870);
const pathArguments = parsePathArguments(this._currentWorkingDirectory, argv._, argv.goto); const pathArguments = parsePathArguments(this._currentWorkingDirectory, argv._, argv.goto);
const timestamp = parseInt(argv.timestamp); const timestamp = parseInt(argv.timestamp);
const debugBrkFileWatcherPort = getNumericValue(argv.debugBrkFileWatcherPort, void 0);
this._cliArgs = Object.freeze({ this._cliArgs = Object.freeze({
pathArguments: pathArguments, pathArguments: pathArguments,
...@@ -178,6 +180,7 @@ export class EnvService implements IEnvironmentService { ...@@ -178,6 +180,7 @@ export class EnvService implements IEnvironmentService {
debugExtensionHostPort: debugBrkExtensionHostPort || debugExtensionHostPort, debugExtensionHostPort: debugBrkExtensionHostPort || debugExtensionHostPort,
debugBrkExtensionHost: !!debugBrkExtensionHostPort, debugBrkExtensionHost: !!debugBrkExtensionHostPort,
logExtensionHostCommunication: argv.logExtensionHostCommunication, logExtensionHostCommunication: argv.logExtensionHostCommunication,
debugBrkFileWatcherPort: debugBrkFileWatcherPort,
openNewWindow: argv['new-window'], openNewWindow: argv['new-window'],
openInSameWindow: argv['reuse-window'], openInSameWindow: argv['reuse-window'],
gotoLineMode: argv.goto, gotoLineMode: argv.goto,
......
...@@ -403,6 +403,7 @@ export class VSCodeWindow { ...@@ -403,6 +403,7 @@ export class VSCodeWindow {
if (this.isPluginDevelopmentHost && cli) { if (this.isPluginDevelopmentHost && cli) {
configuration.verboseLogging = cli.verboseLogging; configuration.verboseLogging = cli.verboseLogging;
configuration.logExtensionHostCommunication = cli.logExtensionHostCommunication; configuration.logExtensionHostCommunication = cli.logExtensionHostCommunication;
configuration.debugBrkFileWatcherPort = cli.debugBrkFileWatcherPort;
configuration.debugExtensionHostPort = cli.debugExtensionHostPort; configuration.debugExtensionHostPort = cli.debugExtensionHostPort;
configuration.debugBrkExtensionHost = cli.debugBrkExtensionHost; configuration.debugBrkExtensionHost = cli.debugBrkExtensionHost;
configuration.extensionsHomePath = cli.extensionsHomePath; configuration.extensionsHomePath = cli.extensionsHomePath;
......
...@@ -918,6 +918,7 @@ export class WindowsManager implements IWindowsService { ...@@ -918,6 +918,7 @@ export class WindowsManager implements IWindowsService {
configuration.extensionDevelopmentPath = currentWindowConfig.extensionDevelopmentPath; configuration.extensionDevelopmentPath = currentWindowConfig.extensionDevelopmentPath;
configuration.verboseLogging = currentWindowConfig.verboseLogging; configuration.verboseLogging = currentWindowConfig.verboseLogging;
configuration.logExtensionHostCommunication = currentWindowConfig.logExtensionHostCommunication; configuration.logExtensionHostCommunication = currentWindowConfig.logExtensionHostCommunication;
configuration.debugBrkFileWatcherPort = currentWindowConfig.debugBrkFileWatcherPort;
configuration.debugBrkExtensionHost = currentWindowConfig.debugBrkExtensionHost; configuration.debugBrkExtensionHost = currentWindowConfig.debugBrkExtensionHost;
configuration.debugExtensionHostPort = currentWindowConfig.debugExtensionHostPort; configuration.debugExtensionHostPort = currentWindowConfig.debugExtensionHostPort;
configuration.extensionsHomePath = currentWindowConfig.extensionsHomePath; configuration.extensionsHomePath = currentWindowConfig.extensionsHomePath;
......
...@@ -41,10 +41,11 @@ export class FileService implements IFileService { ...@@ -41,10 +41,11 @@ export class FileService implements IFileService {
private messageService: IMessageService private messageService: IMessageService
) { ) {
const configuration = this.configurationService.getConfiguration<IFilesConfiguration>(); 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 (TODO@Ben knowledge on settings location ('.vscode') is hardcoded)
let encodingOverride: IEncodingOverride[] = []; let encodingOverride: IEncodingOverride[] = [];
encodingOverride.push({ resource: uri.file(this.contextService.getConfiguration().env.appSettingsHome), encoding: encoding.UTF8 }); encodingOverride.push({ resource: uri.file(env.appSettingsHome), encoding: encoding.UTF8 });
if (this.contextService.getWorkspace()) { if (this.contextService.getWorkspace()) {
encodingOverride.push({ resource: uri.file(paths.join(this.contextService.getWorkspace().resource.fsPath, '.vscode')), encoding: encoding.UTF8 }); encodingOverride.push({ resource: uri.file(paths.join(this.contextService.getWorkspace().resource.fsPath, '.vscode')), encoding: encoding.UTF8 });
} }
...@@ -60,9 +61,14 @@ export class FileService implements IFileService { ...@@ -60,9 +61,14 @@ export class FileService implements IFileService {
encoding: configuration.files && configuration.files.encoding, encoding: configuration.files && configuration.files.encoding,
encodingOverride: encodingOverride, encodingOverride: encodingOverride,
watcherIgnoredPatterns: watcherIgnoredPatterns, watcherIgnoredPatterns: watcherIgnoredPatterns,
verboseLogging: this.contextService.getConfiguration().env.verboseLogging verboseLogging: env.verboseLogging,
debugBrkFileWatcherPort: env.debugBrkFileWatcherPort
}; };
if (typeof env.debugBrkFileWatcherPort === 'number') {
console.warn(`File Watcher STOPPED on first line for debugging on port ${env.debugBrkFileWatcherPort}`);
}
// create service // create service
let workspace = this.contextService.getWorkspace(); let workspace = this.contextService.getWorkspace();
this.raw = new NodeFileService(workspace ? workspace.resource.fsPath : void 0, fileServiceConfig, this.eventService); this.raw = new NodeFileService(workspace ? workspace.resource.fsPath : void 0, fileServiceConfig, this.eventService);
......
...@@ -47,6 +47,7 @@ export interface IFileServiceOptions { ...@@ -47,6 +47,7 @@ export interface IFileServiceOptions {
watcherIgnoredPatterns?: string[]; watcherIgnoredPatterns?: string[];
disableWatcher?: boolean; disableWatcher?: boolean;
verboseLogging?: boolean; verboseLogging?: boolean;
debugBrkFileWatcherPort?: number;
} }
function etag(stat: fs.Stats): string; function etag(stat: fs.Stats): string;
...@@ -128,7 +129,7 @@ export class FileService implements files.IFileService { ...@@ -128,7 +129,7 @@ export class FileService implements files.IFileService {
} }
private setupUnixWorkspaceWatching(): void { private setupUnixWorkspaceWatching(): void {
this.workspaceWatcherToDispose = new UnixWatcherService(this.basePath, this.options.watcherIgnoredPatterns, this.eventEmitter, this.options.errorLogger, this.options.verboseLogging).startWatching(); this.workspaceWatcherToDispose = new UnixWatcherService(this.basePath, this.options.watcherIgnoredPatterns, this.eventEmitter, this.options.errorLogger, this.options.verboseLogging, this.options.debugBrkFileWatcherPort).startWatching();
} }
public resolveFile(resource: uri, options?: files.IResolveFileOptions): TPromise<files.IFileStat> { public resolveFile(resource: uri, options?: files.IResolveFileOptions): TPromise<files.IFileStat> {
......
...@@ -24,18 +24,24 @@ export class FileWatcher { ...@@ -24,18 +24,24 @@ export class FileWatcher {
private ignored: string[], private ignored: string[],
private eventEmitter: IEventService, private eventEmitter: IEventService,
private errorLogger: (msg: string) => void, private errorLogger: (msg: string) => void,
private verboseLogging: boolean) private verboseLogging: boolean,
{ private debugBrkFileWatcherPort: number
) {
this.isDisposed = false; this.isDisposed = false;
this.restartCounter = 0; this.restartCounter = 0;
} }
public startWatching(): () => void { public startWatching(): () => void {
const args = ['--type=watcherService'];
if (typeof this.debugBrkFileWatcherPort === 'number') {
args.push(`--debug-brk=${this.debugBrkFileWatcherPort}`);
}
const client = new Client( const client = new Client(
uri.parse(require.toUrl('bootstrap')).fsPath, uri.parse(require.toUrl('bootstrap')).fsPath,
{ {
serverName: 'Watcher', serverName: 'Watcher',
args: ['--type=watcherService'], args,
env: { env: {
AMD_ENTRYPOINT: 'vs/workbench/services/files/node/watcher/unix/watcherApp', AMD_ENTRYPOINT: 'vs/workbench/services/files/node/watcher/unix/watcherApp',
PIPE_LOGGING: 'true', PIPE_LOGGING: 'true',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册