zed icon indicating copy to clipboard operation
zed copied to clipboard

python: fix highlighting of built-in types for isinstance() and issub…

Open csernazs opened this issue 9 months ago • 1 comments

When built-in types such as list is specified in calls like isinstance(), the parameter is highlighted as a type.

The issue is caused by a change which removed list and others in bf9e5b4f761b507310d744553e29ba6fdeb3c89a.

This commit makes two special cases for isinstance and issubclass ensuring tree sitter to highlight the parameters correctly.

Fixes #30331

Release Notes:

  • python: Fixed syntax highlighting for isinstance() and issubclass() calls

csernazs avatar May 16 '25 09:05 csernazs

Looks good, nice work!

probably-neb avatar May 17 '25 10:05 probably-neb