跳到主要内容

code-editor

<vs.code-editor>

基于 Monaco Editor 的代码编辑器。

Playground

Examples

Automatic layout - fit-content

Playground

Automatic layout - fit-container

Playground

Placeholder

Playground

Brick Next YAML

Playground

Brick Next YAML with highlight

Playground

Show CTX.DS

Playground

CEL

Playground

Properties

NameDescriptionTypeDefaultRequired
namestring
labelstring
valuestring
languagestring "plaintext"
theme

主题,支持 "auto" | "vs" | "vs-dark"

string "auto"
requiredboolean
readOnlyboolean
automaticLayout"fit-container" | "fit-content" | "none"
minLinesnumber 3
completers

仅对 language 为 brick_next_yaml 有效,设置第一层属性名的自动补全。

monaco.languages.CompletionItem[]
advancedCompleters

高级自动补全配置。

  • 设置为键值对时,仅对 language 为 brick_next_yaml 有效,设置任意的自动补全;
  • 设置为数组时,当前仅对 language 为 cel 有效。 未来将统一改为数组格式,废弃键值对格式的配置。
AdvancedCompleterMap | MixedCompleter[]
markersMarker[]
linksstring[]
maxLinesnumber Infinity
heightstring | number
messagestring
placeholderstring
showExpandButton

是否展示展开按钮

boolean
lineNumbers

行数配置

monaco.editor.LineNumbersType
tokenConfig

自定义高亮配置

TokenConfig
customValidationInBrickNextYaml

在 brick_next_yaml 中是否开启语义相关校验

boolean false
showCopyButton

是否展示复制按钮

boolean true
glyphMargin

显示字形边距

boolean false
extraLibsExtraLib[]
fixedOverflowWidgetsboolean

Events

NameDescriptionEvent Detail
code.changestring
user.inputany
token.clickstring

Type references

MembersCompleter

NameTypeRequiredDescription
type"members"
membersRecord<string, string[]>

键为对象名称,值为对象属性名列表

Marker

NameTypeRequiredDescription
tokenstring
levelkeyof typeof Level
messagestring
code{ value: string; target: string }
paramsstring[]

TokenConfig

NameTypeRequiredDescription
showDSKeyboolean

ExtraLib

NameTypeRequiredDescription
filePathstring
contentstring

AdvancedCompleterMap

Record<string, { triggerCharacter: string; completers: monaco.languages.CompletionItem[] }>

MixedCompleter

MembersCompleter