Skip to content

Commit 5c28bd8

Browse files
authored
Added Command Open In NuGet Gallery to each page (#8)
1 parent 2521669 commit 5c28bd8

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/NuGetPackageSearchCmdPalExtension/Pages/SearchDotnetTemplatesPage.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ private static async Task<IReadOnlyList<ListItem>> ProcessSearchAsync(string sea
148148
process.StartInfo = startInfo;
149149
process.Start();
150150
process.WaitForExit();
151-
}){Icon = new IconInfo("\uE896"), Name = "Install Template"})
151+
}){Icon = new IconInfo("\uE896"), Name = "Install Template"}),
152+
new CommandContextItem(new OpenUrlCommand($"https://www.nuget.org/packages/{id}"){Name = "Open in NuGet Gallery"})
152153
]
153154
});
154155
}

src/NuGetPackageSearchCmdPalExtension/Pages/SearchDotnetToolsPage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ private static async Task<IReadOnlyList<ListItem>> ProcessSearchAsync(string sea
151151
}){Icon = new IconInfo("\uE896"), Name = "Install tool globally"}),
152152
new CommandContextItem(new CopyTextCommand($"dotnet tool install --local {id} --version {version}"){Name = "Copy local install command"}),
153153
new CommandContextItem(new CopyTextCommand($"#tool dotnet:?package={id}&version={version}"){Name = "Copy cake tool"}),
154-
new CommandContextItem(new CopyTextCommand($"nuke :add-package {id} --version {version}"){Name = "Copy NUKE"})
155-
154+
new CommandContextItem(new CopyTextCommand($"nuke :add-package {id} --version {version}"){Name = "Copy NUKE"}),
155+
new CommandContextItem(new OpenUrlCommand($"https://www.nuget.org/packages/{id}"){Name = "Open in NuGet Gallery"})
156156
]
157157
});
158158
}

src/NuGetPackageSearchCmdPalExtension/Pages/SearchMCPServerPage.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ private static async Task<IReadOnlyList<ListItem>> ProcessSearchAsync(string sea
163163
}
164164
""")
165165
{Name = "Copy MCP Server"}
166-
)
166+
),
167+
new CommandContextItem(new OpenUrlCommand($"https://www.nuget.org/packages/{id}"){Name = "Open in NuGet Gallery"})
167168
]
168169
});
169170
}

src/NuGetPackageSearchCmdPalExtension/Pages/SearchNuGetPackagesPage.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ private static async Task<IReadOnlyList<ListItem>> ProcessSearchAsync(string sea
142142
new CommandContextItem(new CopyTextCommand($"#r \"nuget: {id}, {version}\""){Name = "Copy Script & Interactive"}),
143143
new CommandContextItem(new CopyTextCommand($"#:package {id}@{version}"){Name = "Copy File-based Apps"}),
144144
new CommandContextItem(new CopyTextCommand($"#addin nuget:?package={id}={version}"){Name = "Copy Cake Addin"}),
145-
new CommandContextItem(new CopyTextCommand($"#tool nuget:?package={id}&version={version}"){Name = "Copy Cake Tool"})
145+
new CommandContextItem(new CopyTextCommand($"#tool nuget:?package={id}&version={version}"){Name = "Copy Cake Tool"}),
146+
new CommandContextItem(new OpenUrlCommand($"https://www.nuget.org/packages/{id}"){Name = "Open in NuGet Gallery"})
146147

147148
]
148149
});

0 commit comments

Comments
 (0)