Merge from vscode 2b0b9136329c181a9e381463a1f7dc3a2d105a34 (#4880)

This commit is contained in:
Karl Burtram
2019-04-05 10:09:18 -07:00
committed by GitHub
parent 9bd7e30d18
commit cb5bcf2248
433 changed files with 8915 additions and 8361 deletions

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { dirname, join, basename } from 'vs/base/common/path';
import { del, exists, readdir, readFile } from 'vs/base/node/pfs';
import { exists, readdir, readFile, rimraf } from 'vs/base/node/pfs';
import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { localize } from 'vs/nls';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
@@ -50,7 +50,7 @@ export class StartupProfiler implements IWorkbenchContribution {
const removeArgs: string[] = ['--prof-startup'];
const markerFile = readFile(profileFilenamePrefix).then(value => removeArgs.push(...value.toString().split('|')))
.then(() => del(profileFilenamePrefix)) // (1) delete the file to tell the main process to stop profiling
.then(() => rimraf(profileFilenamePrefix)) // (1) delete the file to tell the main process to stop profiling
.then(() => new Promise(resolve => { // (2) wait for main that recreates the fail to signal profiling has stopped
const check = () => {
exists(profileFilenamePrefix).then(exists => {
@@ -63,7 +63,7 @@ export class StartupProfiler implements IWorkbenchContribution {
};
check();
}))
.then(() => del(profileFilenamePrefix)); // (3) finally delete the file again
.then(() => rimraf(profileFilenamePrefix)); // (3) finally delete the file again
markerFile.then(() => {
return readdir(dir).then(files => files.filter(value => value.indexOf(prefix) === 0));

View File

@@ -4,7 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import { appendFile } from 'fs';
import { nfcall, timeout } from 'vs/base/common/async';
import { timeout } from 'vs/base/common/async';
import { promisify } from 'util';
import { onUnexpectedError } from 'vs/base/common/errors';
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
@@ -59,7 +60,7 @@ export class StartupTimings implements IWorkbenchContribution {
}
private async _appendStartupTimes(isStandardStartup: boolean) {
let appendTo = this._envService.args['prof-append-timers'];
const appendTo = this._envService.args['prof-append-timers'];
if (!appendTo) {
// nothing to do
return;
@@ -71,7 +72,7 @@ export class StartupTimings implements IWorkbenchContribution {
this._timerService.startupMetrics,
timeout(15000), // wait: cached data creation, telemetry sending
]).then(([startupMetrics]) => {
return nfcall(appendFile, appendTo, `${startupMetrics.ellapsed}\t${product.nameShort}\t${(product.commit || '').slice(0, 10) || '0000000000'}\t${sessionId}\t${isStandardStartup ? 'standard_start' : 'NO_standard_start'}\n`);
return promisify(appendFile)(appendTo, `${startupMetrics.ellapsed}\t${product.nameShort}\t${(product.commit || '').slice(0, 10) || '0000000000'}\t${sessionId}\t${isStandardStartup ? 'standard_start' : 'NO_standard_start'}\n`);
}).then(() => {
this._windowsService.quit();
}).catch(err => {