Skip to content

[ty] Fix missing syntax highlighting for aliased import names#22675

Merged
MichaReiser merged 1 commit intomainfrom
claude/fix-issue-2547-FX1de
Jan 18, 2026
Merged

[ty] Fix missing syntax highlighting for aliased import names#22675
MichaReiser merged 1 commit intomainfrom
claude/fix-issue-2547-FX1de

Conversation

@MichaReiser
Copy link
Member

Summary

When using from X import Y as Z, only the alias (Z) was receiving syntax highlighting, while the original import name (Y) was not being highlighted at all. This fix ensures both the imported name and its alias receive consistent syntax highlighting with the same token type.

Fixes: astral-sh/ty#2547

Test Plan

Added test

@MichaReiser MichaReiser added server Related to the LSP server ty Multi-file analysis & type inference bug Something isn't working labels Jan 18, 2026
@MichaReiser MichaReiser force-pushed the claude/fix-issue-2547-FX1de branch from 3ba3a54 to 0f98f33 Compare January 18, 2026 11:49
When using `from X import Y as Z`, only the alias (Z) was receiving
syntax highlighting, while the original import name (Y) was not being
highlighted at all. This fix ensures both the imported name and its
alias receive consistent syntax highlighting with the same token type.

Fixes: astral-sh/ty#2547
@MichaReiser MichaReiser force-pushed the claude/fix-issue-2547-FX1de branch from 0f98f33 to 44bc103 Compare January 18, 2026 12:04
@MichaReiser MichaReiser merged commit bbe295a into main Jan 18, 2026
45 checks passed
@MichaReiser MichaReiser deleted the claude/fix-issue-2547-FX1de branch January 18, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working server Related to the LSP server ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

name not colored in "from module import name as alias"

3 participants