Skip to content

Comments

Add ty.inlayHints.variableTypes setting#112

Merged
dhruvmanila merged 2 commits intomainfrom
dhruv/inlay-hints-variable-types
Aug 7, 2025
Merged

Add ty.inlayHints.variableTypes setting#112
dhruvmanila merged 2 commits intomainfrom
dhruv/inlay-hints-variable-types

Conversation

@dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented Aug 7, 2025

Summary

This PR adds the ty.inlayHints.variableTypes as added in the server in astral-sh/ruff#19780.

Test Plan

Screen.Recording.2025-08-07.at.18.36.18.mov

@dhruvmanila dhruvmanila added the configuration Related to settings and configuration label Aug 7, 2025
@dhruvmanila
Copy link
Member Author

Note that the default value is false which changes the default behavior as before all hints were visible.

package.json Outdated
"type": "string"
},
"ty.inlayHints.variableTypes": {
"default": false,
Copy link
Member

Choose a reason for hiding this comment

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

Can you tell me more about the reason for defaulting to false?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't have a strong reason except for the fact that it's disabled by default in the Python extension as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to change the default back to true to avoid any breakage, we can decide later if it should be off by default or not.

dhruvmanila added a commit to astral-sh/ruff that referenced this pull request Aug 7, 2025
## Summary

This PR adds a new `ty.inlayHints.variableTypes` server setting to
configure ty to include / exclude inlay hints at variable position.

Currently, we only support inlay hints at this position so this option
basically translates to enabling / disabling inlay hints for now :)

The VS Code extension PR is
astral-sh/ty-vscode#112.

closes: astral-sh/ty#472

## Test Plan

Add E2E tests.
@dhruvmanila dhruvmanila merged commit 38d25d5 into main Aug 7, 2025
1 check passed
@dhruvmanila dhruvmanila deleted the dhruv/inlay-hints-variable-types branch August 7, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Related to settings and configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants