From 8412309fed36b247887ab61c5717a2cf35c7f8fc Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Jun 2025 16:35:51 -0500 Subject: [PATCH] Make "Reload" command case-insensitive in Command Palette (#39779) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem The "Reload" command in the Command Palette was only showing up when searching with a lowercase 'r' (e.g., "reload") but not with an uppercase 'R' (e.g., "Reload"). This was inconsistent with the documentation which references a "Reload" command. ## Solution Fixed the case-sensitivity issue in `FallbackReloadItem.UpdateQuery()` by changing the string comparison from case-sensitive to case-insensitive: ```csharp // Before _reloadCommand.Name = query.StartsWith('r') ? "Reload" : string.Empty; // After _reloadCommand.Name = query.StartsWith("r", StringComparison.OrdinalIgnoreCase) ? "Reload" : string.Empty; ``` This change makes the Reload command visible when typing either "reload" or "Reload" in the Command Palette, improving the user experience for extension developers. Fixes #39769. --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: zadjii-msft <18356694+zadjii-msft@users.noreply.github.com> --- .../Commands/FallbackReloadItem.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Commands/FallbackReloadItem.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Commands/FallbackReloadItem.cs index 22dfe77776..97f933b23c 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Commands/FallbackReloadItem.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Commands/FallbackReloadItem.cs @@ -2,6 +2,7 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using Microsoft.CommandPalette.Extensions.Toolkit; namespace Microsoft.CmdPal.UI.ViewModels.BuiltinCommands; @@ -20,7 +21,7 @@ internal sealed partial class FallbackReloadItem : FallbackCommandItem public override void UpdateQuery(string query) { - _reloadCommand.Name = query.StartsWith('r') ? "Reload" : string.Empty; + _reloadCommand.Name = query.StartsWith("r", StringComparison.OrdinalIgnoreCase) ? "Reload" : string.Empty; Title = _reloadCommand.Name; } }