aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-18 18:56:54 +0100
committerGitHub <[email protected]>2020-04-18 18:56:54 +0100
commit98819d89199c5138cc5018b036b0ec5d3fade77e (patch)
tree77b293ab5eb3a99f70082efe9cb66784f71f3343 /crates/ra_ide
parent84e3304a9bf0d68e30d58b1e37a6db2e9ec97525 (diff)
parent72bba9882889b2e20fd91e3c6c3a97debbbe6543 (diff)
Merge #4029
4029: Fix various proc-macro bugs r=matklad a=edwin0cheng This PRs does the following things: 1. Fixed #4001 by splitting `LIFETIME` lexer token to two mbe tokens. It is because rustc token stream expects `LIFETIME` as a combination of punct and ident, but RA `tt:TokenTree` treats it as a single `Ident` previously. 2. Fixed #4003, by skipping `proc-macro` for completion. It is because currently we don't have `AstNode` for `proc-macro`. We would need to redesign how to implement `HasSource` for `proc-macro`. 3. Fixed a bug how empty `TokenStream` merging in `proc-macro-srv` such that no L_DOLLAR and R_DOLLAR will be emitted accidentally. Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/completion/presentation.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs
index 55f75b15a..2189cef65 100644
--- a/crates/ra_ide/src/completion/presentation.rs
+++ b/crates/ra_ide/src/completion/presentation.rs
@@ -156,6 +156,12 @@ impl Completions {
156 name: Option<String>, 156 name: Option<String>,
157 macro_: hir::MacroDef, 157 macro_: hir::MacroDef,
158 ) { 158 ) {
159 // FIXME: Currently proc-macro do not have ast-node,
160 // such that it does not have source
161 if macro_.is_proc_macro() {
162 return;
163 }
164
159 let name = match name { 165 let name = match name {
160 Some(it) => it, 166 Some(it) => it,
161 None => return, 167 None => return,