question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AutoComplete not showing up in .yaml (but in .json with same json schema file!)

See original GitHub issue

Seems like same as this issue from a long time ago: https://github.com/redhat-developer/vscode-yaml/issues/222

I am using the latest version of VSCode and this plugin.

Here’s the json schema:

{
  "$id": "foo",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "cd": {
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "enum": [
            "multizoneClusterSystem",
            "foobar"
          ]
        },
        "couchdb": {
          "type": "boolean",
          "description": "Whether you are using couchdb or not"
        }
      },
      "required": [ "profile" ]
    }
  },
  "required": [
    "cd"
  ]
}

Here’s the settings.json entry:

    "yaml.schemas": {
        "/Users/kamok/Documents/code/yaml-validation-demo/cd.json": [
            "*build.yml"
        ]
    },
    "json.schemas": [
        {
            "fileMatch": ["build.json"],
            "url": "/cd.json"
        }
    ],

Here’s the two .yml and .json files:

{
  "cd": {
    "profile": "foobar",
    "couchdb": false
  }
}
cd:
  profile: foobar

The .yml file, when I type profile does not pop up the two options. The json does!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kamokcommented, Apr 27, 2021

I guess I’ll try to make the contribution during my next Friday’s “Your Learning” here at IBM. Thanks for your help. I will probably just search for editor.action.triggerSuggest in the codebase and see how it is implemented in json and replicate in yaml.

0reactions
dean-vanderwath-lab3commented, Nov 8, 2021

Hey all, was there an update on this? YAML just doesn’t auto-complete sub definitions where json does I think its related to this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create your own auto-completion for JSON and YAML ...
Open the settings for the YAML extension and search for "Yaml: Schemas" and click "Edit in settings.json". VS Code settings. The "settings.json" ...
Read more >
Autocomplete not working when editing JSON with schema ...
JSON file must be a part of opened project to make autocomplete work. Unfortunately, Visual Studio doesn't yet support schema for Windows Terminal...
Read more >
Boost your YAML with autocompletion and validation - Medium
Yes JSON Schema works both for JSON and YAML files. It allows to add description to properties, declare a property type, declare property ......
Read more >
Create your own auto-completion for JSON and YAML files on ...
In this article, I demonstrate how to create a JSON Schema, to provide auto-completion to Hadolint configuration files on VS Code editor.
Read more >
For Yaml autocompletion file matching of JSON schema is not ...
The reproduce steps explain the issue on a GitHub Actions .yml files but I think the problem has larger scope. It looks like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found