Skip to content

[ty] Exclude decorators from class/def code folding#23543

Merged
BurntSushi merged 6 commits intoastral-sh:mainfrom
iksuddle:improve-decorator-folding
Mar 3, 2026
Merged

[ty] Exclude decorators from class/def code folding#23543
BurntSushi merged 6 commits intoastral-sh:mainfrom
iksuddle:improve-decorator-folding

Conversation

@iksuddle
Copy link
Contributor

@iksuddle iksuddle commented Feb 24, 2026

Summary

This change removes decorators from the folding ranges of classes/functions.

Resolves astral-sh/ty#2861

Test Plan

Added snapshot tests to check the returned folding ranges.

@ntBre ntBre added server Related to the LSP server ty Multi-file analysis & type inference labels Feb 24, 2026
@iksuddle iksuddle marked this pull request as ready for review February 26, 2026 06:10
@sharkdp sharkdp removed their request for review February 26, 2026 07:52
@AlexWaygood AlexWaygood removed their request for review February 26, 2026 09:40
@carljm carljm removed their request for review February 26, 2026 17:52
@dhruvmanila dhruvmanila requested a review from BurntSushi March 2, 2026 09:33
@dhruvmanila
Copy link
Member

This looks good, thank you! I'm going to let @BurntSushi take a final look and give the 👍

Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@BurntSushi BurntSushi merged commit 72742e7 into astral-sh:main Mar 3, 2026
47 checks passed
@BurntSushi BurntSushi changed the title [ty] Improve folding for decorators [ty] Exclude decorators from class/def code folding Mar 3, 2026
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.

Improve code folding for decorators

4 participants