From cc33b0dc82c119434967aa9609e6a7a08e38cd14 Mon Sep 17 00:00:00 2001 From: vsrs Date: Mon, 2 Aug 2021 20:22:45 +0300 Subject: [PATCH] Update the docs --- crates/ide_assists/src/handlers/sort_items.rs | 10 +++++----- crates/ide_assists/src/tests/generated.rs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/ide_assists/src/handlers/sort_items.rs b/crates/ide_assists/src/handlers/sort_items.rs index f35165a0fc..2ca4a19ec4 100644 --- a/crates/ide_assists/src/handlers/sort_items.rs +++ b/crates/ide_assists/src/handlers/sort_items.rs @@ -14,7 +14,7 @@ use crate::{utils::get_methods, AssistContext, AssistId, AssistKind, Assists}; // Sorts item members alphabetically: fields, enum variants and methods. // // ``` -// struct $0Foo { second: u32, first: String } +// struct $0Foo$0 { second: u32, first: String } // ``` // -> // ``` @@ -22,7 +22,7 @@ use crate::{utils::get_methods, AssistContext, AssistId, AssistKind, Assists}; // ``` // --- // ``` -// trait $0Bar { +// trait $0Bar$0 { // fn second(&self) -> u32; // fn first(&self) -> String; // } @@ -37,7 +37,7 @@ use crate::{utils::get_methods, AssistContext, AssistId, AssistKind, Assists}; // --- // ``` // struct Baz; -// impl $0Baz { +// impl $0Baz$0 { // fn second(&self) -> u32; // fn first(&self) -> String; // } @@ -54,7 +54,7 @@ use crate::{utils::get_methods, AssistContext, AssistId, AssistKind, Assists}; // There is a difference between sorting enum variants: // // ``` -// en$0um Animal { +// enum $0Animal$0 { // Dog(String, f64), // Cat { weight: f64, name: String }, // } @@ -71,7 +71,7 @@ use crate::{utils::get_methods, AssistContext, AssistId, AssistKind, Assists}; // ``` // enum Animal { // Dog(String, f64), -// Cat {$0 weight: f64, name: String }, +// Cat $0{ weight: f64, name: String }$0, // } // ``` // -> diff --git a/crates/ide_assists/src/tests/generated.rs b/crates/ide_assists/src/tests/generated.rs index 1d9d14d941..2a652f1501 100644 --- a/crates/ide_assists/src/tests/generated.rs +++ b/crates/ide_assists/src/tests/generated.rs @@ -1528,7 +1528,7 @@ fn doctest_sort_items() { check_doc_test( "sort_items", r#####" -struct $0Foo { second: u32, first: String } +struct $0Foo$0 { second: u32, first: String } "#####, r#####" struct Foo { first: String, second: u32 } @@ -1541,7 +1541,7 @@ fn doctest_sort_items_1() { check_doc_test( "sort_items", r#####" -trait $0Bar { +trait $0Bar$0 { fn second(&self) -> u32; fn first(&self) -> String; } @@ -1561,7 +1561,7 @@ fn doctest_sort_items_2() { "sort_items", r#####" struct Baz; -impl $0Baz { +impl $0Baz$0 { fn second(&self) -> u32; fn first(&self) -> String; } @@ -1581,7 +1581,7 @@ fn doctest_sort_items_3() { check_doc_test( "sort_items", r#####" -en$0um Animal { +enum $0Animal$0 { Dog(String, f64), Cat { weight: f64, name: String }, } @@ -1602,7 +1602,7 @@ fn doctest_sort_items_4() { r#####" enum Animal { Dog(String, f64), - Cat {$0 weight: f64, name: String }, + Cat $0{ weight: f64, name: String }$0, } "#####, r#####"