-
Notifications
You must be signed in to change notification settings - Fork 769
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
Intellisense is messed up. Function information and type checking is useless for matplotlib (and other modules like numpy) #844
Comments
You're unfortunately hitting quite a mix of different issues. The stubs we have for matplotlib are a little outdated and need to be updated (I wrote them many months ago), and numpy doesn't yet have type information either (#150). It's also the case that the docstring is missing entirely due to some source mapping issue; matplotlib creates its docstrings at runtime by copying Is it the case that all of your screenshots that are not Pylance are from jedi? Or is some of this MPLS? |
To be honest: I'm not sure. I think they all come from MPLS. Edit: I think it was Jedi. For MPLS I get formated docstrings and I get complete information less often than with Jedi. I wonder why you decided to use these stub files. Couldn't it be possible to have stub files extend the information given in the source code rather than replace it?
But if I navigate to the source files (via Ctrl+Click), the information is presented to me. I still don't know if I'm just using Pylance the wrong way or if it's just not the language server that's good for me at the moment. I appreciate the work you put into Pylance, but it just seems to not fit my usecase. That is getting information about the functions/methods/classes/modules... I want to use, so I don't have to memorize those or look it up in their documentation. |
@NicoJG I can totally relate to this. |
Also of note here is that, similarly to the dynamic docstring case, any native extension module docstrings won't be shown as pylance doesn't import modules to extract information from them, under a false assumption IMHO that the docstring will be available in the type stubs, which they very rarely, or even never, are. |
we now go to source by default if we can. (there are cases we can't such as no source files, or source is compiled module) but also provide option to go to stubs if user wants to. |
things like
will need have discussion since all these will be expensive for perf and implementation. but, we might be able to support default value in signature like how we do doc string. |
We've made some improvements in this area. Closing issue. If you would like to see more done here, please reopen. |
Environment data
Problem / Questions
Somehow using Pylance made my Intellisense way worse (compared to Jedi or Microsoft language servers):
Before switching to Pylance I got useful information about functions, classes, etc. (default values for parameters and the docstring)
Now I only get cryptic information and no docstrings.
Type checking worked sometimes and I could actually see which methods are in a class. (see Axes)
Now I get no list of the methods, because in most stub files no information is given. Only ...
I could Ctrl+Click on a function,module,class,... and got redirected to the source code. (very helpful)
Now I only get redirected to these stub files with no useful information in it.
Is it possible to use Pylance but use only the source code of modules? It seems to me that those stub files are far from being complete and are the cause of those problems. (I wonder why stub files are nessecary if a good docstring is provided and typing information is implemented)
I like some Pylance features like the syntax highlighting, but Pylance really messes with my intellisense.
Edit:
I've tried figuring more out about this issue by reading somewhat related issues, but I still don't understand why this happens and what I can do to have a better experience using pylance.
I can't figure out what stubs are and why they are being used as default if they are totally incomplete.
Why aren't stubs being used complementary to the source code? I guess they are useful to give additional type hinting information, but then the rest of the information is lost or has to be added manually?
Why is Jedi and Pythlon Language Server getting it right but pylance isn't?
I think an entry in the documentation that talks about stubs, the differences to jedi and pls might be helpful.
I primarily use the autocomplete and viewing definitions feature of the Python extension and for this Pylance seems not fitted at the moment. I can't understand why Pylance is recommended in VSCode if it's worse than Jedi and pls in this regards.
Before and after comparisons of a few examples
Before: Clean definition with default values presented and the documentation string being shown. After: less readable definition without default values and not documentation string.
Even for numpy the information displayed before was much more readable than afterwards. (And sometimes more complete)
Before: List of methods and variables inside of a class. (instances of these classes are recognized) After: only standard methods of the object class are shown.
Ctrl+Click : Before: redirected to the actual definition in the souce code. After: redirected to incomplete stub files.
The text was updated successfully, but these errors were encountered: