aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2020-01-14 17:32:39 +0000
committerJeremy Kolb <[email protected]>2020-01-14 17:32:46 +0000
commit9042bb7892db6b41ef09952e35cbd167c1a2d924 (patch)
treee600d71cae88bc20660233de349a509708683aa6 /crates/ra_assists
parente04661e495cde89827d768788f123eafdbd43911 (diff)
Assert that first letter is capitalized
Diffstat (limited to 'crates/ra_assists')
-rw-r--r--crates/ra_assists/src/assist_ctx.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs
index 28152f724..dc3ab440b 100644
--- a/crates/ra_assists/src/assist_ctx.rs
+++ b/crates/ra_assists/src/assist_ctx.rs
@@ -84,6 +84,12 @@ impl<'a, DB: HirDatabase> AssistCtx<'a, DB> {
84 f: impl FnOnce(&mut AssistBuilder), 84 f: impl FnOnce(&mut AssistBuilder),
85 ) -> Option<Assist> { 85 ) -> Option<Assist> {
86 let label = AssistLabel { label: label.into(), id }; 86 let label = AssistLabel { label: label.into(), id };
87 assert_eq!(
88 label.label.chars().nth(0).and_then(|c| Some(c.is_uppercase())),
89 Some(true),
90 "First character should be uppercase"
91 );
92
87 let assist = if self.should_compute_edit { 93 let assist = if self.should_compute_edit {
88 let action = { 94 let action = {
89 let mut edit = AssistBuilder::default(); 95 let mut edit = AssistBuilder::default();