mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 09:27:27 +00:00
fold complete_postfix tests into one
This commit is contained in:
parent
1c5a63e3db
commit
9dd7ccf609
5 changed files with 3 additions and 411 deletions
|
@ -56,9 +56,9 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn test_filter_postfix_completion1() {
|
||||
fn postfix_completion_works_for_trivial_path_expression() {
|
||||
check_snippet_completion(
|
||||
"filter_postfix_completion1",
|
||||
"postfix_completion_works_for_trivial_path_expression",
|
||||
r#"
|
||||
fn main() {
|
||||
let bar = "a";
|
||||
|
@ -67,43 +67,4 @@ mod tests {
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_filter_postfix_completion2() {
|
||||
check_snippet_completion(
|
||||
"filter_postfix_completion2",
|
||||
r#"
|
||||
fn main() {
|
||||
let bar = "a";
|
||||
bar.i<|>
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_filter_postfix_completion3() {
|
||||
check_snippet_completion(
|
||||
"filter_postfix_completion3",
|
||||
r#"
|
||||
fn main() {
|
||||
let bar = "a";
|
||||
bar.if<|>
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_filter_postfix_completion4() {
|
||||
check_snippet_completion(
|
||||
"filter_postfix_completion4",
|
||||
r#"
|
||||
fn main() {
|
||||
let bar = "a";
|
||||
bar.dbg<|>
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,123 +0,0 @@
|
|||
---
|
||||
created: "2019-02-02T15:08:34.016388824+00:00"
|
||||
creator: insta@0.5.3
|
||||
expression: kind_completions
|
||||
source: crates/ra_ide_api/src/completion/completion_item.rs
|
||||
---
|
||||
[
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "dbg",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"dbg!(bar)"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [76; 77),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 76),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "if",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"if bar {$0}"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [76; 77),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 76),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "match",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"match bar {\n${1:_} => {$0\\},\n}"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [76; 77),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 76),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "not",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"!bar"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [76; 77),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 76),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "while",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"while bar {\n$0\n}"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [76; 77),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 76),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
}
|
||||
]
|
|
@ -1,123 +0,0 @@
|
|||
---
|
||||
created: "2019-02-02T15:08:34.060136941+00:00"
|
||||
creator: insta@0.5.3
|
||||
expression: kind_completions
|
||||
source: crates/ra_ide_api/src/completion/completion_item.rs
|
||||
---
|
||||
[
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "dbg",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"dbg!(bar)"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [78; 78),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 78),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "if",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"if bar {$0}"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [78; 78),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 78),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "match",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"match bar {\n${1:_} => {$0\\},\n}"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [78; 78),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 78),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "not",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"!bar"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [78; 78),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 78),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "while",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"while bar {\n$0\n}"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [78; 78),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 78),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
}
|
||||
]
|
|
@ -1,123 +0,0 @@
|
|||
---
|
||||
created: "2019-02-02T15:08:34.069147268+00:00"
|
||||
creator: insta@0.5.3
|
||||
expression: kind_completions
|
||||
source: crates/ra_ide_api/src/completion/completion_item.rs
|
||||
---
|
||||
[
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "dbg",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"dbg!(bar)"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [78; 78),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 78),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "if",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"if bar {$0}"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [78; 78),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 78),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "match",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"match bar {\n${1:_} => {$0\\},\n}"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [78; 78),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 78),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "not",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"!bar"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [78; 78),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 78),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
},
|
||||
CompletionItem {
|
||||
completion_kind: Postfix,
|
||||
label: "while",
|
||||
kind: None,
|
||||
detail: None,
|
||||
documentation: None,
|
||||
lookup: None,
|
||||
insert_text: Some(
|
||||
"while bar {\n$0\n}"
|
||||
),
|
||||
insert_text_format: Snippet,
|
||||
source_range: [78; 78),
|
||||
text_edit: Some(
|
||||
TextEdit {
|
||||
atoms: [
|
||||
AtomTextEdit {
|
||||
delete: [72; 78),
|
||||
insert: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
}
|
||||
]
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
created: "2019-02-02T15:08:34.016389802+00:00"
|
||||
created: "2019-02-03T11:38:42.897384636+00:00"
|
||||
creator: insta@0.5.3
|
||||
expression: kind_completions
|
||||
source: crates/ra_ide_api/src/completion/completion_item.rs
|
Loading…
Reference in a new issue