You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
method parse should be annoted to return TranslationUnit
property cursor should be annotated to return Cursor class
I just gave 2 examples but there are many more instances where return type annotations would be helpful (especially while prototyping the code because without those PyCharm autocomplete is not working properly)
The text was updated successfully, but these errors were encountered:
I hope the maintainer of the project won't be offended by a bit of self-promotion.
The fact is that type hints are missing in many places, but even if they were, it won't improve your quality of life. I was going through it.
Why? It's good that you ask. This is due to the structure of the clang parser, which in 99% of cases returns two very generic types of cursors that you have to recognize each time by the kind field.
I don't know what code you need, but you can take a look at my devan project. I rely on libclang (at the type level) wrapping all those ugly cursor kind in nice type information plus throw in some clang filler with a bit of regex magic.
I'm trying to create a kind of source code Amalgamation that will consist of functions and declarations of global variables. The output of the tool must be self-contained, so the type definitions must also be resolved and sorted in the correct order. For this I use a topological sort algorithm. You can check out my repository if you're interested. I must confess that working on this project turned out to be more difficult than I initially imagined.
But I'm getting off topic. Just wanted to suggest an improvement to an already great package. Of course, it's up to the repository maintainer if he/she cares about such minor nuances.
method
parse
should be annoted to returnTranslationUnit
property
cursor
should be annotated to returnCursor
classI just gave 2 examples but there are many more instances where return type annotations would be helpful (especially while prototyping the code because without those PyCharm autocomplete is not working properly)
The text was updated successfully, but these errors were encountered: