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
Python no longer suggests type aliases from the project
Steps to reproduce:
Create type alias like this (TypeAlias type annotation doesn't matter):
Component: TypeAlias = VdomDict | ReactpyComponent | ContextProviderType | str
Go to some other file in the project and try ctrl + . to try to import it. It is not an option. It is not an option under "search for other import matches". Adding a class to the same file shows up. If you search for the name with ctrl + t it shows up as the first option.
If I enable "enable aliases in user files", it still does not show up.
I created a fresh codespace to rule out some sort of corruption somewhere.
Extension version: 2024.16.1
VS Code version: Code 1.94.2 (384ff7382de624fb94dbaf6da11977bba1ecd427, 2024-10-09T16:08:44.566Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 6.5.0-1025-azure
Python version (& distribution if applicable, e.g. Anaconda): 3.11.10
Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Poetry
Value of the python.languageServer setting: Default
So kind of weird behavior, here's what I've found:
Seems like downgrading to PyLance 2024.9.2 fixes the issue
If I downgrade then upgrade everything the issue doesn't seem apparent on my codebase
Python extension version doesn't seem relevant
Somehow I got it to where, in the process of changing versions and settings, was working using the latest of everything, but from a clean slate the latest version doesn't seem to work properly
Thanks for reporting this, I thought I'd messed something up. If I understand correctly, you say that downgrading to 2024.9.2, restarting the extension, then going back to latest should work, right?
For me it did not, even after VSCode restarts, reboots, nothing. Funny thing is that if I enable "Enable aliases in user files" it offers to import it from other modules where it is itself imported, but not the place where it is defined.
I'll have to stick to 2024.9.2 for the time being, as we rely quite a lot on Type Aliases.
Type: Bug
Behaviour
Python no longer suggests type aliases from the project
Steps to reproduce:
Create type alias like this (TypeAlias type annotation doesn't matter):
Component: TypeAlias = VdomDict | ReactpyComponent | ContextProviderType | str
Go to some other file in the project and try ctrl + . to try to import it. It is not an option. It is not an option under "search for other import matches". Adding a class to the same file shows up. If you search for the name with ctrl + t it shows up as the first option.
If I enable "enable aliases in user files", it still does not show up.
I created a fresh codespace to rule out some sort of corruption somewhere.
Extension version: 2024.16.1
VS Code version: Code 1.94.2 (384ff7382de624fb94dbaf6da11977bba1ecd427, 2024-10-09T16:08:44.566Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 6.5.0-1025-azure
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: