diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-02 13:05:54 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-02 13:05:54 +0000 |
commit | afa972e78d2d81598c02b742ab84d70c88208300 (patch) | |
tree | 2ec32a586d0ee00e0d35a489efeaf31c91d14a15 /crates/ra_analysis/src/imp.rs | |
parent | e4ffd7b31780b1f2ac6dcb731566b583bf562647 (diff) | |
parent | 1076e82856f353763de8426d378fcd1e371cbed4 (diff) |
Merge #403
403: initial support for macros r=matklad a=matklad
I'll write a more comprehensive description when this is closer to being done. Basically this investigates one question: "how do we represent code which is a result of a macro call". This is an interesting question: currently everything is `FileId` based, but macro expansion does not have a file!
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 5669aa94d..ec7da437a 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -230,7 +230,7 @@ impl AnalysisImpl { | |||
230 | Some(it) => it, | 230 | Some(it) => it, |
231 | }; | 231 | }; |
232 | let root = descr.crate_root(); | 232 | let root = descr.crate_root(); |
233 | let file_id = root.source().file_id(); | 233 | let file_id = root.file_id(); |
234 | 234 | ||
235 | let crate_graph = self.db.crate_graph(); | 235 | let crate_graph = self.db.crate_graph(); |
236 | let crate_id = crate_graph.crate_id_for_crate_root(file_id); | 236 | let crate_id = crate_graph.crate_id_for_crate_root(file_id); |
@@ -283,7 +283,7 @@ impl AnalysisImpl { | |||
283 | if let Some(child_module) = | 283 | if let Some(child_module) = |
284 | source_binder::module_from_declaration(&*self.db, position.file_id, module)? | 284 | source_binder::module_from_declaration(&*self.db, position.file_id, module)? |
285 | { | 285 | { |
286 | let file_id = child_module.source().file_id(); | 286 | let file_id = child_module.file_id(); |
287 | let name = match child_module.name() { | 287 | let name = match child_module.name() { |
288 | Some(name) => name.to_string().into(), | 288 | Some(name) => name.to_string().into(), |
289 | None => "".into(), | 289 | None => "".into(), |