[ty] Default ty.inlayHints.* server settings to true (#19910)

## Summary

This PR changes the default of `ty.inlayHints.*` settings to `true`.

I somehow missed this in my initial PR.

This is marked as `internal` because it's not yet released.
This commit is contained in:
Dhruv Manilawala 2025-08-14 14:12:03 +05:30 committed by GitHub
parent d324cedfc2
commit 2ee47d87b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 68 additions and 4 deletions

View file

@ -67,7 +67,7 @@ pub fn inlay_hints<'db>(
}
/// Settings to control the behavior of inlay hints.
#[derive(Clone, Default, Debug)]
#[derive(Clone, Debug)]
pub struct InlayHintSettings {
/// Whether to show variable type hints.
///
@ -76,6 +76,7 @@ pub struct InlayHintSettings {
/// x": Literal[1]" = 1
/// ```
pub variable_types: bool,
/// Whether to show function argument names.
///
/// For example, this would enable / disable hints like the ones quoted below:
@ -86,6 +87,15 @@ pub struct InlayHintSettings {
pub function_argument_names: bool,
}
impl Default for InlayHintSettings {
fn default() -> Self {
Self {
variable_types: true,
function_argument_names: true,
}
}
}
struct InlayHintVisitor<'a, 'db> {
db: &'db dyn Db,
model: SemanticModel<'db>,
@ -818,7 +828,7 @@ mod tests {
def foo(x: str) -> int: ...
def foo(x):
return x
foo(42)
foo('hello')",
);