aws-scripting-guy / cform-VSCode

CloudFormation extension for Visual Studio Code
86 stars 36 forks source link

Add lambda snippets. #5

Closed fetherolfjd closed 7 years ago

fetherolfjd commented 7 years ago

This creates snippets for the 4 (current) lambda cloudformation blocks: lambda function, lambda version, lambda permission, and lambda alias.

fetherolfjd commented 7 years ago

Just doing a bit more learning about snippets, and noticed that they can be written in this style:

    "lambda-alias": {
      "prefix": "lambda-alias",
      "body": [
        "",
        "\"${1:lambdaAlias}\": {",
        "  \"Type\": \"AWS::Lambda::Alias\",",
        "  \"Properties\": {",
        "    \"FunctionName\": \"${2}\",",
        "    \"FunctionVersion\": \"${3}\",",
        "    \"Name\": \"${4}\",",
        "    \"Description\": \"${5}\"",
        "  }",
        "}",
        ""
      ],
      "description": "",
      "scope": "source.cloudformation"
    },

rather than the one long line for the body. Would you prefer that the snippets all stay as the single line? I think the body as an array is much more readable, but I'd like to adhere to your preference.