Describe the bug
The extension is showing an incorrect YAML error, but whether the error is shown depends on the filename of the file being editing—specifically whether the filename is sam.yaml or ends in .sam.yaml.
I'm editing an AWS CloudFormation Serverless Application Model (SAM) YAML file. I have appropriate settings in my settings.json, including (among others) the following:
"yaml.customTags": [
"!Equals sequence",
"!Ref scalar"
],
Let's say I have a simple SAM YAML file foo.yaml using language extensions:
AWSTemplateFormatVersion: 2010-09-09
Transform:
- AWS::LanguageExtensions
- AWS::Serverless-2016-10-31
Description:
Foo.
Parameters:
Foo:
Description: Some parameter.
Type: String
AllowedValues: ['false', 'true']
Default: 'false'
Conditions:
IsFoo: !Equals [!Ref Foo, 'true']
That condition shows up just fine in the editor, as expected. But if I change the filename to foo.sam.yaml or sam.yaml, the extension shows an error! In particular !Equals [!Ref Foo, 'true'] is underlined in red, with the following error message:
Incorrect type. Expected "object(AWS CloudFormation Serverless Application Model (SAM))".yaml-schema: AWS CloudFormation Serverless Application Model (SAM)
If I rename the file to foo-sam.yaml or foo.yaml or anything-but-dot-sam.yaml, the error goes away.
I don't believe the filename should influence the linting of the YAML contents.
Environment
Describe the bug
The extension is showing an incorrect YAML error, but whether the error is shown depends on the filename of the file being editing—specifically whether the filename is
sam.yamlor ends in.sam.yaml.I'm editing an AWS CloudFormation Serverless Application Model (SAM) YAML file. I have appropriate settings in my
settings.json, including (among others) the following:Let's say I have a simple SAM YAML file
foo.yamlusing language extensions:That condition shows up just fine in the editor, as expected. But if I change the filename to
foo.sam.yamlorsam.yaml, the extension shows an error! In particular!Equals [!Ref Foo, 'true']is underlined in red, with the following error message:If I rename the file to
foo-sam.yamlorfoo.yamloranything-but-dot-sam.yaml, the error goes away.I don't believe the filename should influence the linting of the YAML contents.
Environment