redhat-developer / redhat-developer/vscode-yaml

`.clang-format` have schema, extension complain `No JSON Schema`

Open
#1,124 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
829
Forks
260
Avg merge
5h 43m
Merged PRs (30d)
1

Description

Describe the bug

.clang-format have schema, extension complain No JSON Schema

Expected Behavior

.clang-format have schema, extension should detect it

Current Behavior

.clang-format have schema, extension complain No JSON Schema

Steps to Reproduce

/path/to/c/.clang-format

BasedOnStyle: LLVM

YAML UI No JSON Schema when

{
  "folders": [
    {
      "name": "c",
      "path": "/path/to/c",
    },
  ],
  "settings": {
    "yaml.schemas": {
      // "https://json.schemastore.org/clang-format.json": ".clang-format"
    },
  },
}

YAML UI .clang-format config when using below workaround

{
  "folders": [
    {
      "name": "c",
      "path": "/path/to/c",
    },
  ],
  "settings": {
    "yaml.schemas": {
      "https://json.schemastore.org/clang-format.json": ".clang-format"
    },
  },
}

But this config should be default within schema store.

https://github.com/SchemaStore/schemastore/blob/bbfad980a9dc222d0d6d7d91a87286eca83a22b0/src/api/json/catalog.json#L6870-L6875

    {
      "name": "clang-format (.clang-format)",
      "description": "yaml clang-format config",
      "fileMatch": [".clang-format"],
      "url": "https://json.schemastore.org/clang-format.json"
    },

So, there also might be other config file, with schema, but not silently not enchanced by yaml extension.

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with a .clang-format file containing BasedOnStyle: LLVM, first without and then with the yaml.schemas workaround. Inspect the SchemaStore catalog.json clang-format entry and the extension's schema-discovery entry points to determine why its fileMatch is missed. Done means .clang-format receives the clang-format schema without manual configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode, yaml
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.