Merge from vscode fcf3346a8e9f5ee1e00674461d9e2c2292a14ee3 (#12295)

* Merge from vscode fcf3346a8e9f5ee1e00674461d9e2c2292a14ee3

* Fix test build break

* Update distro

* Fix build errors

* Update distro

* Update REH build file

* Update build task names for REL

* Fix product build yaml

* Fix product REH task name

* Fix type in task name

* Update linux build step

* Update windows build tasks

* Turn off server publish

* Disable REH

* Fix typo

* Bump distro

* Update vscode tests

* Bump distro

* Fix type in disto

* Bump distro

* Turn off docker build

* Remove docker step from release

Co-authored-by: ADS Merger <andresse@microsoft.com>
Co-authored-by: Karl Burtram <karlb@microsoft.com>
This commit is contained in:
Christopher Suh
2020-10-03 14:42:05 -04:00
committed by GitHub
parent 58d02b76db
commit 6ff1e3866b
687 changed files with 10507 additions and 9104 deletions

View File

@@ -85,7 +85,7 @@ export class FileWatcher extends Disposable {
}
// Handle emit through delayer to accommodate for bulk changes and thus reduce spam
this.fileChangesDelayer.trigger(() => {
this.fileChangesDelayer.trigger(async () => {
const fileChanges = this.fileChangesBuffer;
this.fileChangesBuffer = [];
@@ -103,8 +103,6 @@ export class FileWatcher extends Disposable {
if (normalizedFileChanges.length > 0) {
this.onDidFilesChange(normalizedFileChanges);
}
return Promise.resolve();
});
}

View File

@@ -22,8 +22,8 @@ nsfwActionToRawChangeType[nsfw.actions.MODIFIED] = FileChangeType.UPDATED;
nsfwActionToRawChangeType[nsfw.actions.DELETED] = FileChangeType.DELETED;
interface IWatcherObjet {
start(): any;
stop(): any;
start(): void;
stop(): void;
}
interface IPathWatcher {
@@ -142,7 +142,7 @@ export class NsfwWatcherService implements IWatcherService {
}
// Delay and send buffer
fileEventDelayer.trigger(() => {
fileEventDelayer.trigger(async () => {
const events = undeliveredFileEvents;
undeliveredFileEvents = [];
@@ -169,8 +169,6 @@ export class NsfwWatcherService implements IWatcherService {
this.log(` >> normalized ${r.type === FileChangeType.ADDED ? '[ADDED]' : r.type === FileChangeType.DELETED ? '[DELETED]' : '[CHANGED]'} ${r.path}`);
});
}
return Promise.resolve(undefined);
});
}).then(watcher => {
this._pathWatchers[request.path].watcher = watcher;
@@ -180,8 +178,7 @@ export class NsfwWatcherService implements IWatcherService {
});
}
public setRoots(roots: IWatcherRequest[]): Promise<void> {
const promises: Promise<void>[] = [];
async setRoots(roots: IWatcherRequest[]): Promise<void> {
const normalizedRoots = this._normalizeRoots(roots);
// Gather roots that are not currently being watched
@@ -214,23 +211,19 @@ export class NsfwWatcherService implements IWatcherService {
this._pathWatchers[root.path].ignored = Array.isArray(root.excludes) ? root.excludes.map(ignored => glob.parse(ignored)) : [];
}
});
return Promise.all(promises).then(() => undefined);
}
public setVerboseLogging(enabled: boolean): Promise<void> {
async setVerboseLogging(enabled: boolean): Promise<void> {
this._verboseLogging = enabled;
return Promise.resolve(undefined);
}
public stop(): Promise<void> {
async stop(): Promise<void> {
for (let path in this._pathWatchers) {
let watcher = this._pathWatchers[path];
watcher.ready.then(watcher => watcher.stop());
delete this._pathWatchers[path];
}
this._pathWatchers = Object.create(null);
return Promise.resolve();
}
/**

View File

@@ -10,11 +10,14 @@ import { NsfwWatcherService } from 'vs/platform/files/node/watcher/nsfw/nsfwWatc
import { IWatcherRequest } from 'vs/platform/files/node/watcher/nsfw/watcher';
class TestNsfwWatcherService extends NsfwWatcherService {
public normalizeRoots(roots: string[]): string[] {
normalizeRoots(roots: string[]): string[] {
// Work with strings as paths to simplify testing
const requests: IWatcherRequest[] = roots.map(r => {
return { path: r, excludes: [] };
});
return this._normalizeRoots(requests).map(r => r.path);
}
}

View File

@@ -23,7 +23,7 @@ process.noAsar = true; // disable ASAR support in watcher process
interface IWatcher {
requests: ExtendedWatcherRequest[];
stop(): any;
stop(): Promise<void>;
}
interface ExtendedWatcherRequest extends IWatcherRequest {
@@ -61,13 +61,11 @@ export class ChokidarWatcherService implements IWatcherService {
return this.onWatchEvent;
}
setVerboseLogging(enabled: boolean): Promise<void> {
async setVerboseLogging(enabled: boolean): Promise<void> {
this._verboseLogging = enabled;
return Promise.resolve();
}
setRoots(requests: IWatcherRequest[]): Promise<void> {
async setRoots(requests: IWatcherRequest[]): Promise<void> {
const watchers = Object.create(null);
const newRequests: string[] = [];
@@ -86,7 +84,7 @@ export class ChokidarWatcherService implements IWatcherService {
// stop all old watchers
for (const path in this._watchers) {
this._watchers[path].stop();
await this._watchers[path].stop();
}
// start all new watchers
@@ -96,7 +94,6 @@ export class ChokidarWatcherService implements IWatcherService {
}
this._watchers = watchers;
return Promise.resolve();
}
// for test purposes
@@ -166,13 +163,13 @@ export class ChokidarWatcherService implements IWatcherService {
const watcher: IWatcher = {
requests,
stop: () => {
stop: async () => {
try {
if (this._verboseLogging) {
this.log(`Stop watching: ${basePath}]`);
}
if (chokidarWatcher) {
chokidarWatcher.close();
await chokidarWatcher.close();
this._watcherCount--;
chokidarWatcher = null;
}
@@ -248,8 +245,9 @@ export class ChokidarWatcherService implements IWatcherService {
undeliveredFileEvents.push(event);
if (fileEventDelayer) {
// Delay and send buffer
fileEventDelayer.trigger(() => {
fileEventDelayer.trigger(async () => {
const events = undeliveredFileEvents;
undeliveredFileEvents = [];
@@ -264,7 +262,7 @@ export class ChokidarWatcherService implements IWatcherService {
});
}
return Promise.resolve(undefined);
return undefined;
});
}
});
@@ -291,15 +289,13 @@ export class ChokidarWatcherService implements IWatcherService {
return watcher;
}
stop(): Promise<void> {
async stop(): Promise<void> {
for (const path in this._watchers) {
const watcher = this._watchers[path];
watcher.stop();
await watcher.stop();
}
this._watchers = Object.create(null);
return Promise.resolve();
}
private log(message: string) {

View File

@@ -131,7 +131,7 @@ export class OutOfProcessWin32FolderWatcher {
this.logCallback({ type: 'trace', message: `[File Watcher (C#)] ${message}` });
}
public dispose(): void {
dispose(): void {
if (this.handle) {
this.handle.kill();
this.handle = undefined;