aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand/src')
-rw-r--r--crates/ra_hir_expand/src/ast_id_map.rs2
-rw-r--r--crates/ra_hir_expand/src/builtin_derive.rs2
-rw-r--r--crates/ra_hir_expand/src/builtin_macro.rs4
-rw-r--r--crates/ra_hir_expand/src/db.rs10
-rw-r--r--crates/ra_hir_expand/src/diagnostics.rs2
-rw-r--r--crates/ra_hir_expand/src/eager.rs2
-rw-r--r--crates/ra_hir_expand/src/hygiene.rs2
-rw-r--r--crates/ra_hir_expand/src/lib.rs2
-rw-r--r--crates/ra_hir_expand/src/name.rs6
9 files changed, 16 insertions, 16 deletions
diff --git a/crates/ra_hir_expand/src/ast_id_map.rs b/crates/ra_hir_expand/src/ast_id_map.rs
index 703a85b0f..f63629b30 100644
--- a/crates/ra_hir_expand/src/ast_id_map.rs
+++ b/crates/ra_hir_expand/src/ast_id_map.rs
@@ -13,7 +13,7 @@ use std::{
13}; 13};
14 14
15use arena::{Arena, Idx}; 15use arena::{Arena, Idx};
16use ra_syntax::{ast, AstNode, AstPtr, SyntaxNode, SyntaxNodePtr}; 16use syntax::{ast, AstNode, AstPtr, SyntaxNode, SyntaxNodePtr};
17 17
18/// `AstId` points to an AST node in a specific file. 18/// `AstId` points to an AST node in a specific file.
19pub struct FileAstId<N: AstNode> { 19pub struct FileAstId<N: AstNode> {
diff --git a/crates/ra_hir_expand/src/builtin_derive.rs b/crates/ra_hir_expand/src/builtin_derive.rs
index 95e6977f2..2d2f8bcb8 100644
--- a/crates/ra_hir_expand/src/builtin_derive.rs
+++ b/crates/ra_hir_expand/src/builtin_derive.rs
@@ -3,7 +3,7 @@
3use log::debug; 3use log::debug;
4 4
5use parser::FragmentKind; 5use parser::FragmentKind;
6use ra_syntax::{ 6use syntax::{
7 ast::{self, AstNode, GenericParamsOwner, ModuleItemOwner, NameOwner}, 7 ast::{self, AstNode, GenericParamsOwner, ModuleItemOwner, NameOwner},
8 match_ast, 8 match_ast,
9}; 9};
diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs
index 24dc0b4e7..ae4c84382 100644
--- a/crates/ra_hir_expand/src/builtin_macro.rs
+++ b/crates/ra_hir_expand/src/builtin_macro.rs
@@ -8,7 +8,7 @@ use either::Either;
8use mbe::parse_to_token_tree; 8use mbe::parse_to_token_tree;
9use parser::FragmentKind; 9use parser::FragmentKind;
10use ra_db::FileId; 10use ra_db::FileId;
11use ra_syntax::ast::{self, AstToken, HasStringValue}; 11use syntax::ast::{self, AstToken, HasStringValue};
12 12
13macro_rules! register_builtin { 13macro_rules! register_builtin {
14 ( LAZY: $(($name:ident, $kind: ident) => $expand:ident),* , EAGER: $(($e_name:ident, $e_kind: ident) => $e_expand:ident),* ) => { 14 ( LAZY: $(($name:ident, $kind: ident) => $expand:ident),* , EAGER: $(($e_name:ident, $e_kind: ident) => $e_expand:ident),* ) => {
@@ -427,8 +427,8 @@ mod tests {
427 MacroCallLoc, 427 MacroCallLoc,
428 }; 428 };
429 use ra_db::{fixture::WithFixture, SourceDatabase}; 429 use ra_db::{fixture::WithFixture, SourceDatabase};
430 use ra_syntax::ast::NameOwner;
431 use std::sync::Arc; 430 use std::sync::Arc;
431 use syntax::ast::NameOwner;
432 432
433 fn expand_builtin_macro(ra_fixture: &str) -> String { 433 fn expand_builtin_macro(ra_fixture: &str) -> String {
434 let (db, file_id) = TestDB::with_single_file(&ra_fixture); 434 let (db, file_id) = TestDB::with_single_file(&ra_fixture);
diff --git a/crates/ra_hir_expand/src/db.rs b/crates/ra_hir_expand/src/db.rs
index d83c391a9..c275f6b01 100644
--- a/crates/ra_hir_expand/src/db.rs
+++ b/crates/ra_hir_expand/src/db.rs
@@ -5,7 +5,7 @@ use std::sync::Arc;
5use mbe::{ExpandResult, MacroRules}; 5use mbe::{ExpandResult, MacroRules};
6use parser::FragmentKind; 6use parser::FragmentKind;
7use ra_db::{salsa, SourceDatabase}; 7use ra_db::{salsa, SourceDatabase};
8use ra_syntax::{algo::diff, AstNode, GreenNode, Parse, SyntaxKind::*, SyntaxNode}; 8use syntax::{algo::diff, AstNode, GreenNode, Parse, SyntaxKind::*, SyntaxNode};
9 9
10use crate::{ 10use crate::{
11 ast_id_map::AstIdMap, BuiltinDeriveExpander, BuiltinFnLikeExpander, EagerCallLoc, EagerMacroId, 11 ast_id_map::AstIdMap, BuiltinDeriveExpander, BuiltinFnLikeExpander, EagerCallLoc, EagerMacroId,
@@ -92,9 +92,9 @@ pub trait AstDatabase: SourceDatabase {
92pub fn expand_hypothetical( 92pub fn expand_hypothetical(
93 db: &dyn AstDatabase, 93 db: &dyn AstDatabase,
94 actual_macro_call: MacroCallId, 94 actual_macro_call: MacroCallId,
95 hypothetical_args: &ra_syntax::ast::TokenTree, 95 hypothetical_args: &syntax::ast::TokenTree,
96 token_to_map: ra_syntax::SyntaxToken, 96 token_to_map: syntax::SyntaxToken,
97) -> Option<(SyntaxNode, ra_syntax::SyntaxToken)> { 97) -> Option<(SyntaxNode, syntax::SyntaxToken)> {
98 let macro_file = MacroFile { macro_call_id: actual_macro_call }; 98 let macro_file = MacroFile { macro_call_id: actual_macro_call };
99 let (tt, tmap_1) = mbe::syntax_node_to_token_tree(hypothetical_args.syntax()).unwrap(); 99 let (tt, tmap_1) = mbe::syntax_node_to_token_tree(hypothetical_args.syntax()).unwrap();
100 let range = 100 let range =
@@ -105,7 +105,7 @@ pub fn expand_hypothetical(
105 parse_macro_with_arg(db, macro_file, Some(std::sync::Arc::new((tt, tmap_1))))?; 105 parse_macro_with_arg(db, macro_file, Some(std::sync::Arc::new((tt, tmap_1))))?;
106 let token_id = macro_def.0.map_id_down(token_id); 106 let token_id = macro_def.0.map_id_down(token_id);
107 let range = tmap_2.range_by_token(token_id)?.by_kind(token_to_map.kind())?; 107 let range = tmap_2.range_by_token(token_id)?.by_kind(token_to_map.kind())?;
108 let token = ra_syntax::algo::find_covering_element(&node.syntax_node(), range).into_token()?; 108 let token = syntax::algo::find_covering_element(&node.syntax_node(), range).into_token()?;
109 Some((node.syntax_node(), token)) 109 Some((node.syntax_node(), token))
110} 110}
111 111
diff --git a/crates/ra_hir_expand/src/diagnostics.rs b/crates/ra_hir_expand/src/diagnostics.rs
index b138500e7..59d35debe 100644
--- a/crates/ra_hir_expand/src/diagnostics.rs
+++ b/crates/ra_hir_expand/src/diagnostics.rs
@@ -16,7 +16,7 @@
16 16
17use std::{any::Any, fmt}; 17use std::{any::Any, fmt};
18 18
19use ra_syntax::SyntaxNodePtr; 19use syntax::SyntaxNodePtr;
20 20
21use crate::InFile; 21use crate::InFile;
22 22
diff --git a/crates/ra_hir_expand/src/eager.rs b/crates/ra_hir_expand/src/eager.rs
index dc83044ea..bd3409f97 100644
--- a/crates/ra_hir_expand/src/eager.rs
+++ b/crates/ra_hir_expand/src/eager.rs
@@ -27,8 +27,8 @@ use crate::{
27 27
28use parser::FragmentKind; 28use parser::FragmentKind;
29use ra_db::CrateId; 29use ra_db::CrateId;
30use ra_syntax::{algo::SyntaxRewriter, SyntaxNode};
31use std::sync::Arc; 30use std::sync::Arc;
31use syntax::{algo::SyntaxRewriter, SyntaxNode};
32 32
33pub fn expand_eager_macro( 33pub fn expand_eager_macro(
34 db: &dyn AstDatabase, 34 db: &dyn AstDatabase,
diff --git a/crates/ra_hir_expand/src/hygiene.rs b/crates/ra_hir_expand/src/hygiene.rs
index aefe47bd3..23b5eac27 100644
--- a/crates/ra_hir_expand/src/hygiene.rs
+++ b/crates/ra_hir_expand/src/hygiene.rs
@@ -4,7 +4,7 @@
4//! this moment, this is horribly incomplete and handles only `$crate`. 4//! this moment, this is horribly incomplete and handles only `$crate`.
5use either::Either; 5use either::Either;
6use ra_db::CrateId; 6use ra_db::CrateId;
7use ra_syntax::ast; 7use syntax::ast;
8 8
9use crate::{ 9use crate::{
10 db::AstDatabase, 10 db::AstDatabase,
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs
index 38f0ffff8..af0cc445f 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/ra_hir_expand/src/lib.rs
@@ -19,7 +19,7 @@ use std::hash::Hash;
19use std::sync::Arc; 19use std::sync::Arc;
20 20
21use ra_db::{impl_intern_key, salsa, CrateId, FileId}; 21use ra_db::{impl_intern_key, salsa, CrateId, FileId};
22use ra_syntax::{ 22use syntax::{
23 algo, 23 algo,
24 ast::{self, AstNode}, 24 ast::{self, AstNode},
25 SyntaxNode, SyntaxToken, TextSize, 25 SyntaxNode, SyntaxToken, TextSize,
diff --git a/crates/ra_hir_expand/src/name.rs b/crates/ra_hir_expand/src/name.rs
index 969a2e5b8..4dcaff088 100644
--- a/crates/ra_hir_expand/src/name.rs
+++ b/crates/ra_hir_expand/src/name.rs
@@ -2,7 +2,7 @@
2 2
3use std::fmt; 3use std::fmt;
4 4
5use ra_syntax::{ast, SmolStr}; 5use syntax::{ast, SmolStr};
6 6
7/// `Name` is a wrapper around string, which is used in hir for both references 7/// `Name` is a wrapper around string, which is used in hir for both references
8/// and declarations. In theory, names should also carry hygiene info, but we are 8/// and declarations. In theory, names should also carry hygiene info, but we are
@@ -37,8 +37,8 @@ impl Name {
37 Name(Repr::TupleField(idx)) 37 Name(Repr::TupleField(idx))
38 } 38 }
39 39
40 pub fn new_lifetime(lt: &ra_syntax::SyntaxToken) -> Name { 40 pub fn new_lifetime(lt: &syntax::SyntaxToken) -> Name {
41 assert!(lt.kind() == ra_syntax::SyntaxKind::LIFETIME); 41 assert!(lt.kind() == syntax::SyntaxKind::LIFETIME);
42 Name(Repr::Text(lt.text().clone())) 42 Name(Repr::Text(lt.text().clone()))
43 } 43 }
44 44