mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:44:56 +00:00
[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:
parent
d324cedfc2
commit
2ee47d87b6
3 changed files with 68 additions and 4 deletions
|
@ -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')",
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue