how to get function name or variable name from tree

I want to get the structure of the code, like the function name, the type of args and so on. Is there any ways I can do that?

thanks.

Syntax node content (such as names) is not stored in the tree, but you can use the position of the node to read it from the document. Types of things are only available insofar as they are directly encoded in the syntax—this library does not do type inference or anything like that.