cargo format

This commit is contained in:
Phil Ellison 2019-07-28 12:08:06 +01:00
parent 9f6909c0ce
commit 5c4df97996
5 changed files with 117 additions and 117 deletions

View file

@ -140,7 +140,7 @@ mod tests {
} }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "quux", label: "quux",
@ -187,7 +187,7 @@ mod tests {
} }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "a", label: "a",
@ -229,7 +229,7 @@ mod tests {
} }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "quux", label: "quux",
@ -261,7 +261,7 @@ mod tests {
} }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "T", label: "T",
@ -293,7 +293,7 @@ mod tests {
} }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "T", label: "T",
@ -326,7 +326,7 @@ mod tests {
} }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "Baz", label: "Baz",
@ -367,7 +367,7 @@ mod tests {
// nothing here // nothing here
" "
), ),
@r#"[ @r#"[
CompletionItem { CompletionItem {
label: "other_crate", label: "other_crate",
source_range: [4; 4), source_range: [4; 4),
@ -391,7 +391,7 @@ mod tests {
} }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "Bar", label: "Bar",
@ -422,7 +422,7 @@ mod tests {
fn x() -> <|> fn x() -> <|>
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "Foo", label: "Foo",
@ -458,7 +458,7 @@ mod tests {
} }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "bar", label: "bar",
@ -485,7 +485,7 @@ mod tests {
fn completes_self_in_methods() { fn completes_self_in_methods() {
assert_debug_snapshot_matches!( assert_debug_snapshot_matches!(
do_reference_completion(r"impl S { fn foo(&self) { <|> } }"), do_reference_completion(r"impl S { fn foo(&self) { <|> } }"),
@r#"[ @r#"[
CompletionItem { CompletionItem {
label: "Self", label: "Self",
source_range: [25; 25), source_range: [25; 25),
@ -522,7 +522,7 @@ mod tests {
} }
" "
), ),
@r#"[ @r#"[
CompletionItem { CompletionItem {
label: "Option", label: "Option",
source_range: [18; 18), source_range: [18; 18),

View file

@ -50,7 +50,7 @@ mod tests {
fn completes_snippets_in_expressions() { fn completes_snippets_in_expressions() {
assert_debug_snapshot_matches!( assert_debug_snapshot_matches!(
do_snippet_completion(r"fn foo(x: i32) { <|> }"), do_snippet_completion(r"fn foo(x: i32) { <|> }"),
@r#"[ @r#"[
CompletionItem { CompletionItem {
label: "pd", label: "pd",
source_range: [17; 17), source_range: [17; 17),
@ -73,11 +73,11 @@ mod tests {
fn should_not_complete_snippets_in_path() { fn should_not_complete_snippets_in_path() {
assert_debug_snapshot_matches!( assert_debug_snapshot_matches!(
do_snippet_completion(r"fn foo(x: i32) { ::foo<|> }"), do_snippet_completion(r"fn foo(x: i32) { ::foo<|> }"),
@r#"[]"# @r#"[]"#
); );
assert_debug_snapshot_matches!( assert_debug_snapshot_matches!(
do_snippet_completion(r"fn foo(x: i32) { ::<|> }"), do_snippet_completion(r"fn foo(x: i32) { ::<|> }"),
@r#"[]"# @r#"[]"#
); );
} }
@ -92,7 +92,7 @@ mod tests {
} }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "Test function", label: "Test function",

View file

@ -182,9 +182,9 @@ impl Completions {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use test_utils::covers;
use crate::completion::{do_completion, CompletionItem, CompletionKind}; use crate::completion::{do_completion, CompletionItem, CompletionKind};
use insta::assert_debug_snapshot_matches; use insta::assert_debug_snapshot_matches;
use test_utils::covers;
fn do_reference_completion(code: &str) -> Vec<CompletionItem> { fn do_reference_completion(code: &str) -> Vec<CompletionItem> {
do_completion(code, CompletionKind::Reference) do_completion(code, CompletionKind::Reference)
@ -200,7 +200,7 @@ mod tests {
fn main() { no_<|> } fn main() { no_<|> }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "main", label: "main",
@ -228,7 +228,7 @@ mod tests {
fn main() { with_<|> } fn main() { with_<|> }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "main", label: "main",
@ -261,7 +261,7 @@ mod tests {
} }
" "
), ),
@r###" @r###"
[ [
CompletionItem { CompletionItem {
label: "foo", label: "foo",
@ -286,7 +286,7 @@ mod tests {
use crate::m::f<|>; use crate::m::f<|>;
" "
), ),
@r#"[ @r#"[
CompletionItem { CompletionItem {
label: "foo", label: "foo",
source_range: [40; 41), source_range: [40; 41),
@ -311,7 +311,7 @@ mod tests {
} }
" "
), ),
@r#"[ @r#"[
CompletionItem { CompletionItem {
label: "frobnicate", label: "frobnicate",
source_range: [35; 39), source_range: [35; 39),
@ -341,7 +341,7 @@ mod tests {
} }
" "
), ),
@r#"[ @r#"[
CompletionItem { CompletionItem {
label: "new", label: "new",
source_range: [67; 69), source_range: [67; 69),

View file

@ -205,7 +205,7 @@ fn very_obsolete() {}
.unwrap(); .unwrap();
let structure = file_structure(&file); let structure = file_structure(&file);
assert_debug_snapshot_matches!(structure, assert_debug_snapshot_matches!(structure,
@r#"[ @r#"[
StructureNode { StructureNode {
parent: None, parent: None,
label: "Foo", label: "Foo",

View file

@ -93,7 +93,7 @@ mod tests {
); );
let runnables = analysis.runnables(pos.file_id).unwrap(); let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot_matches!(&runnables, assert_debug_snapshot_matches!(&runnables,
@r#"[ @r#"[
Runnable { Runnable {
range: [1; 21), range: [1; 21),
kind: Bin, kind: Bin,
@ -128,7 +128,7 @@ mod tests {
); );
let runnables = analysis.runnables(pos.file_id).unwrap(); let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot_matches!(&runnables, assert_debug_snapshot_matches!(&runnables,
@r#"[ @r#"[
Runnable { Runnable {
range: [1; 59), range: [1; 59),
kind: TestMod { kind: TestMod {
@ -161,7 +161,7 @@ mod tests {
); );
let runnables = analysis.runnables(pos.file_id).unwrap(); let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot_matches!(&runnables, assert_debug_snapshot_matches!(&runnables,
@r#"[ @r#"[
Runnable { Runnable {
range: [23; 85), range: [23; 85),
kind: TestMod { kind: TestMod {
@ -196,7 +196,7 @@ mod tests {
); );
let runnables = analysis.runnables(pos.file_id).unwrap(); let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot_matches!(&runnables, assert_debug_snapshot_matches!(&runnables,
@r#"[ @r#"[
Runnable { Runnable {
range: [41; 115), range: [41; 115),
kind: TestMod { kind: TestMod {