vscode icon indicating copy to clipboard operation
vscode copied to clipboard

BUG: code --status prints an empty "Conf files:" line when the workspace has no config files

Open mant-raj opened this issue 1 week ago • 0 comments

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: main at commit 1d20abca144f85864e4f9a467f29e7b0bcd86489 (package version 1.148.0)
  • OS Version: Ubuntu 24.04.5 LTS, Node v22.23.5

Description

In src/vs/platform/diagnostics/node/diagnosticsService.ts (formatWorkspaceStats), the config files section is guarded by a condition that is always true:

if (workspaceStats.configFiles.length >= 0) {
    line = '|      Conf files:';

All the neighboring guards use > 0, including the next block (launchConfigFiles.length > 0).

Steps to Reproduce

  1. Bundle the real source with esbuild (--external:@vscode/windows-registry --external:@vscode/windows-process-tree).
  2. Call DiagnosticsService.prototype.formatWorkspaceStats with configFiles: []:
|      File types: ts(10)
|      Conf files:

Actual: An empty Conf files: header is printed. Expected: The section is omitted when there are no config files.

Suggested fix

if (workspaceStats.configFiles.length > 0) {

mant-raj avatar Nov 18 '26 17:11 mant-raj