How do I configure VS Code to enable code completion on .json files (jsonschema support)?

前端 未结 3 1993
梦毁少年i
梦毁少年i 2021-02-12 15:20

In the Visual Stuido Code demo minute 28:57-29:20 and 30:20-31:10, some cool JSON code completion is shown.

Where and how do I add a schema for my JSON files to a projec

3条回答
  •  误落风尘
    2021-02-12 15:38

    You can refer your JSON Schema in $schema node and get your intellisense in VS Code right away. No need to configure anywhere else.

    For example,

    { "$schema": "http://json.schemastore.org/coffeelint", "line_endings": "unix" }

    This is the intellisense I was talking about. JSON Schema has the list of possible JSON properties in your current cursor position and VS Code can pull out that list of intellisense.

    Note that, every official JSON should have a concrete JSON Schema to prove the data integrity. This answer is still valid!

提交回复
热议问题