jsonvisual-studio-code

Disable predefined filename - JSON schema association


I am using Visual Studio Code 1.60.1. In my project I use many files called project.json and have created my custom JSON schema for them.

When I specify my schema via $schema field directly in project.json everything works just fine.

But I want to use .vscode/settings.json file for that:

{
    "json.schemas": [
        {
            "fileMatch": [
                "data/projects/list/*/project.json"
            ],
            "url": "./.vscode/schemas/project.json"
        }
    ]
}

This works too BUT in this case it appears that VS Code is mixing two schemas for my file, which is showing in a tip when I hover the opening { in editor:

  1. JSON schema for .NET Core project.json files
  2. [My scheme name]

This results in mixing properties and messed up hints and autocomplition suggestions.

How can I disable VS Code default ".NET Core" schema for my files and leave only my schema?


Solution

  • Turns out I had C# official extension installed.

    I disabled it and everything is working just fine! The moral is: if something goes wrong, don't forget to check your extensions!