mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
## Summary of the Pull Request The Command Palette allows users to create extensions with dashes in their names, which is invalid for C# namespaces. This causes projects to fail during build because the name cannot be used as a valid namespace. ## Changes - Updated the validation regex in `NewExtensionForm.cs` to only allow valid C# identifiers - Now only allows names starting with a letter or underscore, followed by letters, numbers, or underscores - Explicitly prevents dashes, spaces, and other special characters - Improved the error message to clearly explain the requirements for valid C# identifiers ## Before Previously, the input only validated that no spaces were used: ```csharp "regex": "^[^\\s]+$" ``` ## After Now the input properly validates for C# namespace compatibility: ```csharp "regex": "^[a-zA-Z_][a-zA-Z0-9_]*$" ``` This ensures that users cannot create extension projects with names that would fail to build. ## PR Checklist - [ ] **Closes:** https://github.com/microsoft/PowerToys/issues/38522