shalupov / idea-cloudformation

AWS CloudFormation plugin for IntelliJ-based IDEs (IntelliJ IDEA, RubyMine, WebStorm, PhpStorm, PyCharm, AppCode, Android Studio, DataGrip, CLion)
https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaAwsCloudFormation_Master_Build&guest=1
Apache License 2.0
136 stars 27 forks source link

Remove unneccessary double quotes after aws reqoues renaming #114

Open ant-druha opened 6 years ago

ant-druha commented 6 years ago

From https://youtrack.jetbrains.com/issue/IDEA-182749

This is usability bug for aws cloudformation plugin.

Create following aws yaml cloudformation file:

    MyKmsKey:
        Type: "AWS::KMS::Key"
        Properties:
            Description: "My ksm key"
            KeyPolicy:
                Version: "2012-10-17"
                Id: "my id"
                Statement:
                    -
                        Effect: "Allow"
                        Principal:
                            AWS: !Join ["", ["arn:aws:iam::", "myString", ":root"]]
                        Action:
                            - "kms:*"
                        Resource: "*"

    MyKmsKeyAlias:
        Type: AWS::KMS::Alias
        Properties:
            AliasName: !Join ["-", ["alias", "myRegion" ]]
            TargetKeyId:
                Ref: MyKmsKey

Put cursor onto last line on MyKmsKey word

press shift + f6

enter MyKmsKey2 as new name

Expected behavior: Ref: MyKmsKey -> Ref: MyKmsKey2 and MyKmsKey: -> MyKmsKey2: (first line) Actual behavior: Ref: MyKmsKey -> Ref: "MyKmsKey2"

The doulble quotes can safely removed for readabulity.

Note It would be the best is intellij Idea search for MyKmsKey and ask to change MyKmsKeyAlias but it does not do this even when Search in comment and string is enabled in rename popup dialog.