diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_batch/src/lib.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir/src/impl_block.rs | 10 | ||||
-rw-r--r-- | crates/ra_parser/src/parser.rs | 4 |
3 files changed, 11 insertions, 7 deletions
diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs index a14139b26..ffc9e16bb 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_batch/src/lib.rs | |||
@@ -89,6 +89,10 @@ pub fn load( | |||
89 | vfs.root2path(root) | 89 | vfs.root2path(root) |
90 | ); | 90 | ); |
91 | analysis_change.add_root(source_root_id, is_local); | 91 | analysis_change.add_root(source_root_id, is_local); |
92 | analysis_change.set_debug_root_path( | ||
93 | source_root_id, | ||
94 | source_roots[&source_root_id].path().display().to_string(), | ||
95 | ); | ||
92 | 96 | ||
93 | let mut file_map = FxHashMap::default(); | 97 | let mut file_map = FxHashMap::default(); |
94 | for (vfs_file, path, text) in files { | 98 | for (vfs_file, path, text) in files { |
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 162ab02b1..d26a024ed 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs | |||
@@ -4,7 +4,7 @@ use std::sync::Arc; | |||
4 | use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId}; | 4 | use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId}; |
5 | use ra_syntax::{ | 5 | use ra_syntax::{ |
6 | ast::{self, AstNode}, | 6 | ast::{self, AstNode}, |
7 | AstPtr, SourceFile, | 7 | AstPtr, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
@@ -29,12 +29,12 @@ impl ImplSourceMap { | |||
29 | } | 29 | } |
30 | 30 | ||
31 | pub fn get(&self, source: &ModuleSource, impl_id: ImplId) -> ast::ImplBlock { | 31 | pub fn get(&self, source: &ModuleSource, impl_id: ImplId) -> ast::ImplBlock { |
32 | let file = match source { | 32 | let root = match source { |
33 | ModuleSource::SourceFile(file) => file.clone(), | 33 | ModuleSource::SourceFile(file) => file.syntax().clone(), |
34 | ModuleSource::Module(m) => m.syntax().ancestors().find_map(SourceFile::cast).unwrap(), | 34 | ModuleSource::Module(m) => m.syntax().ancestors().last().unwrap(), |
35 | }; | 35 | }; |
36 | 36 | ||
37 | self.map[impl_id].to_node(file.syntax()).to_owned() | 37 | self.map[impl_id].to_node(&root) |
38 | } | 38 | } |
39 | } | 39 | } |
40 | 40 | ||
diff --git a/crates/ra_parser/src/parser.rs b/crates/ra_parser/src/parser.rs index a2ac363fb..f8fba6860 100644 --- a/crates/ra_parser/src/parser.rs +++ b/crates/ra_parser/src/parser.rs | |||
@@ -5,7 +5,7 @@ use drop_bomb::DropBomb; | |||
5 | use crate::{ | 5 | use crate::{ |
6 | event::Event, | 6 | event::Event, |
7 | ParseError, | 7 | ParseError, |
8 | SyntaxKind::{self, EOF, ERROR, L_DOLLAR, R_DOLLAR, TOMBSTONE}, | 8 | SyntaxKind::{self, EOF, ERROR, TOMBSTONE}, |
9 | TokenSet, TokenSource, T, | 9 | TokenSet, TokenSource, T, |
10 | }; | 10 | }; |
11 | 11 | ||
@@ -212,7 +212,7 @@ impl<'t> Parser<'t> { | |||
212 | /// Create an error node and consume the next token. | 212 | /// Create an error node and consume the next token. |
213 | pub(crate) fn err_recover(&mut self, message: &str, recovery: TokenSet) { | 213 | pub(crate) fn err_recover(&mut self, message: &str, recovery: TokenSet) { |
214 | match self.current() { | 214 | match self.current() { |
215 | T!['{'] | T!['}'] | L_DOLLAR | R_DOLLAR => { | 215 | T!['{'] | T!['}'] => { |
216 | self.error(message); | 216 | self.error(message); |
217 | return; | 217 | return; |
218 | } | 218 | } |