Skip to content

Conversation

@aaron-ang
Copy link
Contributor

@aaron-ang aaron-ang commented Dec 26, 2025

Summary

Previously, pyrefly wasn’t resolving or highlighting imported aliased names. To fix, we push the tokens that are aliased (contains asname) and resolve the imported tokens with name_after_import in IdentifierContext::ImportedName.

Test Plan

New tests cases in:

  • pyrefly/lib/test/lsp/definition.rs
  • pyrefly/lib/test/lsp/hover.rs
  • pyrefly/lib/test/lsp/lsp_interaction/semantic_tokens.rs
  • pyrefly/lib/test/lsp/semantic_tokens.rs

@meta-cla meta-cla bot added the cla signed label Dec 26, 2025
@github-actions
Copy link

Diff from mypy_primer, showing the effect of this PR on open source code:

attrs (https://github.com/python-attrs/attrs)
- ERROR src/attr/_make.py:290:22-31: Expected a type form, got instance of `type[Attribute] | type` [not-a-type]

typeshed-stats (https://github.com/AlexWaygood/typeshed-stats)
- ERROR src/typeshed_stats/gather.py:999:28-1002:10: `Pattern[Unknown] | @7313 | None` is not assignable to upper bound `bytes | str` of type variable `AnyStr` [bad-specialization]
+ ERROR src/typeshed_stats/gather.py:999:28-1002:10: `Pattern[Unknown] | @7515 | None` is not assignable to upper bound `bytes | str` of type variable `AnyStr` [bad-specialization]

@aaron-ang aaron-ang marked this pull request as ready for review December 26, 2025 09:16
@grievejia grievejia self-assigned this Dec 26, 2025
@meta-codesync
Copy link

meta-codesync bot commented Dec 26, 2025

@grievejia has imported this pull request. If you are a Meta employee, you can view this in D89813346.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants