mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Fmt corrections
This commit is contained in:
parent
b70ce559b8
commit
9d298115a6
1 changed files with 9 additions and 13 deletions
|
@ -5,7 +5,7 @@ use ra_ide_db::RootDatabase;
|
|||
use ra_prof::profile;
|
||||
use ra_syntax::{
|
||||
ast::{self, ArgListOwner, AstNode, TypeAscriptionOwner},
|
||||
match_ast, SmolStr, TextRange, NodeOrToken, SyntaxKind, Direction
|
||||
match_ast, Direction, NodeOrToken, SmolStr, SyntaxKind, TextRange,
|
||||
};
|
||||
|
||||
use crate::{FileId, FunctionSignature};
|
||||
|
@ -20,12 +20,7 @@ pub struct InlayHintsOptions {
|
|||
|
||||
impl Default for InlayHintsOptions {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
type_hints: true,
|
||||
parameter_hints: true,
|
||||
chaining_hints: true,
|
||||
max_length: None
|
||||
}
|
||||
Self { type_hints: true, parameter_hints: true, chaining_hints: true, max_length: None }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +81,8 @@ fn get_chaining_hints(
|
|||
return None;
|
||||
}
|
||||
|
||||
let mut tokens = expr.syntax()
|
||||
let mut tokens = expr
|
||||
.syntax()
|
||||
.siblings_with_tokens(Direction::Next)
|
||||
.filter_map(NodeOrToken::into_token)
|
||||
.filter(|t| match t.kind() {
|
||||
|
@ -1211,12 +1207,12 @@ fn main() {
|
|||
assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###"
|
||||
[
|
||||
InlayHint {
|
||||
range: [416; 465),
|
||||
range: [403; 452),
|
||||
kind: ChainingHint,
|
||||
label: "B<X<i32, bool>>",
|
||||
},
|
||||
InlayHint {
|
||||
range: [416; 435),
|
||||
range: [403; 422),
|
||||
kind: ChainingHint,
|
||||
label: "A<X<i32, bool>>",
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue