About the structure of json file
json
{
"root": [],
"options": [],
"common_options": [],
"info": {},
"config": []
}
- The json file uses a schema structure to ensure that the json content is correct and complete.
- You can learn about these properties by hovering over the prompts in vscode.
- In fact, it is very simple, you can refer to the existing json file.
Properties
1. root
- The type of value: array
- Each item in the array is an object.
- Object available attribute:
name
(required)、alias
、next
、options
、tip
、hide
2. options
- The type of value: array
- Same as the
options
for each item inroot
.json{ "options": [ { "name": "--version", "alias": ["-V"], "tip": ["Show current version"] } ] }
3. common_options
- The type of value: array
- Same structure as
options
- All options are displayed at all times.json
{ "common_options": [ { "name": "--help", "alias": ["-h"], "tip": ["Show help."] } ] }
4. info
- The type of value: object
- All the defined values can be used in other
tip
using the following syntaxjson{ "root": [ { "name": "test", "tip": "{{ $info.test_tip }}" } ], "info": { "test_tip": "这是一个测试内容" } }
5. config
- The type of value: array
- Define some special configurations for completion.
- e.g.
git
json"config": [ { "name": "max_commit", "value": 20, "values": [ -1, 20 ], "tip": [ "The maximum number that can be parsed for a project commit. Default to 20.\n", "If it is <@Magenta>-1<@Blue>, all commits will be parsed, which may affect the loading speed." ] } ]