CmdPal: collection of Run Commands nits (#42092)

* Path items were being treated inconsistently
* We shouldn't re-enumerate a directory on every keystroke
* A bunch of elements had empty TextToSuggest (which makes it crazier
  that it ever worked right)


Vaguely regressed in #41956
related to #39091
This commit is contained in:
Mike Griese
2025-10-02 06:36:59 -05:00
committed by GitHub
parent 55f0bcc441
commit 87af08630a
22 changed files with 418 additions and 452 deletions

View File

@@ -19,19 +19,21 @@ public partial class ShellCommandsProvider : CommandProvider
private readonly ShellListPage _shellListPage;
private readonly FallbackCommandItem _fallbackItem;
private readonly IRunHistoryService _historyService;
private readonly ITelemetryService _telemetryService;
public ShellCommandsProvider(IRunHistoryService runHistoryService)
public ShellCommandsProvider(IRunHistoryService runHistoryService, ITelemetryService telemetryService)
{
_historyService = runHistoryService;
_telemetryService = telemetryService;
Id = "com.microsoft.cmdpal.builtin.run";
DisplayName = Resources.cmd_plugin_name;
Icon = Icons.RunV2Icon;
Settings = _settingsManager.Settings;
_shellListPage = new ShellListPage(_settingsManager, _historyService);
_shellListPage = new ShellListPage(_settingsManager, _historyService, _telemetryService);
_fallbackItem = new FallbackExecuteItem(_settingsManager, _shellListPage.AddToHistory);
_fallbackItem = new FallbackExecuteItem(_settingsManager, _shellListPage.AddToHistory, _telemetryService);
_shellPageItem = new CommandItem(_shellListPage)
{