This pull request introduces a new logging infrastructure for the CmdPal module by integrating the Microsoft.Extensions.Logging (MEL) abstraction and routing all log output through the existing `ManagedCommon.Logger`. The changes add a custom logger, logger provider, and extension method for easy registration, and update dependencies and service configuration to enable the new logging system. > This logging is not in use currently, but will be in a future PR. **Logging Infrastructure Integration:** * Added a new `CmdPalLogger` class implementing `ILogger`, which delegates logging calls to `ManagedCommon.Logger` to centralize and standardize log output. * Implemented `CmdPalLoggerProvider` to create and manage `CmdPalLogger` instances, allowing MEL-based logging throughout the application. * Introduced `CmdPalLoggingExtensions.AddCmdPalLogging` for registering the logger provider via dependency injection, ensuring all MEL logging is routed appropriately. * Updated `App.xaml.cs` to register the new logging system with `services.AddCmdPalLogging()`, enabling the infrastructure at application startup. [[1]](diffhunk://#diff-84386fa8a23e7058525bd269788bbf9e352b1f49d08e5f877059386ba3b83222R8) [[2]](diffhunk://#diff-84386fa8a23e7058525bd269788bbf9e352b1f49d08e5f877059386ba3b83222R129-R130) **Project and Dependency Updates:** * Updated the project file `Microsoft.CmdPal.Common.csproj` to reference the `ManagedCommon` project and to include a folder for the new logging code. [[1]](diffhunk://#diff-affab7e2df96d3b8073ab649e4ef5a34d459cd69e525573fd6426d698efec18fR29) [[2]](diffhunk://#diff-affab7e2df96d3b8073ab649e4ef5a34d459cd69e525573fd6426d698efec18fR64-R67)
Command Palette
Windows Command Palette ("CmdPal") is the next iteration of PowerToys Run. With extensibility at its core, the Command Palette is your one-stop launcher to start anything.
By default, CmdPal is bound to Win+Alt+Space.
Creating an extension
The fastest way to get started is just to run the "Create extension" command in the palette itself. That'll prompt you for a project name and a Display Name, and where you want to place your project. Then just open the sln it produces. You should be ready to go 🙂.
The official API documentation can be found on this docs site.
We've also got samples, so that you can see how the APIs in-action.
- We've got generic samples in the repo
- We've got real samples in the repo too
- And we've even got real extensions that we've "shipped" already
[!info] The Command Palette is currently in preview. Many features of the API are not yet fully implemented. We may introduce breaking API changes before CmdPal itself is v1.0.0
Building CmdPal
Install & Build PowerToys
- Follow the install and build instructions for PowerToys
Load & Build
- In Visual Studio, in the Solution Explorer Pane, confirm that all of the files/projects in
src\modules\CommandPaletteandsrc\common\CalculatorEngineCommondo not have(unloaded)on the right side- If any file has
(unloaded), right click on file and selectReload Project
- If any file has
- Now you can right click on one of the project below to
Buildand thenDeploy:
Projects of interest are:
Microsoft.CmdPal.UI: This is the main project for CmdPal. Build and run this to get the CmdPal.Microsoft.CommandPalette.Extensions: This is the official extension interface.- This is designed to be language-agnostic. Any programming language which supports implementing WinRT interfaces should be able to implement the WinRT interface.
Microsoft.CommandPalette.Extensions.Toolkit: This is a C# helper library for creating extensions. This makes writing extensions easier.- Everything under "SampleExtensions": These are example plugins to demo how to author extensions. Deploy any number of these, to get a feel for how the extension API works.