Skip to content
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

yaml.customTags not working in 0.17.0 #461

Closed
1 of 4 tasks
data-ux opened this issue Mar 26, 2021 · 7 comments
Closed
1 of 4 tasks

yaml.customTags not working in 0.17.0 #461

data-ux opened this issue Mar 26, 2021 · 7 comments
Assignees
Labels
Milestone

Comments

@data-ux
Copy link

data-ux commented Mar 26, 2021

Describe the bug

After updating from 0.16.0 to 0.17.0 all custom tags result in errors like:
unknown tag <!GetAtt>YAML

Expected Behavior

Custom tags continue to work

Current Behavior

Use of custom tags in YAML result in error.

Steps to Reproduce

When using the settings:

"yaml.customTags": [
        "!And",
        "!If",
        "!Not",
        "!Equals",
        "!Or",
        "!FindInMap sequence",
        "!Base64",
        "!Cidr",
        "!Ref",
        "!Sub",
        "!GetAtt",
        "!GetAZs",
        "!ImportValue",
        "!Select",
        "!Select sequence",
        "!Split",
        "!Join sequence"
    ]

And in YAML typing, eg.
RoleArn: !GetAtt ECSRunTaskAsyncRole.Arn

Results in error:
unknown tag <!GetAtt>YAML

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)
@evidolob
Copy link
Collaborator

evidolob commented Mar 26, 2021

@data-ux I cannot reproduce this:
Screenshot 2021-03-26 at 14 20 07

I used yaml.customTags which you provide.

Can you provide more info:

  • Exact yaml.customTags preference, and any other yaml preference.
  • Is there any JSON Schema associated with your yaml file?
  • The content and name of yaml file where you has that error.

@JPinkney
Copy link
Contributor

I can't reproduce it either. Can you also let us know what yaml related extensions you are using?

@chace86
Copy link

chace86 commented Mar 28, 2021

I am having the same issue 0.17.0. I uninstalled all extensions that relied on YAML - CloudFormation, Spring Boot Tools, and reinstalled YAML extension. Here are is a list of my remaining extensions:

DavidAnson.vscode-markdownlint
DotJoshJohnson.xml
Equinusocio.vsc-community-material-theme
Equinusocio.vsc-material-theme
equinusocio.vsc-material-theme-icons
GabrielBB.vscode-lombok
hashicorp.terraform
hediet.vscode-drawio
Ikuyadeu.r
James-Yu.latex-workshop
ms-azuretools.vscode-docker
ms-dotnettools.csharp
ms-python.python
ms-toolsai.jupyter
ms-vscode-remote.remote-containers
ms-vscode.atom-keybindings
PKief.material-icon-theme
redhat.java
redhat.vscode-yaml
shd101wyy.markdown-preview-enhanced
streetsidesoftware.code-spell-checker
VisualStudioExptTeam.vscodeintellicode
vscjava.vscode-java-debug
vscjava.vscode-java-dependency
vscjava.vscode-java-pack
vscjava.vscode-java-test
vscjava.vscode-maven
wayou.vscode-todo-highlight
yzhang.markdown-all-in-one

Here is my settings.json file:

{
    "editor.fontSize": 13,
    "terminal.integrated.fontSize": 13,
    "window.zoomLevel": 0,
    "yaml.customTags": [
        "!GetAtt",
        "!Sub",
        "!Ref",
        "!Equals sequence",
        "!FindInMap sequence",
        "!If sequence",
        "!Join sequence",
        "!reference sequence"
    ],
    "markdown-preview-enhanced.previewTheme": "monokai.css",
    "hediet.vscode-drawio.local-storage": "eyIuZHJhd2lvLWNvbmZpZyI6IntcImxhbmd1YWdlXCI6XCJcIixcImN1c3RvbUZvbnRzXCI6W10sXCJsaWJyYXJpZXNcIjpcImdlbmVyYWxcIixcImN1c3RvbUxpYnJhcmllc1wiOltcIkwuc2NyYXRjaHBhZFwiXSxcInBsdWdpbnNcIjpbXSxcInJlY2VudENvbG9yc1wiOltdLFwiZm9ybWF0V2lkdGhcIjpcIjI0MFwiLFwiY3JlYXRlVGFyZ2V0XCI6ZmFsc2UsXCJwYWdlRm9ybWF0XCI6e1wieFwiOjAsXCJ5XCI6MCxcIndpZHRoXCI6ODUwLFwiaGVpZ2h0XCI6MTEwMH0sXCJzZWFyY2hcIjp0cnVlLFwic2hvd1N0YXJ0U2NyZWVuXCI6dHJ1ZSxcImdyaWRDb2xvclwiOlwiI2QwZDBkMFwiLFwiZGFya0dyaWRDb2xvclwiOlwiIzZlNmU2ZVwiLFwiYXV0b3NhdmVcIjp0cnVlLFwicmVzaXplSW1hZ2VzXCI6bnVsbCxcIm9wZW5Db3VudGVyXCI6MCxcInZlcnNpb25cIjoxOCxcInVuaXRcIjoxLFwiaXNSdWxlck9uXCI6ZmFsc2UsXCJ1aVwiOlwiXCJ9In0=",
    "terminal.integrated.shell.osx": "/bin/zsh",
    "files.exclude": {
        "**/.classpath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/.factorypath": true
    },
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "java.configuration.runtimes": [
        {
            "name": "JavaSE-1.8",
            "path": "/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home",
            "default": true
        }
    ],
    "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -javaagent:\"/Users/chace.anderson/.vscode/extensions/gabrielbb.vscode-lombok-1.0.1/server/lombok.jar\"",
    "workbench.colorTheme": "Material Theme Darker High Contrast",
    "latex-workshop.message.update.show": false,
    "editor.codeActionsOnSave": null,
    "editor.semanticTokenColorCustomizations": null,
    "atomKeymap.promptV3Features": true,
    "editor.multiCursorModifier": "ctrlCmd",
    "editor.formatOnPaste": true,
    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],
    "[yaml]": {
        "editor.insertSpaces": true,
        "editor.tabSize": 2,
        "editor.autoIndent": "keep",
        "editor.quickSuggestions": {
            "other": true,
            "comments": false,
            "strings": true
        }
    }
}

I am also running the extension on MacOS. Anything else I can provide to help resolve?

@chace86
Copy link

chace86 commented Mar 29, 2021

Making a change to a yaml file and then saving caused the file to reset and validation errors resolved.

@evidolob evidolob added the bug label Mar 29, 2021
@KiraPC
Copy link

KiraPC commented Mar 29, 2021

Making a change to a yaml file and then saving caused the file to reset and validation errors resolved.

That worked for me. It's like it load the configuration just after the file change and not when it is open.

@ssbarnea
Copy link
Member

ssbarnea commented Mar 31, 2021

Is it possible to use contributes: and extend the list of customTags from another extension?

I have a list of tags which are allowed for some Ansible files and I do not want them to be highlighted as unknown by YAML extension.

Ideally these tags should be configured per schema file for which we already have extension points, but even a global approach would suffice for now.

@vtcifer
Copy link

vtcifer commented Apr 4, 2021

Making a change to a yaml file and then saving caused the file to reset and validation errors resolved.

Same error, same fix here, but I have to make a change and re-save the file every time I reopen vscode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants