Description:
Right now, getting information like the method name, parameters, statements, or modifier from a FASTTypescriptMethod_definition means searching through the children array and picking out the right element by its class.
Proposal:
We could add direct accessors for the following children:
identifier (the TypescriptProperty_identifier, for the method name)
statements (the TypescriptStatement_block, for the method body)
parameters (the method’s TypescriptProperty_identifier parameters)
modifier (the TypescriptAccessibility_modifier)
Example:
Current way to get the method name:
(method children detect: [:c | c className = 'TypescriptProperty_identifier']) sourceCode.
With the proposed change:
method identifier sourceCode.
Description:
Right now, getting information like the method name, parameters, statements, or modifier from a
FASTTypescriptMethod_definitionmeans searching through thechildrenarray and picking out the right element by its class.Proposal:
We could add direct accessors for the following children:
identifier(theTypescriptProperty_identifier, for the method name)statements(theTypescriptStatement_block, for the method body)parameters(the method’sTypescriptProperty_identifierparameters)modifier(theTypescriptAccessibility_modifier)Example:
Current way to get the method name:
With the proposed change: