Fix type parsing in CodeMirror and highlight them (#5674)

* Add new types and fix capitalization in CodeMirror grammar

* Add syntax highlighting for types
This commit is contained in:
Jonathan Tran
2025-03-07 13:56:29 -05:00
committed by GitHub
parent faae169154
commit f7c192b64b
2 changed files with 2 additions and 1 deletions

View File

@ -29,6 +29,7 @@ export const kclHighlight = styleTags({
'ObjectProperty/PropertyName': t.definition(t.propertyName),
'LabeledArgument/ArgumentLabel': t.definition(t.propertyName),
TagDeclarator: t.tagName,
PrimitiveType: t.typeName,
'( )': t.paren,
'{ }': t.brace,
'[ ]': t.bracket,

View File

@ -77,7 +77,7 @@ ArgumentList { "(" commaSep<LabeledArgument | expression> ")" }
type[@isGroup=Type] {
@specialize[@name=PrimitiveType]<
identifier,
"string" | "number" | "bool" | "sketch" | "sketch_surface" | "solid"
"bool" | "number" | "string" | "tag" | "Sketch" | "SketchSurface" | "Solid" | "Plane"
> |
ArrayType { type !member "[" "]" } |
ObjectType { "{" commaSep<ObjectProperty { PropertyName ":" type }> "}" }