diff options
author | Benjamin Coenen <[email protected]> | 2020-04-21 13:32:02 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-04-21 13:32:02 +0100 |
commit | 7f143b154e7c47b1f5bdc558bb0b5d1f2bf74f8d (patch) | |
tree | 571b7d5bdfc84bdaeaa8235221fd96a87453fe05 /crates/ra_proc_macro_srv/src/rustc_server.rs | |
parent | 1c3a1385a587f0713908c0ae888ffad31f13de11 (diff) | |
parent | a88887df0726cc3d390db4bfbbc1274195d87f91 (diff) |
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer
Diffstat (limited to 'crates/ra_proc_macro_srv/src/rustc_server.rs')
-rw-r--r-- | crates/ra_proc_macro_srv/src/rustc_server.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/crates/ra_proc_macro_srv/src/rustc_server.rs b/crates/ra_proc_macro_srv/src/rustc_server.rs index ec0d35692..f481d70b2 100644 --- a/crates/ra_proc_macro_srv/src/rustc_server.rs +++ b/crates/ra_proc_macro_srv/src/rustc_server.rs | |||
@@ -6,7 +6,7 @@ | |||
6 | //! The original idea from fedochet is using proc-macro2 as backend, | 6 | //! The original idea from fedochet is using proc-macro2 as backend, |
7 | //! we use ra_tt instead for better intergation with RA. | 7 | //! we use ra_tt instead for better intergation with RA. |
8 | //! | 8 | //! |
9 | //! FIXME: No span and source file informatin is implemented yet | 9 | //! FIXME: No span and source file information is implemented yet |
10 | 10 | ||
11 | use crate::proc_macro::bridge::{self, server}; | 11 | use crate::proc_macro::bridge::{self, server}; |
12 | use ra_tt as tt; | 12 | use ra_tt as tt; |
@@ -76,7 +76,16 @@ impl Extend<TokenTree> for TokenStream { | |||
76 | impl Extend<TokenStream> for TokenStream { | 76 | impl Extend<TokenStream> for TokenStream { |
77 | fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) { | 77 | fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) { |
78 | for item in streams { | 78 | for item in streams { |
79 | self.subtree.token_trees.extend(&mut item.into_iter()) | 79 | for tkn in item { |
80 | match tkn { | ||
81 | tt::TokenTree::Subtree(subtree) if subtree.delimiter.is_none() => { | ||
82 | self.subtree.token_trees.extend(subtree.token_trees); | ||
83 | } | ||
84 | _ => { | ||
85 | self.subtree.token_trees.push(tkn); | ||
86 | } | ||
87 | } | ||
88 | } | ||
80 | } | 89 | } |
81 | } | 90 | } |
82 | } | 91 | } |