From 46977dd907e99642aa044fd19940791e801d947c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:49:23 +0000 Subject: [PATCH 1/3] Initial plan From f06f17b2750b87700db4b2ed2959c40768177f17 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:54:55 +0000 Subject: [PATCH 2/3] feat: use VS Code locale for document count formatting with fallback to en-US Co-authored-by: tnaum-ms <171359267+tnaum-ms@users.noreply.github.com> --- src/utils/formatDocumentCount.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/utils/formatDocumentCount.ts b/src/utils/formatDocumentCount.ts index a4f4bcafe..77a4b89b0 100644 --- a/src/utils/formatDocumentCount.ts +++ b/src/utils/formatDocumentCount.ts @@ -3,6 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; + /** * Formats a document count for display in the tree view. * Uses compact notation for large numbers (e.g., "1.2K", "1.5M"). @@ -16,7 +18,15 @@ export function formatDocumentCount(count: number): string { } // Use Intl.NumberFormat for compact notation - const formatter = new Intl.NumberFormat('en', { + // Try to use the user's VS Code locale, fall back to 'en-US' on failure + let locale = 'en-US'; + try { + locale = vscode.env.language || 'en-US'; + } catch { + // Fall back to 'en-US' if vscode.env.language is unavailable + } + + const formatter = new Intl.NumberFormat(locale, { notation: 'compact', maximumFractionDigits: 1, }); From 3a8d8eff630efbff8b0dd2fc947e0c5295139c28 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:57:36 +0000 Subject: [PATCH 3/3] refactor: simplify locale handling with optional chaining Co-authored-by: tnaum-ms <171359267+tnaum-ms@users.noreply.github.com> --- src/utils/formatDocumentCount.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/utils/formatDocumentCount.ts b/src/utils/formatDocumentCount.ts index 77a4b89b0..974a30847 100644 --- a/src/utils/formatDocumentCount.ts +++ b/src/utils/formatDocumentCount.ts @@ -18,13 +18,8 @@ export function formatDocumentCount(count: number): string { } // Use Intl.NumberFormat for compact notation - // Try to use the user's VS Code locale, fall back to 'en-US' on failure - let locale = 'en-US'; - try { - locale = vscode.env.language || 'en-US'; - } catch { - // Fall back to 'en-US' if vscode.env.language is unavailable - } + // Try to use the user's VS Code locale, fall back to 'en-US' if unavailable + const locale = vscode.env?.language || 'en-US'; const formatter = new Intl.NumberFormat(locale, { notation: 'compact',