code-editor
<vs.code-editor>
基于 Monaco Editor 的代码编辑器。
Examples
Automatic layout - fit-content
Automatic layout - fit-container
Placeholder
Brick Next YAML
Brick Next YAML with highlight
Show CTX.DS
CEL
Properties
Name | Description | Type | Default | Required |
---|---|---|---|---|
name | string | |||
label | string | |||
value | string | |||
language | string | "plaintext" | ||
theme | 主题,支持 | string | "auto" | |
required | boolean | |||
readOnly | boolean | |||
automaticLayout | "fit-container" | "fit-content" | "none" | |||
minLines | number | 3 | ||
completers | 仅对 language 为 brick_next_yaml 有效,设置第一层属性名的自动补全。 | monaco.languages.CompletionItem[] | ||
advancedCompleters | 高级自动补全配置。
| AdvancedCompleterMap | MixedCompleter[] | ||
markers | Marker[] | |||
links | string[] | |||
maxLines | number | Infinity | ||
height | string | number | |||
message | string | |||
placeholder | string | |||
showExpandButton | 是否展示展开按钮 | boolean | ||
lineNumbers | 行数配置 | monaco.editor.LineNumbersType | ||
tokenConfig | 自定义高亮配置 | TokenConfig | ||
customValidationInBrickNextYaml | 在 brick_next_yaml 中是否开启语义相关校验 | boolean | false | |
showCopyButton | 是否展示复制按钮 | boolean | true | |
glyphMargin | 显示字形边距 | boolean | false | |
extraLibs | ExtraLib[] | |||
fixedOverflowWidgets | boolean |
Events
Name | Description | Event Detail |
---|---|---|
code.change | string | |
user.input | any | |
token.click | string |
Type references
MembersCompleter
Name | Type | Required | Description |
---|---|---|---|
type | "members" | ✅ | |
members | Record<string, string[]> | ✅ | 键为对象名称,值为对象属性名列表 |
Marker
Name | Type | Required | Description |
---|---|---|---|
token | string | ✅ | |
level | keyof typeof Level | ||
message | string | ||
code | { value: string; target: string } | ||
params | string[] |
TokenConfig
Name | Type | Required | Description |
---|---|---|---|
showDSKey | boolean |
ExtraLib
Name | Type | Required | Description |
---|---|---|---|
filePath | string | ✅ | |
content | string | ✅ |
AdvancedCompleterMap
Record<string, { triggerCharacter: string; completers: monaco.languages.CompletionItem[] }>
MixedCompleter
MembersCompleter