Skip to content
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

No longer suggesting type alias as import #6567

Closed
JamesHutchison opened this issue Oct 16, 2024 · 1 comment
Closed

No longer suggesting type alias as import #6567

JamesHutchison opened this issue Oct 16, 2024 · 1 comment
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@JamesHutchison
Copy link

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 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
User Settings


languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

experiments
• optOutFrom: ["pythonTestAdapter"]

Installed Extensions
Extension Name Extension Id Version
autoDocstring - Python Docstring Generator njpwerner.autodocstring 0.6.1
autopep8 ms-python.autopep8 2024.0.0
Debugger for Java vscjava.vscode-java-debug 0.58.0
Docker ms-azuretools.vscode-docker 1.29.3
ESLint dbaeumer.vscode-eslint 3.0.10
Even Better TOML tamasfe.even-better-toml 0.19.2
Extension Pack for Java vscjava.vscode-java-pack 0.29.0
Git Graph mhutchie.git-graph 1.30.0
GitHub Copilot GitHub.copilot 1.239.0
GitHub Copilot Chat GitHub.copilot-chat 0.21.2
GitHub Pull Requests GitHub.vscode-pull-request-github 0.98.0
GitHub Theme GitHub.github-vscode-theme 6.3.5
GitLens — Git supercharged eamodio.gitlens 15.6.1
Gradle for Java vscjava.vscode-gradle 3.16.4
IntelliCode VisualStudioExptTeam.vscodeintellicode 1.3.1
IntelliCode API Usage Examples VisualStudioExptTeam.intellicode-api-usage-examples 0.2.8
JavaScript Debugger ms-vscode.js-debug 1.94.0
Language Support for Java(TM) by Red Hat redhat.java 1.35.1
Live Share ms-vsliveshare.vsliveshare 1.0.5941
Maven for Java vscjava.vscode-maven 0.44.0
Mypy matangover.mypy 0.4.0
Project Manager for Java vscjava.vscode-java-dependency 0.24.0
Pylance ms-python.vscode-pylance 2024.10.1
Python ms-python.python 2024.16.1
Python Debugger ms-python.debugpy 2024.12.0
Ruff charliermarsh.ruff 2024.50.0
SQLTools mtxr.sqltools 0.28.3
SQLTools PostgreSQL/Cockroach Driver mtxr.sqltools-driver-pg 0.5.4
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.10
Test Runner for Java vscjava.vscode-java-test 0.42.0
System Info
Item Value
CPUs Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2808)
GPU Status 2d_canvas: enabled
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
Load (avg) undefined
Memory (System) 15.89GB (2.76GB free)
Process Argv --crash-reporter-id ae591a24-d374-4309-8087-11db7f271645
Screen Reader no
VM 0%
Item Value
Remote Codespaces: orange fiesta
OS Linux x64 6.5.0-1025-azure
CPUs AMD EPYC 7763 64-Core Processor (4 x 0)
Memory (System) 15.61GB (12.33GB free)
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
pythongtdpath:30769146
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
accentitlementsc:30995553
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
f3je6385:31013174
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
2f103344:31071589
impr_priority:31102340
nativerepl2:31139839
refactort:31108082
pythonrstrctxt:31112756
wkspc-onlycs-t:31132770
wkspc-ranged-t:31151552
cf971741:31144450
defaultse:31146405
iacca2:31156134
notype1:31157159
showbadge:31153266
5fd0e150:31155592
iconenabled:31158251

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Oct 16, 2024
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Oct 16, 2024
@JamesHutchison
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants