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

Method register

packages/language-web/types/js/literals.ts:156–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154 }
155
156 static register() {
157 const numericLiteral = new TypeRegistration()
158 numericLiteral.typeName = NUMERIC_LITERAL
159 numericLiteral.deserializer = NumericLiteral.deserializer
160 numericLiteral.properties = ['value']
161 numericLiteral.layout = new NodeLayout(HighlightColorCategory.LITERAL_NUMBER, [
162 new LayoutComponent(LayoutComponentType.PROPERTY, 'value'),
163 ])
164 numericLiteral.pasteAdapters[SPLOOT_EXPRESSION] = (node: SplootNode) => {
165 const exp = new SplootExpression(null)
166 exp.getTokenSet().addChild(node)
167 return exp
168 }
169 registerType(numericLiteral)
170 registerNodeCateogry(NUMERIC_LITERAL, NodeCategory.ExpressionToken)
171 registerNodeCateogry(NUMERIC_LITERAL, NodeCategory.PythonExpressionToken)
172 registerNodeCateogry(NUMERIC_LITERAL, NodeCategory.HtmlAttributeValue)
173 registerAutocompleter(NodeCategory.ExpressionToken, new NumberGenerator())
174 registerAutocompleter(NodeCategory.PythonExpressionToken, new NumberGenerator())
175 registerAutocompleter(NodeCategory.HtmlAttributeValue, new NumberGenerator())
176 }
177}
178
179class NullGenerator implements SuggestionGenerator {

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