Skip to content

fix inconsistent syntax highlighting for field of type inspect._ParameterKind #4751 - #4794

Open
asukaminato0721 wants to merge 2 commits into
facebook:mainfrom
asukaminato0721:4751
Open

asukaminato0721 wants to merge 2 commits into
facebook:mainfrom
asukaminato0721:4751

Conversation

@asukaminato0721

Copy link
Copy Markdown
Collaborator

Summary

Fixes #4751

fixes incorrect semantic highlighting for narrowed enum instance attributes.

Previously, holder.kind could be classified as an enumMember after narrowing.

Now instance attributes such as holder.kind remain property, actual enum members accessed through the enum class, such as E.A, remain enumMember.

Test Plan

add test

@meta-cla meta-cla Bot added the cla signed label Sep 3, 2026
@github-actions github-actions Bot added the size/m label Sep 3, 2026
@meta-codesync

meta-codesync Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D118576862. (Because this pull request was imported automatically, there will not be any future comments.)

@github-actions

This comment has been minimized.

@kinto0 kinto0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't love this special-case. until now, all attributes could be colored based on only their type. is this the only exception? Is it true that accessed_on_class + being an enum are the only qualifiers?

Comment thread pyrefly/lib/state/semantic_tokens.rs Outdated
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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.

inconsistent syntax highlighting for field of type inspect._ParameterKind

2 participants