MCPcopy Create free account
hub / github.com/SplootCode/splootcode / register

Method register

packages/language-web/types/js/assignment.ts:72–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 }
71
72 static register() {
73 const typeRegistration = new TypeRegistration()
74 typeRegistration.typeName = ASSIGNMENT
75 typeRegistration.deserializer = Assignment.deserializer
76 typeRegistration.properties = []
77 typeRegistration.childSets = {
78 left: NodeCategory.Expression,
79 right: NodeCategory.Expression,
80 }
81 typeRegistration.layout = new NodeLayout(HighlightColorCategory.VARIABLE_DECLARATION, [
82 new LayoutComponent(LayoutComponentType.KEYWORD, 'set'),
83 new LayoutComponent(LayoutComponentType.CHILD_SET_TOKEN_LIST, 'left', ['variable']),
84 new LayoutComponent(LayoutComponentType.KEYWORD, '='),
85 new LayoutComponent(LayoutComponentType.CHILD_SET_ATTACH_RIGHT, 'right', ['value']),
86 ])
87 typeRegistration.pasteAdapters[SPLOOT_EXPRESSION] = (node: SplootNode) => {
88 const exp = new SplootExpression(null)
89 exp.getTokenSet().addChild(node)
90 return exp
91 }
92
93 registerType(typeRegistration)
94 registerNodeCateogry(ASSIGNMENT, NodeCategory.ExpressionToken)
95 registerAutocompleter(NodeCategory.ExpressionToken, new Generator())
96 }
97}

Callers

nothing calls this directly

Calls 5

getTokenSetMethod · 0.95
registerTypeFunction · 0.90
registerNodeCateogryFunction · 0.90
registerAutocompleterFunction · 0.90
addChildMethod · 0.80

Tested by

no test coverage detected