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

Method register

packages/language-web/types/js/if.ts:101–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99 }
100
101 static register() {
102 const ifType = new TypeRegistration()
103 ifType.typeName = IF_STATEMENT
104 ifType.deserializer = IfStatement.deserializer
105 ifType.childSets = {
106 condition: NodeCategory.Expression,
107 trueblock: NodeCategory.Statement,
108 // 'elseblock': NodeCategory.Statement
109 }
110 ifType.layout = new NodeLayout(HighlightColorCategory.CONTROL, [
111 new LayoutComponent(LayoutComponentType.KEYWORD, 'if'),
112 new LayoutComponent(LayoutComponentType.CHILD_SET_ATTACH_RIGHT, 'condition'),
113 new LayoutComponent(LayoutComponentType.CHILD_SET_BLOCK, 'trueblock'),
114 ])
115 ifType.pasteAdapters[HTML_SCRIPT_ElEMENT] = (node: SplootNode) => {
116 const scriptEl = new SplootHtmlScriptElement(null)
117 scriptEl.getContent().addChild(node)
118 return scriptEl
119 }
120
121 registerType(ifType)
122 registerNodeCateogry(IF_STATEMENT, NodeCategory.Statement)
123 registerAutocompleter(NodeCategory.Statement, new Generator())
124 }
125}

Callers 2

index.tsFile · 0.45
loadTypesFunction · 0.45

Calls 5

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

Tested by

no test coverage detected