From 13c078db9cba8bbbf48918a928cd2533571a7f5d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 5 May 2020 20:30:33 +0200 Subject: Flip Assist::new arguments --- crates/ra_assists/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists/src/lib.rs') diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index c5df86600..6156f4e2c 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs @@ -32,16 +32,16 @@ pub struct AssistId(pub &'static str); #[derive(Debug, Clone)] pub struct AssistLabel { + pub id: AssistId, /// Short description of the assist, as shown in the UI. pub label: String, - pub id: AssistId, } #[derive(Clone, Debug)] pub struct GroupLabel(pub String); impl AssistLabel { - pub(crate) fn new(label: String, id: AssistId) -> AssistLabel { + pub(crate) fn new(id: AssistId, label: String) -> AssistLabel { // FIXME: make fields private, so that this invariant can't be broken assert!(label.starts_with(|c: char| c.is_uppercase())); AssistLabel { label, id } -- cgit v1.2.3 From aee22c73c3cafdb6f4b3f97bc483791d4ed2e902 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 5 May 2020 20:42:52 +0200 Subject: Move group_label where it belongs --- crates/ra_assists/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_assists/src/lib.rs') diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index 6156f4e2c..1b31d655b 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs @@ -35,16 +35,17 @@ pub struct AssistLabel { pub id: AssistId, /// Short description of the assist, as shown in the UI. pub label: String, + pub group: Option, } #[derive(Clone, Debug)] pub struct GroupLabel(pub String); impl AssistLabel { - pub(crate) fn new(id: AssistId, label: String) -> AssistLabel { + pub(crate) fn new(id: AssistId, label: String, group: Option) -> AssistLabel { // FIXME: make fields private, so that this invariant can't be broken assert!(label.starts_with(|c: char| c.is_uppercase())); - AssistLabel { label, id } + AssistLabel { id, label, group } } } @@ -60,7 +61,6 @@ pub struct AssistAction { #[derive(Debug, Clone)] pub struct ResolvedAssist { pub label: AssistLabel, - pub group_label: Option, pub action: AssistAction, } -- cgit v1.2.3 From df00da15c435f3105007146cbbfc9afc34ad311c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 5 May 2020 20:44:13 +0200 Subject: Fix compilation --- crates/ra_assists/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_assists/src/lib.rs') diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index 1b31d655b..5cec10088 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs @@ -17,13 +17,13 @@ mod doc_tests; pub mod utils; pub mod ast_transform; +use hir::Semantics; use ra_db::{FileId, FileRange}; use ra_ide_db::RootDatabase; use ra_syntax::{TextRange, TextSize}; use ra_text_edit::TextEdit; pub(crate) use crate::assist_ctx::{Assist, AssistCtx, AssistHandler}; -use hir::Semantics; /// Unique identifier of the assist, should not be shown to the user /// directly. -- cgit v1.2.3