aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_proc_macro_srv
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-08 11:19:41 +0100
committerAleksey Kladov <[email protected]>2020-04-08 11:19:41 +0100
commit9e3c8438475308bffaced3d9842299676037d036 (patch)
tree868943eed0cf91500169a56597bcba0d5edf5e5e /crates/ra_proc_macro_srv
parentffb7ea678b66c7407671361b1ee77bd9d2d6616c (diff)
fmt
Diffstat (limited to 'crates/ra_proc_macro_srv')
-rw-r--r--crates/ra_proc_macro_srv/src/proc_macro/diagnostic.rs8
-rw-r--r--crates/ra_proc_macro_srv/src/proc_macro/mod.rs4
2 files changed, 7 insertions, 5 deletions
diff --git a/crates/ra_proc_macro_srv/src/proc_macro/diagnostic.rs b/crates/ra_proc_macro_srv/src/proc_macro/diagnostic.rs
index 9029f8815..55d93917c 100644
--- a/crates/ra_proc_macro_srv/src/proc_macro/diagnostic.rs
+++ b/crates/ra_proc_macro_srv/src/proc_macro/diagnostic.rs
@@ -54,12 +54,14 @@ pub struct Diagnostic {
54} 54}
55 55
56macro_rules! diagnostic_child_methods { 56macro_rules! diagnostic_child_methods {
57 ($spanned:ident, $regular:ident, $level:expr) => ( 57 ($spanned:ident, $regular:ident, $level:expr) => {
58 /// Adds a new child diagnostic message to `self` with the level 58 /// Adds a new child diagnostic message to `self` with the level
59 /// identified by this method's name with the given `spans` and 59 /// identified by this method's name with the given `spans` and
60 /// `message`. 60 /// `message`.
61 pub fn $spanned<S, T>(mut self, spans: S, message: T) -> Diagnostic 61 pub fn $spanned<S, T>(mut self, spans: S, message: T) -> Diagnostic
62 where S: MultiSpan, T: Into<String> 62 where
63 S: MultiSpan,
64 T: Into<String>,
63 { 65 {
64 self.children.push(Diagnostic::spanned(spans, $level, message)); 66 self.children.push(Diagnostic::spanned(spans, $level, message));
65 self 67 self
@@ -71,7 +73,7 @@ macro_rules! diagnostic_child_methods {
71 self.children.push(Diagnostic::new($level, message)); 73 self.children.push(Diagnostic::new($level, message));
72 self 74 self
73 } 75 }
74 ) 76 };
75} 77}
76 78
77/// Iterator over the children diagnostics of a `Diagnostic`. 79/// Iterator over the children diagnostics of a `Diagnostic`.
diff --git a/crates/ra_proc_macro_srv/src/proc_macro/mod.rs b/crates/ra_proc_macro_srv/src/proc_macro/mod.rs
index e35a6ff8b..ee0dc9722 100644
--- a/crates/ra_proc_macro_srv/src/proc_macro/mod.rs
+++ b/crates/ra_proc_macro_srv/src/proc_macro/mod.rs
@@ -169,13 +169,13 @@ pub mod token_stream {
169pub struct Span(bridge::client::Span); 169pub struct Span(bridge::client::Span);
170 170
171macro_rules! diagnostic_method { 171macro_rules! diagnostic_method {
172 ($name:ident, $level:expr) => ( 172 ($name:ident, $level:expr) => {
173 /// Creates a new `Diagnostic` with the given `message` at the span 173 /// Creates a new `Diagnostic` with the given `message` at the span
174 /// `self`. 174 /// `self`.
175 pub fn $name<T: Into<String>>(self, message: T) -> Diagnostic { 175 pub fn $name<T: Into<String>>(self, message: T) -> Diagnostic {
176 Diagnostic::spanned(self, $level, message) 176 Diagnostic::spanned(self, $level, message)
177 } 177 }
178 ) 178 };
179} 179}
180 180
181impl Span { 181impl Span {