Skip to content

Commit 8412309

Browse files
Copilotzadjii-msft
andauthored
Make "Reload" command case-insensitive in Command Palette (#39779)
## 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>
1 parent 471f6d1 commit 8412309

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Commands/FallbackReloadItem.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The Microsoft Corporation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
using System;
56
using Microsoft.CommandPalette.Extensions.Toolkit;
67

78
namespace Microsoft.CmdPal.UI.ViewModels.BuiltinCommands;
@@ -20,7 +21,7 @@ public FallbackReloadItem()
2021

2122
public override void UpdateQuery(string query)
2223
{
23-
_reloadCommand.Name = query.StartsWith('r') ? "Reload" : string.Empty;
24+
_reloadCommand.Name = query.StartsWith("r", StringComparison.OrdinalIgnoreCase) ? "Reload" : string.Empty;
2425
Title = _reloadCommand.Name;
2526
}
2627
}

0 commit comments

Comments
 (0)