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:
@ -29,6 +29,7 @@ export const kclHighlight = styleTags({
|
|||||||
'ObjectProperty/PropertyName': t.definition(t.propertyName),
|
'ObjectProperty/PropertyName': t.definition(t.propertyName),
|
||||||
'LabeledArgument/ArgumentLabel': t.definition(t.propertyName),
|
'LabeledArgument/ArgumentLabel': t.definition(t.propertyName),
|
||||||
TagDeclarator: t.tagName,
|
TagDeclarator: t.tagName,
|
||||||
|
PrimitiveType: t.typeName,
|
||||||
'( )': t.paren,
|
'( )': t.paren,
|
||||||
'{ }': t.brace,
|
'{ }': t.brace,
|
||||||
'[ ]': t.bracket,
|
'[ ]': t.bracket,
|
||||||
|
@ -77,7 +77,7 @@ ArgumentList { "(" commaSep<LabeledArgument | expression> ")" }
|
|||||||
type[@isGroup=Type] {
|
type[@isGroup=Type] {
|
||||||
@specialize[@name=PrimitiveType]<
|
@specialize[@name=PrimitiveType]<
|
||||||
identifier,
|
identifier,
|
||||||
"string" | "number" | "bool" | "sketch" | "sketch_surface" | "solid"
|
"bool" | "number" | "string" | "tag" | "Sketch" | "SketchSurface" | "Solid" | "Plane"
|
||||||
> |
|
> |
|
||||||
ArrayType { type !member "[" "]" } |
|
ArrayType { type !member "[" "]" } |
|
||||||
ObjectType { "{" commaSep<ObjectProperty { PropertyName ":" type }> "}" }
|
ObjectType { "{" commaSep<ObjectProperty { PropertyName ":" type }> "}" }
|
||||||
|
Reference in New Issue
Block a user