Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ty] Highlight decorated methods consistently#26003

Merged
MichaReiser merged 1 commit into
mainfrom
micha/decorated-method-semantic-tokens
Jun 15, 2026
Merged

[ty] Highlight decorated methods consistently#26003
MichaReiser merged 1 commit into
mainfrom
micha/decorated-method-semantic-tokens

Conversation

@MichaReiser

Copy link
Copy Markdown
Member

Summary

Highlight function-like callable attributes as methods while leaving regular callable attributes unchanged.

Fixes astral-sh/ty#3771.

Test plan

Added integration test

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Jun 15, 2026
@MichaReiser MichaReiser added the server Related to the LSP server label Jun 15, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 94.36%. The percentage of expected errors that received a diagnostic held steady at 88.91%. The number of fully passing files held steady at 93/134.

@astral-sh-bot

astral-sh-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

Comment on lines +2151 to +2153
@classmethod
@decorate
def class_method(cls) -> None: ...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you could possibly also add tests with these in the other order too, e.g.

    @decorate
    @classmethod
    def class_method(cls) -> None: ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It seems that we already test this add the ty_python_semantic level

@MichaReiser MichaReiser merged commit 5d2f1f7 into main Jun 15, 2026
59 checks passed
@MichaReiser MichaReiser deleted the micha/decorated-method-semantic-tokens branch June 15, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Consistent semantic highlighting of call expressions

3 participants