aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_proc_macro_srv/src/rustc_server.rs
diff options
context:
space:
mode:
authorBenjamin Coenen <[email protected]>2020-04-21 13:32:02 +0100
committerBenjamin Coenen <[email protected]>2020-04-21 13:32:02 +0100
commit7f143b154e7c47b1f5bdc558bb0b5d1f2bf74f8d (patch)
tree571b7d5bdfc84bdaeaa8235221fd96a87453fe05 /crates/ra_proc_macro_srv/src/rustc_server.rs
parent1c3a1385a587f0713908c0ae888ffad31f13de11 (diff)
parenta88887df0726cc3d390db4bfbbc1274195d87f91 (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.rs13
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
11use crate::proc_macro::bridge::{self, server}; 11use crate::proc_macro::bridge::{self, server};
12use ra_tt as tt; 12use ra_tt as tt;
@@ -76,7 +76,16 @@ impl Extend<TokenTree> for TokenStream {
76impl Extend<TokenStream> for TokenStream { 76impl 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}