提交 739164e3 编写于 作者: B Benjamin Pasero

let files.watcherExclude be an object like other exclude settings

上级 0aea98b0
......@@ -429,7 +429,7 @@ export interface IFilesConfiguration {
files: {
associations: { [filepattern: string]: string };
exclude: glob.IExpression;
watcherExclude: string[];
watcherExclude: { [filepattern: string]: boolean };
encoding: string;
trimTrailingWhitespace: boolean;
autoSave: string;
......
......@@ -229,11 +229,8 @@ configurationRegistry.registerConfiguration({
'description': nls.localize('autoSaveDelay', "Controls the delay in ms after which a dirty file is saved automatically. Only applies when \"files.autoSave\" is set to \"{0}\"", AutoSaveConfiguration.AFTER_DELAY)
},
'files.watcherExclude': {
'type': 'array',
'items': {
'type': 'string'
},
'default': platform.isLinux ? ['**/.git/objects/**', '**/node_modules/**'] : ['**/.git/objects/**'],
'type': 'object',
'default': platform.isLinux ? { '**/.git/objects/**': true, '**/node_modules/**': true } : { '**/.git/objects/**': true },
'description': nls.localize('watcherExclude', "Configure glob patterns of file paths to exclude from file watching. Changing this setting requires a restart. When you experience Code consuming lots of cpu time on startup, you can exclude large folders to reduce the initial load.")
}
}
......
......@@ -43,12 +43,17 @@ export class FileService implements files.IFileService {
encodingOverride.push({ resource: uri.file(paths.join(this.contextService.getWorkspace().resource.fsPath, '.vscode')), encoding: encoding.UTF8 });
}
let watcherIgnoredPatterns:string[] = [];
if (configuration.files && configuration.files.watcherExclude) {
watcherIgnoredPatterns = Object.keys(configuration.files.watcherExclude).filter(k => !!configuration.files.watcherExclude[k]);
}
// build config
let fileServiceConfig: IFileServiceOptions = {
errorLogger: (msg: string) => errors.onUnexpectedError(msg),
encoding: configuration.files && configuration.files.encoding,
encodingOverride: encodingOverride,
watcherIgnoredPatterns: configuration.files && configuration.files.watcherExclude || [],
watcherIgnoredPatterns: watcherIgnoredPatterns,
verboseLogging: this.contextService.getConfiguration().env.verboseLogging
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册