Add support for showing all overload signatures#665
Add support for showing all overload signatures#665daemontus wants to merge 6 commits intomitmproxy:mainfrom
overload signatures#665Conversation
|
Ok, never mind... this still does not work with stub files when the stub file only contains the Edit: I'll just make a note for myself that I need to look at Edit2: The |
|
(Happy to look at this once you mark it as ready) |
|
Thanks! Unfortunately, I'll have to come back to this a bit later... the current implementation works as long as both the "base" method and its overloads are all declared in the stub file. But that is not the recommended way of doing things (e.g. The issue is that once the overloads are in the stub file without the base method, they don't seem to be accessible through the built-in |
This PR should solve #442 by displaying each
overloadtype signature as a separate indented block after the "main" method signature.So far, this works fine on my own project (which uses
PyO3, so I am also testing it with overloads in stub files). But I am relatively new topdoc, so I am not sure what level of testing is expected for this to be merged. Would it be sufficient to add an overloaded method totests/testdata/misc_py311.pyto see how it renders, or is there something more detailed that needs to be done?Edit: I see that it is required to have 100% test coverage on the latest Python version. However, this feature is only available from Python 3.11 onward. So I've added a little compatibility shim which just returns an empty value on older Python versions (not ideal, but probably the best option). But this shim is not triggered on the newer Python versions, hence there is no way to get 100% coverage, even if I fix the other uncovered lines.