Skip to content

[ty] Improve rendering of ReST directives in docstrings#22512

Merged
AlexWaygood merged 2 commits intoastral-sh:mainfrom
AryanBagade:feat/improve-rest-directive-rendering
Jan 14, 2026
Merged

[ty] Improve rendering of ReST directives in docstrings#22512
AlexWaygood merged 2 commits intoastral-sh:mainfrom
AryanBagade:feat/improve-rest-directive-rendering

Conversation

@AryanBagade
Copy link
Contributor

Summary

Improves the rendering of ReST version directives in docstrings to use human-readable phrases matching Sphinx/Pylance output.
Before:

  • **version-added:** *3.0*
  • **version-changed:** *4.0*
  • **deprecated:** *1.2.3*

After:

  • **Added in version 3.0:**
  • **Changed in version 4.0:**
  • **Deprecated since version 1.2.3:**

Mapping follows Sphinx's documentation:

  • versionadded / version-added → "Added in version"
  • versionchanged / version-changed → "Changed in version"
  • deprecated / version-deprecated → "Deprecated since version"
  • versionremoved / version-removed → "Removed in version"

Fixes astral-sh/ty#2147

Test Plan

  • Updated existing snapshot tests (version_blocks, deprecated_prefix_gunk)
  • All 1078 ty_ide tests pass
  • cargo clippy passes with no warnings

@AlexWaygood AlexWaygood added server Related to the LSP server ty Multi-file analysis & type inference labels Jan 12, 2026
@AlexWaygood AlexWaygood removed their request for review January 12, 2026 08:24
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thank you!!

@AlexWaygood AlexWaygood enabled auto-merge (squash) January 14, 2026 12:26
@AlexWaygood AlexWaygood merged commit 853bb00 into astral-sh:main Jan 14, 2026
40 checks passed
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 rendering of ReST directives in docstrings

3 participants