-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide adding decorators as quickfix. Fixes #1406 #5544
Provide adding decorators as quickfix. Fixes #1406 #5544
Conversation
I do not understand why my changes caused a "Azure.Identity.CredentialUnavailableException: EnvironmentCredential authentication unavailable. Environment variables are not fully configured. See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/environmentcredential/troubleshoot" in the build so that all "Build / Test CLI (live)" builds failed. Please tell me what I need to change if my changes are related to the build failures. |
@nilshedstrom you can safely ignore the live test failures - they're optional, and the breakages are unrelated to your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you very much for contributing!
Reverting the checkin - suites are failing. It's likely they started failing after the PR was created. Sorry, Nils. @nilshedstrom |
@anthony-c-martin Thanks for fixing the test! |
* Codefix example * Made SecureParameterCodeFixProvider more robust * Trying to fix the tests for CodeActions (after adding the new QuickFix'es) * Added DescriptionParameterCodeFixProvider * Refactored and added support for @Allowed, @minlength, @maxlength, @minValue, @MaxValue * Made ParameterCodeFixProvider more robust Co-authored-by: Anthony Martin <antmarti@microsoft.com> Co-authored-by: Hedström, Nils <nils.hedstrom@if.se>
This PR adds the ability to add common decorators for parameters (as suggested in #1406).
The implementation is based on "Codefix example" made by @anthony-c-martin
The following decorators are supported
Note that it will only be possible to add a decorator if it is supported by the current parameter type (minValue and maxValue can only be added to parameters of type int as an example).
The changes to src/Bicep.LangServer.IntegrationTests/CodeActionTests.cs were made to avoid the tests to get confused by the new fixes provided by ParameterCodeFixProvider (they are tested in src/Bicep.LangServer.IntegrationTests/CodeFixTests.cs)