-
Notifications
You must be signed in to change notification settings - Fork 771
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
Pylance should be able to recognize docstrings for type aliases #1815
Comments
Interesting; this should have worked as we explicitly intend to support these types of docstrings (see #1576). This may be something specific to aliases. |
We do support variable doc strings, but type aliases are distinct from other types of variables. It should be feasible to extend the support for type aliases. |
Yep, it's a small change (I'm making it now). |
In this case, it's hitting the fact that it's an instantiable type before it hits the code that checks if it's a variable. |
This will be fixed in the next release. |
That's great, thanks! |
This issue has been fixed in version 2021.9.2, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202192-16-september-2021 |
I can't seem to get VSCode to recognize docstrings for type aliases that I define. Say I have the following type alias and docstring:
For an example of how I'd like it to work, Pycharm shows the following when I hover over SomeType:
In VSCode I only seem to see documentation related to the underlying types instead of the documentation I provided for the alias:
In an ideal world, I'd be able to see both the underlying type documentation and the documentation that I added for the alias myself, but honestly I'd settle for at least always showing the documentation that I specified in the project itself.
Can this be added? This felt like something that should be implemented in Pylance, but I wasn't 100% sure - please feel free to move it to whatever project makes the most sense!
The text was updated successfully, but these errors were encountered: