Skip to content

Commit 621044f

Browse files
authored
Add a page for searching for extensions on winget (microsoft#369)
Tested with the `command-line` tag, because there's no extensions in winget until microsoft/winget-pkgs#216685 merges Also adds a link to search in the Store, though I think that won't be as useful. Lastly - also actually fixes the tag search 😅 Builds on microsoft#356 Closes microsoft#89 Probably needs microsoft#370 to feel right
1 parent 28efaa8 commit 621044f

File tree

5 files changed

+51
-92
lines changed

5 files changed

+51
-92
lines changed
Loading
Loading

src/modules/cmdpal/exts/Microsoft.CmdPal.Ext.WinGet/Pages/InstalledPackagesPage.cs

-84
This file was deleted.

src/modules/cmdpal/exts/Microsoft.CmdPal.Ext.WinGet/Pages/WinGetExtensionPage.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private async Task<IEnumerable<CatalogPackage>> DoSearchAsync(string query, Canc
182182
{
183183
var tagFilter = WinGetStatics.WinGetFactory.CreatePackageMatchFilter();
184184
tagFilter.Field = Microsoft.Management.Deployment.PackageMatchField.Tag;
185-
tagFilter.Value = query;
185+
tagFilter.Value = _tag;
186186
tagFilter.Option = PackageFieldMatchOption.ContainsCaseInsensitive;
187187

188188
opts.Filters.Add(tagFilter);

src/modules/cmdpal/exts/Microsoft.CmdPal.Ext.WinGet/WinGetExtensionCommandsProvider.cs

+16-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
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;
6+
using System.IO;
57
using Microsoft.CmdPal.Extensions;
68
using Microsoft.CmdPal.Extensions.Helpers;
79

@@ -21,13 +23,20 @@ public WinGetExtensionCommandsProvider()
2123
private readonly ICommandItem[] _commands = [
2224
new ListItem(new WinGetExtensionPage()),
2325

24-
// new ListItem(
25-
// new Microsoft.CmdPal.Ext.WinGetPage("command-line") { Title = "tag:command-line" })
26-
// {
27-
// Title = "Search for command-line packages",
28-
// },
29-
30-
// new ListItem(new InstalledPackagesPage())
26+
new ListItem(
27+
new WinGetExtensionPage("windows-commandpalette-extension") { Title = "Install Extensions" })
28+
{
29+
Title = "Install Command Palette extensions",
30+
Subtitle = "Search for extensions on WinGet",
31+
Icon = new("\uEA86"), // Puzzle
32+
},
33+
34+
new ListItem(
35+
new OpenUrlCommand("ms-windows-store://assoc/?Tags=AppExtension-com.microsoft.windows.commandpalette"))
36+
{
37+
Title = "Search for extensions on the Store",
38+
Icon = new(Path.Combine(AppDomain.CurrentDomain.BaseDirectory.ToString(), "Assets\\ms-store.png")),
39+
},
3140
];
3241

3342
public override ICommandItem[] TopLevelCommands() => _commands;

0 commit comments

Comments
 (0)