vscode
vscode copied to clipboard
BUG: code --status prints an empty "Conf files:" line when the workspace has no config files
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version:
mainat 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
- Bundle the real source with esbuild (
--external:@vscode/windows-registry --external:@vscode/windows-process-tree). - Call
DiagnosticsService.prototype.formatWorkspaceStatswithconfigFiles: []:
| 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) {