-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: "$TYPE" format keyword #23
Comments
I agree something like this would be useful, the problem it is very difficult to do correctly. Even now the code to parse out function names and parameters only works "well enough" most of the time. You can quickly get into cases of: def async_query(on_success: Callable[[int], None], on_error: Callable[[int, Exception], None]) -> None: Which I haven't tried but probably fails to correctly pull out the two parameters currently. To do it correctly would either involve complex regexes, string manipulation, and corner cases...or else something like a PEG which probably involves more time than I am willing to put into it. But someone else is very welcome to try to tackle this. |
|
@WinterSilence Yes that adds yet another level of complexity which makes this feature that much more difficult to do correctly. |
@dail8859 what's problem? explode params by
|
By all means please create a regex the properly parses out all the different parts of a function/method definition and I'll gladly incorporate it. My suspicion is it is easy to handle the simple cases but only using a regex alone wont be sufficient to handle complex cases. |
@dail8859 |
I'm not sure what you mean by this. |
|
It would be nice if you add support for the "$TYPE" format keyword.
For "C", "C++", "Java" and "C#", types are part of the language and can be extracted following rules of each language.
For "Python" and "PHP" types should be extracted following respective types hints:
For "JavaScript" : /* no comment */
The text was updated successfully, but these errors were encountered: