-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
659 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,318 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"description": "The JSON Schema of the the PSCompletions module completion data file.", | ||
"type": "object", | ||
"required": [ | ||
"info" | ||
], | ||
"anyOf": [ | ||
{ | ||
"required": [ | ||
"root" | ||
] | ||
}, | ||
{ | ||
"required": [ | ||
"options" | ||
] | ||
}, | ||
{ | ||
"required": [ | ||
"common_options" | ||
] | ||
} | ||
], | ||
"definitions": { | ||
"completion_tip": { | ||
"$ref": "#/definitions/array_items", | ||
"description": "A description of the configuration item.\nMust contain one of the following Chinese symbols.\n。?!;", | ||
"contains": { | ||
"type": "string", | ||
"pattern": ".*[。?!;].*" | ||
} | ||
}, | ||
"string": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"array": { | ||
"type": "array", | ||
"minItems": 1, | ||
"uniqueItems": true | ||
}, | ||
"array_items": { | ||
"$ref": "#/definitions/array", | ||
"items": { | ||
"type": "string", | ||
"minLength": 1 | ||
} | ||
}, | ||
"root_item": { | ||
"type": "object", | ||
"required": [ | ||
"name" | ||
], | ||
"properties": { | ||
"name": { | ||
"$ref": "#/definitions/string", | ||
"description": "command name" | ||
}, | ||
"alias": { | ||
"$ref": "#/definitions/array_items", | ||
"description": "command alias" | ||
}, | ||
"symbol": { | ||
"description": "Symbol", | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/array", | ||
"description": "It must be an array.", | ||
"enum": [ | ||
[] | ||
] | ||
}, | ||
{ | ||
"$ref": "#/definitions/array", | ||
"description": "When using hooks to dynamically generate some completions, you need to specify SpaceTab.", | ||
"enum": [ | ||
[ | ||
"SpaceTab" | ||
] | ||
] | ||
}, | ||
{ | ||
"$ref": "#/definitions/array", | ||
"description": "You can also use PowerShell syntax, which requires {{ }} wraps.", | ||
"enum": [ | ||
[ | ||
"{{", | ||
"if($true){ 'SpaceTab' }", | ||
"}}" | ||
] | ||
] | ||
}, | ||
{ | ||
"$ref": "#/definitions/array", | ||
"items": { | ||
"$ref": "#/definitions/string", | ||
"oneOf": [ | ||
{ | ||
"description": "Specify SpaceTab", | ||
"enum": [ | ||
"SpaceTab" | ||
] | ||
}, | ||
{} | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"tip": { | ||
"$ref": "#/definitions/completion_tip" | ||
}, | ||
"next": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"description": "Next command completion, it's used to define the completion that can be obtained after entering the command by pressing the Tab key", | ||
"items": { | ||
"$ref": "#/definitions/root_item" | ||
} | ||
}, | ||
"options": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"description": "Available option completion", | ||
"items": { | ||
"$ref": "#/definitions/options_item" | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"options_item": { | ||
"type": "object", | ||
"required": [ | ||
"name" | ||
], | ||
"properties": { | ||
"name": { | ||
"$ref": "#/definitions/string", | ||
"description": "command name" | ||
}, | ||
"alias": { | ||
"$ref": "#/definitions/array_items", | ||
"description": "command alias" | ||
}, | ||
"symbol": { | ||
"description": "Symbol.(OptionTab is added by default)", | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/array", | ||
"description": "It must be an array.", | ||
"enum": [ | ||
[] | ||
] | ||
}, | ||
{ | ||
"$ref": "#/definitions/array", | ||
"description": "Specify Symbol", | ||
"enum": [ | ||
[ | ||
"WriteSpaceTab" | ||
], | ||
[ | ||
"SpaceTab" | ||
] | ||
] | ||
}, | ||
{ | ||
"$ref": "#/definitions/array", | ||
"description": "You can also use PowerShell syntax, which requires {{ }} wraps.", | ||
"enum": [ | ||
[ | ||
"{{", | ||
"if($true){'WriteSpaceTab'}", | ||
"}}" | ||
] | ||
] | ||
}, | ||
{ | ||
"$ref": "#/definitions/array", | ||
"items": { | ||
"$ref": "#/definitions/string", | ||
"anyOf": [ | ||
{ | ||
"description": "Specify WriteSpaceTab", | ||
"enum": [ | ||
"WriteSpaceTab" | ||
] | ||
}, | ||
{ | ||
"description": "Specify SpaceTab", | ||
"enum": [ | ||
"SpaceTab" | ||
] | ||
}, | ||
{} | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"tip": { | ||
"$ref": "#/definitions/completion_tip" | ||
}, | ||
"next": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"description": "Next command completion, it's used to define the completion that can be obtained after entering the command by pressing the Tab key.\nIf next is added, WriteSpaceTab is automatically added to the symbol of the current.", | ||
"items": { | ||
"$ref": "#/definitions/root_item" | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"properties": { | ||
"root": { | ||
"$ref": "#/definitions/array", | ||
"description": "The root node of the command", | ||
"items": { | ||
"$ref": "#/definitions/root_item" | ||
} | ||
}, | ||
"options": { | ||
"$ref": "#/definitions/array", | ||
"description": "Optional Completion\nfor the root command", | ||
"items": { | ||
"$ref": "#/definitions/options_item" | ||
} | ||
}, | ||
"common_options": { | ||
"$ref": "#/definitions/array", | ||
"description": "General Optional Completion\nSome general options, these options will appear in any situation", | ||
"items": { | ||
"$ref": "#/definitions/options_item" | ||
} | ||
}, | ||
"info": { | ||
"description": "Some completion information, which can be accessed using {{ $info.xxx }} in any place in this json file", | ||
"type": "object", | ||
"minProperties": 1, | ||
"required": [ | ||
"completion_info" | ||
], | ||
"properties": { | ||
"completion_info": { | ||
"type": "object", | ||
"description": "Some information about completion.", | ||
"required": [ | ||
"url", | ||
"description" | ||
], | ||
"properties": { | ||
"url": { | ||
"$ref": "#/definitions/string", | ||
"description": "The homepage of the command." | ||
}, | ||
"description": { | ||
"$ref": "#/definitions/array_items", | ||
"description": "The description of the command." | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
} | ||
}, | ||
"config": { | ||
"description": "Some special configuration items are defined here.", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"required": [ | ||
"name", | ||
"value", | ||
"tip" | ||
], | ||
"properties": { | ||
"name": { | ||
"$ref": "#/definitions/string", | ||
"description": "A name for the configuration item" | ||
}, | ||
"value": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/definitions/string" | ||
}, | ||
{ | ||
"type": "number" | ||
} | ||
], | ||
"description": "A default value for the configuration item" | ||
}, | ||
"values": { | ||
"$ref": "#/definitions/array", | ||
"items": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/definitions/string" | ||
}, | ||
{ | ||
"type": "number" | ||
} | ||
] | ||
}, | ||
"description": "A list of possible values that will be displayed in the completion of the completion command" | ||
}, | ||
"tip": { | ||
"$ref": "#/definitions/array_items", | ||
"description": "A description of the configuration item" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.