Skip to content

Fix inference autocomplete #498

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

Merged
merged 2 commits into from
May 21, 2025
Merged

Fix inference autocomplete #498

merged 2 commits into from
May 21, 2025

Conversation

jhamon
Copy link
Collaborator

@jhamon jhamon commented May 21, 2025

Problem

While implementing lazy loading and a package level .pyi file, we accidentally broke intellisense for some classes.

Solution

  • Add missing exceptions to pyi
  • Remove type annotations on pc.inference that rely on values imported during TYPE_CHECKING. It seems like mypy and intellisense/autocomplete are able to infer these types without them being labeled explicitly. I think there is some sort of bug in the way autocomplete works because these type hints used with TYPE_CHECKING are valid and seem to work for typechecking purposes.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Test Plan

Made a 7.0.1.dev1 dev build to confirm autocomplete behavior in different environments

@jhamon jhamon force-pushed the jhamon/fix-inference-autocomplete branch from c726031 to 2866903 Compare May 21, 2025 14:44
@jhamon jhamon force-pushed the jhamon/fix-inference-autocomplete branch from 2866903 to 0cfdee3 Compare May 21, 2025 14:47
@jhamon jhamon requested a review from ssmith-pc May 21, 2025 14:50
@jhamon jhamon marked this pull request as ready for review May 21, 2025 15:09
Copy link
Contributor

@ssmith-pc ssmith-pc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works now!

@jhamon jhamon merged commit 11f0a7f into main May 21, 2025
75 checks passed
@jhamon jhamon deleted the jhamon/fix-inference-autocomplete branch May 21, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants