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

Method register

packages/language-python/src/nodes/python_set.ts:77–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75 }
76
77 static register() {
78 const typeRegistration = new TypeRegistration()
79 typeRegistration.typeName = PYTHON_SET
80 typeRegistration.deserializer = PythonSet.deserializer
81 typeRegistration.childSets = { arguments: NodeCategory.PythonExpression }
82 typeRegistration.layout = new NodeLayout(HighlightColorCategory.KEYWORD, [
83 new LayoutComponent(LayoutComponentType.KEYWORD, 'set'),
84 new LayoutComponent(LayoutComponentType.CHILD_SET_TREE_BRACKETS, 'elements'),
85 ])
86 typeRegistration.pasteAdapters[PYTHON_EXPRESSION] = (node: SplootNode) => {
87 const exp = new PythonExpression(null)
88 exp.getTokenSet().addChild(node)
89 return exp
90 }
91
92 registerType(typeRegistration)
93 registerNodeCateogry(PYTHON_SET, NodeCategory.PythonExpressionToken)
94 registerAutocompleter(NodeCategory.PythonExpressionToken, new SetLiteralGenerator())
95 }
96}

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