Comments (23)
This is the full set of required configurations (worked for me):
{
"window.zoomLevel": 0,
"workbench.colorTheme": "Material Theme Darker",
"yaml.customTags": [
"!And scalar",
"!And mapping",
"!And sequence",
"!If scalar",
"!If mapping",
"!If sequence",
"!Not scalar",
"!Not mapping",
"!Not sequence",
"!Equals scalar",
"!Equals mapping",
"!Equals sequence",
"!Or scalar",
"!Or mapping",
"!Or sequence",
"!FindInMap scalar",
"!FindInMap mappping",
"!FindInMap sequence",
"!Base64 scalar",
"!Base64 mapping",
"!Base64 sequence",
"!Cidr scalar",
"!Cidr mapping",
"!Cidr sequence",
"!Ref scalar",
"!Ref mapping",
"!Ref sequence",
"!Sub scalar",
"!Sub mapping",
"!Sub sequence",
"!GetAtt scalar",
"!GetAtt mapping",
"!GetAtt sequence",
"!GetAZs scalar",
"!GetAZs mapping",
"!GetAZs sequence",
"!ImportValue scalar",
"!ImportValue mapping",
"!ImportValue sequence",
"!Select scalar",
"!Select mapping",
"!Select sequence",
"!Split scalar",
"!Split mapping",
"!Split sequence",
"!Join scalar",
"!Join mapping",
"!Join sequence"
],
"yaml.format.enable": true,
}
from yaml-language-server.
Hi everyone! Its been a long time coming but I've finally got custom tags working when you have a tag with multiple different types. That means in the next version you're able to do:
"yaml.customTags": [
"!myTag1 scalar",
"!myTag1 mapping",
"!myTag1 sequence",
]
and the document will report no errors if you have something like:
test: !myTag1 hello_world
test2: !myTag1
hello: world
test3: !myTag1
- hello: world
from yaml-language-server.
Replacing "!Equals",
with "!Equals sequence",
in the settings worked for me for this
from yaml-language-server.
This works for me, but if you are using scalar types with those you will have issues
"yaml.customTags": [
"!fn",
"!And",
"!If",
"!Not",
"!Equals",
"!Or",
"!FindInMap sequence",
"!Base64",
"!Cidr",
"!Ref",
"!Sub",
"!GetAtt",
"!GetAZs",
"!ImportValue",
"!Select",
"!Split",
"!Join sequence"
]
from yaml-language-server.
I ended up using this one so far...
"yaml.customTags": [
"!fn",
"!And",
"!If",
"!Not",
"!Equals",
"!Or",
"!FindInMap sequence",
"!Base64",
"!Cidr",
"!Ref",
"!Sub",
"!GetAtt",
"!GetAZs",
"!ImportValue",
"!Select",
"!Split",
"!Join sequence",
"!Select sequence"
]
from yaml-language-server.
It also triggers follow on errors like missed comma between flow collection entries
but that seems to be a knock on effect of the previous
from yaml-language-server.
Not currently. Would you like to contribute one? I can show you where to get started.
from yaml-language-server.
It appears that after added "!If sequence" to the list of custom tags, I need to restart my editor and it will work.
from yaml-language-server.
none of the customTags options work when you mix and max sequence and scalar. it only uses the first one and doesn't allow for the alternative option. so far the only way to go is "yaml.validate": false
.
from yaml-language-server.
The CloudFormation extension has added support to do this configuration automatically. aws-cloudformation/cfn-lint-visual-studio-code#65
from yaml-language-server.
What are the errors?
from yaml-language-server.
unacceptable node kind for !<!FindInMap> tag; it should be "scalar", not "sequence"
from yaml-language-server.
It looks like instead of checking if the !FindInMap contains either scalar or sequence its looking like it is instead throwing an error when one one is found but not the other.
from yaml-language-server.
The sample above is from the AWS codepipeline tutorial here https://s3.amazonaws.com/cloudformation-examples/user-guide/continuous-deployment/wordpress-single-instance.zip
Hope that helps!
from yaml-language-server.
Any luck with fixing?
I have error
unknown tag <!Ref>
despite having
"yaml.customTags": [
"!Ref",
"!GetAtt",
"!FindInMap sequence",
"!FindInMap scalar",
"!GetAtt",
"!GetAZs",
"!Cidr",
"!ImportValue",
"!Join sequence",
"!Select",
"!Split",
"!Sub sequence",
"!Sub scalar",
"!And",
"!Equals",
"!If",
"!Not",
"!Or"
]
from yaml-language-server.
I have similar error for !Join:
unacceptable node kind for !<!Join> tag; it should be "scalar", not "sequence"
from yaml-language-server.
I had this issue too. Custom tags setup in user.settings, etc.
Removed cloudformation plugin
Removed rhel yaml plugin
Added in cloudformation plugin
(cloudformation plugin installed rhel yaml dependency)
Problem now (temporarily I assume!) resolved.
from yaml-language-server.
Still not working for me. This is the contents of my settings.json:
{ "workbench.startupEditor": "newUntitledFile", "git.enableSmartCommit": true, "window.zoomLevel": 0, "files.associations": {}, "yaml.customTags": [ "!Ref", "!GetAtt", "!FindInMap sequence", "!FindInMap scalar", "!GetAtt", "!GetAZs", "!Cidr", "!ImportValue", "!Join sequence", "!Select", "!Split", "!Sub sequence", "!Sub scalar", "!And", "!Equals", "!If", "!Not", "!Or"] }
Still get the error, unknown tag <!Equals>
Anyone have any luck resolving yet?
Tried reinstalling Cloudformation and YAML for RHEL plugin, no luck
from yaml-language-server.
I resolved a similar issue by renaming my template to end with yaml
extension. Same file throws errors with yml
extension.
from yaml-language-server.
Is there a fix in the works for this? Have to disable validation make the editor usable:
"yaml.validate": false
from yaml-language-server.
I'm not familiar with vscode extensions but I can take a look...
from yaml-language-server.
I believe the problem stems from: https://github.com/redhat-developer/yaml-language-server/blob/master/src/languageservice/parser/yamlParser.ts#L256 where we use the custom tags and put them into the yaml-ast-parser.
from yaml-language-server.
@JPinkney That's pretty cool! If I just have
"yaml.customTags": [
"!myTag1"
]
I think it would make sense that scalar, mapping and sequence should all be accepted for !myTag1
from yaml-language-server.
Related Issues (20)
- `- array item` suggestion gives extra line HOT 1
- `rangeFormatting` is used to register whole-document `formatting` capability
- Remove formatting provider HOT 4
- Yaml cant seem to process draft-4/7 schema editing HOT 1
- yaml is not validating correctly the config.yml file for github
- openapi discriminators
- Proposal for Donating the yaml-language-server Project to an Open Governance Foundation HOT 4
- Show enum values on hover HOT 1
- Github workflow deploy.yml detected as a PHP Deployer config
- docs: The examples in the README have their syntax set wrong
- YAML `---` for "Multiple documents within a single stream" doesn't work [YAML Language Server] HOT 1
- Cannot Load content for: schema.json Unknown schema: file
- URL fragment references does not resolve correctly
- Use inline JSON Schema w/o modeline - make `yaml-language-server` string optional
- Hover: Show root property title and description when using anyOf untitled un-described types
- Schema association with fallbacks (wildcards) HOT 1
- Is there tilde expanstion feature on the horizon (or already supported) in schemas paths?
- yamlls + schema working fine in neovim?
- openshift schemas in nvim with yamlls
- Add support for specifying schema via `# $schema: …`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yaml-language-server.