Description:
I'm currently working on the project to create a list of Ballerina Syntax API calls for given source code and I noticed that there currently isn't a way to generate a SeparatedNodeList from the NodeFactory API. Since the constructors are not public, directly creating the required object is also not possible. Is there any alternative way to create the object?
Steps to reproduce:
Following code results in a FUNCTION_SIGNATURE node with empty SeperatedNodeList as parameters.
So, there is no way to recreate the syntax tree.
public function main() { }
This is currently fixed in the formatter-change branch with https://github.com/ballerina-platform/ballerina-lang/commit/cff77fcdc33aec3e7b2724d8ae6b939bf3fb47e0. Would be fixed in the master once that branch is merged to master.
Hello, even though it is exposed via the fix, the current return type is NodeList<T> while the required type for the above-mentioned example is SeparatedNodeList<T>.
So, to use that, we would still have to explicitly cast it.
Why not change the return type of the method call to SeparatedNodeList?
Or will the function signature node accepting parameter types change as well?
Can you send a PR? :)
I've submitted a PR :)