Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
add yaml schema
Browse files Browse the repository at this point in the history
  • Loading branch information
pompurin404 committed Sep 17, 2024
1 parent e9e5299 commit 6a81c1f
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion src/renderer/src/components/base/base-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,53 @@ const monacoInitialization = (): void => {
uri: 'http://example.com/meta-json-schema.json',
fileMatch: ['**/*.clash.yaml'],
// @ts-ignore // type JSONSchema7
schema: metaSchema
schema: {
...metaSchema,
patternProperties: {
'\\+rules': {
type: 'array',
$ref: '#/definitions/rules',
description: '“+”开头表示将内容插入到原数组前面'
},
'rules\\+': {
type: 'array',
$ref: '#/definitions/rules',
description: '“+”结尾表示将内容追加到原数组后面'
},
'\\+proxies': {
type: 'array',
$ref: '#/definitions/proxies',
description: '“+”开头表示将内容插入到原数组前面'
},
'proxies\\+': {
type: 'array',
$ref: '#/definitions/proxies',
description: '“+”结尾表示将内容追加到原数组后面'
},
'\\+proxy-groups': {
type: 'array',
$ref: '#/definitions/proxy-groups',
description: '“+”开头表示将内容插入到原数组前面'
},
'proxy-groups\\+': {
type: 'array',
$ref: '#/definitions/proxy-groups',
description: '“+”结尾表示将内容追加到原数组后面'
},
'^\\+': {
type: 'array',
description: '“+”开头表示将内容插入到原数组前面'
},
'\\+$': {
type: 'array',
description: '“+”结尾表示将内容追加到原数组后面'
},
'!$': {
type: 'object',
description: '“!”结尾表示强制覆盖该项而不进行递归合并'
}
}
}
}
]
})
Expand Down

0 comments on commit 6a81c1f

Please sign in to comment.