Skip to content

Commit 02710ec

Browse files
committed
Remove some deprecated code in ./src/vs/base microsoft#103454
1 parent cced925 commit 02710ec

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/vs/platform/diagnostics/node/diagnosticsService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { join, basename } from 'vs/base/common/path';
1010
import { parse, ParseError, getNodeType } from 'vs/base/common/json';
1111
import { listProcesses } from 'vs/base/node/ps';
1212
import product from 'vs/platform/product/common/product';
13-
import { repeat, pad } from 'vs/base/common/strings';
1413
import { isWindows, isLinux } from 'vs/base/common/platform';
1514
import { URI } from 'vs/base/common/uri';
1615
import { ProcessItem } from 'vs/base/common/processes';
@@ -435,7 +434,7 @@ export class DiagnosticsService implements IDiagnosticsService {
435434
private expandGPUFeatures(gpuFeatures: any): string {
436435
const longestFeatureName = Math.max(...Object.keys(gpuFeatures).map(feature => feature.length));
437436
// Make columns aligned by adding spaces after feature name
438-
return Object.keys(gpuFeatures).map(feature => `${feature}: ${repeat(' ', longestFeatureName - feature.length)} ${gpuFeatures[feature]}`).join('\n ');
437+
return Object.keys(gpuFeatures).map(feature => `${feature}: ${' '.repeat(longestFeatureName - feature.length)} ${gpuFeatures[feature]}`).join('\n ');
439438
}
440439

441440
private formatWorkspaceMetadata(info: IMainProcessInfo): Promise<string> {
@@ -500,14 +499,15 @@ export class DiagnosticsService implements IDiagnosticsService {
500499
if (isRoot) {
501500
name = item.pid === mainPid ? `${product.applicationName} main` : 'remote agent';
502501
} else {
503-
name = `${repeat(' ', indent)} ${item.name}`;
502+
name = `${' '.repeat(indent)} ${item.name}`;
504503

505504
if (item.name === 'window') {
506505
name = `${name} (${mapPidToWindowTitle.get(item.pid)})`;
507506
}
508507
}
508+
509509
const memory = process.platform === 'win32' ? item.mem : (osLib.totalmem() * (item.mem / 100));
510-
output.push(`${pad(Number(item.load.toFixed(0)), 5, ' ')}\t${pad(Number((memory / MB).toFixed(0)), 6, ' ')}\t${pad(Number((item.pid).toFixed(0)), 6, ' ')}\t${name}`);
510+
output.push(`${item.load.toFixed(0).padStart(5, ' ')}\t${(memory / MB).toFixed(0).padStart(6, ' ')}\t${item.pid.toFixed(0).padStart(6, ' ')}\t${name}`);
511511

512512
// Recurse into children if any
513513
if (Array.isArray(item.children)) {

0 commit comments

Comments
 (0)