diff --git a/src/vs/workbench/api/node/extHostFileSystemEventService.ts b/src/vs/workbench/api/node/extHostFileSystemEventService.ts index abfcee9b75f5ae32d5dd03d8b169436b2c63ab25..0e6ddf0a9aca87eaa3de87354e9bb2c1fa1a3ccd 100644 --- a/src/vs/workbench/api/node/extHostFileSystemEventService.ts +++ b/src/vs/workbench/api/node/extHostFileSystemEventService.ts @@ -33,13 +33,13 @@ class FileSystemWatcher implements _FileSystemWatcher { constructor(dispatcher: Event, globPattern: string, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean) { this._config = 0; - if (!ignoreCreateEvents) { + if (ignoreCreateEvents) { this._config += 0b001; } - if (!ignoreChangeEvents) { + if (ignoreChangeEvents) { this._config += 0b010; } - if (!ignoreDeleteEvents) { + if (ignoreDeleteEvents) { this._config += 0b100; } diff --git a/src/vs/workbench/test/electron-browser/api/extHostFileSystemEventService.test.ts b/src/vs/workbench/test/electron-browser/api/extHostFileSystemEventService.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..1bea8cfccef6d7519e7f18dee46d9bcacc9acf2f --- /dev/null +++ b/src/vs/workbench/test/electron-browser/api/extHostFileSystemEventService.test.ts @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as assert from 'assert'; +import { ExtHostFileSystemEventService } from 'vs/workbench/api/node/extHostFileSystemEventService'; + +suite('ExtHostFileSystemEventService', () => { + + + test('FileSystemWatcher ignore events properties are reversed #26851', function () { + + const watcher1 = new ExtHostFileSystemEventService().createFileSystemWatcher('**/somethingInteresting', false, false, false); + assert.equal(watcher1.ignoreChangeEvents, false); + assert.equal(watcher1.ignoreCreateEvents, false); + assert.equal(watcher1.ignoreDeleteEvents, false); + + const watcher2 = new ExtHostFileSystemEventService().createFileSystemWatcher('**/somethingBoring', true, true, true); + assert.equal(watcher2.ignoreChangeEvents, true); + assert.equal(watcher2.ignoreCreateEvents, true); + assert.equal(watcher2.ignoreDeleteEvents, true); + }); + +});