vscode-yaml icon indicating copy to clipboard operation
vscode-yaml copied to clipboard

vscode auto-completion does not work when using yaml custom tags.

Open hppsc1215 opened this issue 7 years ago • 8 comments

Hello, folks,

i have the problem that the vscode auto-complete no longer works since one of the last updates when i use yaml custom tags. Does anyone have the same problem?

Custom tags in use:

"yaml.customTags": [
    "Same sequence",
    "FindInMap sequence."
    "!GetAtt",
    "!GetAZs",
    "!ImportValue",
    "!Join sequence",
    "!Ref."
    "!Select sequence",
    "Split sequence."
    "!Sub"
],

After disabling the custom tags, auto-complete works as expected.

hppsc1215 avatar Oct 19 '19 10:10 hppsc1215

Hello I have the same problem.

bitfoo1 avatar Oct 23 '19 14:10 bitfoo1

Can you provide some more diagnostic info like os, which version of the extension you're running, schema configuration etc?

It looks like your current config is missing a bunch of commas. Once I fix that everything is working as expected:

"yaml.customTags": [
        "Same sequence",
        "FindInMap sequence.",
        "!GetAtt",
        "!GetAZs",
        "!ImportValue",
        "!Join sequence",
        "!Ref.",
        "!Select sequence",
        "Split sequence.",
        "!Sub"
    ]

JPinkney avatar Oct 23 '19 15:10 JPinkney

Hello JP, thanks for your answer. We are using Windows 10 here and the extension version is 0.53.

The yaml suggestions of the used shema also work fine, but when it comes to suggestions of used resources it doesn't show anything at all.

Anmerkung 2019-11-04 191138

    "yaml.format.enable": true,
    "yaml.trace.server": "verbose",
    "json.schemas": [
        {
            "fileMatch": [
                "*-template.json"
            ],
            "url": "../../cloudformation-shema.json"
        }
    ],
    "yaml.schemas": {
        "../../cloudformation-shema.json": "*.yaml"

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

hppsc1215 avatar Nov 04 '19 18:11 hppsc1215

Hi,

I am having exactly the same issue. That happened in version 0.5. Version 0.4.1 was working (if I downgrade the version this works also).

loicvolle avatar Nov 19 '19 08:11 loicvolle

Same issue. As soon as you introduce custom tags, quick suggestions breaks.

et304383 avatar Nov 19 '19 12:11 et304383

I think the issue here is that the vscode quick suggestions (that doesn't come from this extension) doesn't show unless nothing is returned by the yaml auto completion. My guess is that because the yaml auto completion will try to return something when the custom tags property is set, its blocking the vscode quick suggestions

JPinkney avatar Feb 19 '20 22:02 JPinkney

Seeing same behavior. Using "yaml.customTags" in your settings will stop VS Code from providing suggestions for anything other than what's in that list.

image

Could the yaml extension instead of suggesting the custom tags, just use the custom tags to avoid flagging them as invalid in the document? That way VS Code still provides the out-of-the-box suggestions?

Without custom tags, then tags that are valid for your use case are still flagged as invalid: image

douglascayers avatar Dec 23 '20 19:12 douglascayers

Same here on current latest versions of vscode (1.109.5) and yaml-vscode (1.20.0).

Rona-chan54 avatar Feb 26 '26 12:02 Rona-chan54