Looking for a CLI tool that prints out method/class signatures of various languages #2220
Replies: 3 comments
-
It would indeed be trivial to do, but I don't know if any that do it. It would just be a matter of writing out the correct query & captures for each language. |
Beta Was this translation helpful? Give feedback.
-
Thats what i've thought, si haven't been able to capture the nodes and grab them as a group though. ".rb": { lang: Ruby, members: "(method name: (identifier) @name parameters: ((method_parameters)) @params)" }, Also 'm not sure if this is the right approach because maybe you want to walk the tree if you want to show the hierarchy in classes aswell for those languages that support it User
-> method
-> method
UserInfo
-> method
-> method |
Beta Was this translation helpful? Give feedback.
-
I also need such tool for future automation actions in Tree-sitter's main repo. @emilebosch here https://github.com/ahlinc/code-shape you can find an example of such tool that you can use as an example and a base for implementing your needs. |
Beta Was this translation helpful? Give feedback.
-
I'm looking for a a treesitter CLI tool that allows me to quickly get the method definitions of various languages. I.e only the outline of the class or functions. But then for various languages:
Does something like that exist? I think it should be quite trivial to do right?
$inspect bla.rb/.ts/.py
Beta Was this translation helpful? Give feedback.
All reactions