()
| 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 | } |
no test coverage detected