From a1c187eef3ba08076aedb5154929f7eda8d1b424 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 18:26:51 +0200 Subject: Rename ra_syntax -> syntax --- crates/ra_hir_def/Cargo.toml | 2 +- crates/ra_hir_def/src/adt.rs | 2 +- crates/ra_hir_def/src/attr.rs | 2 +- crates/ra_hir_def/src/body.rs | 2 +- crates/ra_hir_def/src/body/lower.rs | 4 +- crates/ra_hir_def/src/body/scope.rs | 2 +- crates/ra_hir_def/src/data.rs | 2 +- crates/ra_hir_def/src/db.rs | 2 +- crates/ra_hir_def/src/diagnostics.rs | 2 +- crates/ra_hir_def/src/docs.rs | 2 +- crates/ra_hir_def/src/expr.rs | 4 +- crates/ra_hir_def/src/find_path.rs | 23 ++++---- crates/ra_hir_def/src/generics.rs | 2 +- crates/ra_hir_def/src/import_map.rs | 2 +- crates/ra_hir_def/src/item_tree.rs | 2 +- crates/ra_hir_def/src/item_tree/lower.rs | 4 +- crates/ra_hir_def/src/item_tree/tests.rs | 62 +++++++++++----------- crates/ra_hir_def/src/keys.rs | 2 +- crates/ra_hir_def/src/lang_item.rs | 2 +- crates/ra_hir_def/src/lib.rs | 2 +- crates/ra_hir_def/src/nameres.rs | 4 +- crates/ra_hir_def/src/nameres/collector.rs | 2 +- crates/ra_hir_def/src/nameres/mod_resolution.rs | 2 +- .../ra_hir_def/src/nameres/tests/mod_resolution.rs | 2 +- crates/ra_hir_def/src/path.rs | 2 +- crates/ra_hir_def/src/path/lower.rs | 2 +- crates/ra_hir_def/src/path/lower/lower_use.rs | 2 +- crates/ra_hir_def/src/type_ref.rs | 2 +- crates/ra_hir_def/src/visibility.rs | 2 +- 29 files changed, 72 insertions(+), 75 deletions(-) (limited to 'crates/ra_hir_def') diff --git a/crates/ra_hir_def/Cargo.toml b/crates/ra_hir_def/Cargo.toml index 1a080a8b4..38129782f 100644 --- a/crates/ra_hir_def/Cargo.toml +++ b/crates/ra_hir_def/Cargo.toml @@ -24,7 +24,7 @@ stdx = { path = "../stdx" } arena = { path = "../arena" } ra_db = { path = "../ra_db" } -ra_syntax = { path = "../ra_syntax" } +syntax = { path = "../syntax" } profile = { path = "../profile" } hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } test_utils = { path = "../test_utils" } diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs index 896a69ca8..c83219d77 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/ra_hir_def/src/adt.rs @@ -8,7 +8,7 @@ use hir_expand::{ name::{AsName, Name}, InFile, }; -use ra_syntax::ast::{self, NameOwner, VisibilityOwner}; +use syntax::ast::{self, NameOwner, VisibilityOwner}; use tt::{Delimiter, DelimiterKind, Leaf, Subtree, TokenTree}; use crate::{ diff --git a/crates/ra_hir_def/src/attr.rs b/crates/ra_hir_def/src/attr.rs index 050832ce0..36dc8b816 100644 --- a/crates/ra_hir_def/src/attr.rs +++ b/crates/ra_hir_def/src/attr.rs @@ -6,7 +6,7 @@ use either::Either; use hir_expand::{hygiene::Hygiene, AstId, InFile}; use mbe::ast_to_token_tree; use ra_cfg::{CfgExpr, CfgOptions}; -use ra_syntax::{ +use syntax::{ ast::{self, AstNode, AttrsOwner}, SmolStr, }; diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 1deb1a837..7c33966a7 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs @@ -11,8 +11,8 @@ use either::Either; use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId}; use ra_cfg::CfgOptions; use ra_db::CrateId; -use ra_syntax::{ast, AstNode, AstPtr}; use rustc_hash::FxHashMap; +use syntax::{ast, AstNode, AstPtr}; use test_utils::mark; pub(crate) use lower::LowerCtx; diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 482393006..a26251cde 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -10,14 +10,14 @@ use hir_expand::{ name::{name, AsName, Name}, HirFileId, MacroDefId, MacroDefKind, }; -use ra_syntax::{ +use rustc_hash::FxHashMap; +use syntax::{ ast::{ self, ArgListOwner, ArrayExprKind, AstChildren, LiteralKind, LoopBodyOwner, NameOwner, SlicePatComponents, }, AstNode, AstPtr, }; -use rustc_hash::FxHashMap; use test_utils::mark; use crate::{ diff --git a/crates/ra_hir_def/src/body/scope.rs b/crates/ra_hir_def/src/body/scope.rs index f783e18b5..079f14c29 100644 --- a/crates/ra_hir_def/src/body/scope.rs +++ b/crates/ra_hir_def/src/body/scope.rs @@ -171,7 +171,7 @@ fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope mod tests { use hir_expand::{name::AsName, InFile}; use ra_db::{fixture::WithFixture, FileId, SourceDatabase}; - use ra_syntax::{algo::find_node_at_offset, ast, AstNode}; + use syntax::{algo::find_node_at_offset, ast, AstNode}; use test_utils::{assert_eq_text, extract_offset, mark}; use crate::{db::DefDatabase, test_db::TestDB, FunctionId, ModuleDefId}; diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs index 758c12f33..9a8eb4ede 100644 --- a/crates/ra_hir_def/src/data.rs +++ b/crates/ra_hir_def/src/data.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use hir_expand::{name::Name, InFile}; -use ra_syntax::ast; +use syntax::ast; use crate::{ attr::Attrs, diff --git a/crates/ra_hir_def/src/db.rs b/crates/ra_hir_def/src/db.rs index 1dd4197f8..a925548b5 100644 --- a/crates/ra_hir_def/src/db.rs +++ b/crates/ra_hir_def/src/db.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use hir_expand::{db::AstDatabase, HirFileId}; use ra_db::{salsa, CrateId, SourceDatabase, Upcast}; -use ra_syntax::SmolStr; +use syntax::SmolStr; use crate::{ adt::{EnumData, StructData}, diff --git a/crates/ra_hir_def/src/diagnostics.rs b/crates/ra_hir_def/src/diagnostics.rs index 71d177070..2e38a978f 100644 --- a/crates/ra_hir_def/src/diagnostics.rs +++ b/crates/ra_hir_def/src/diagnostics.rs @@ -3,7 +3,7 @@ use std::any::Any; use hir_expand::diagnostics::Diagnostic; -use ra_syntax::{ast, AstPtr, SyntaxNodePtr}; +use syntax::{ast, AstPtr, SyntaxNodePtr}; use hir_expand::{HirFileId, InFile}; diff --git a/crates/ra_hir_def/src/docs.rs b/crates/ra_hir_def/src/docs.rs index 2630b3d89..e9a02b11b 100644 --- a/crates/ra_hir_def/src/docs.rs +++ b/crates/ra_hir_def/src/docs.rs @@ -6,7 +6,7 @@ use std::sync::Arc; use either::Either; -use ra_syntax::ast; +use syntax::ast; use crate::{ db::DefDatabase, diff --git a/crates/ra_hir_def/src/expr.rs b/crates/ra_hir_def/src/expr.rs index befe41c2a..c94b3a36f 100644 --- a/crates/ra_hir_def/src/expr.rs +++ b/crates/ra_hir_def/src/expr.rs @@ -14,7 +14,7 @@ use arena::{Idx, RawId}; use hir_expand::name::Name; -use ra_syntax::ast::RangeOp; +use syntax::ast::RangeOp; use crate::{ builtin_type::{BuiltinFloat, BuiltinInt}, @@ -197,7 +197,7 @@ pub enum ArithOp { BitAnd, } -pub use ra_syntax::ast::PrefixOp as UnaryOp; +pub use syntax::ast::PrefixOp as UnaryOp; #[derive(Debug, Clone, Eq, PartialEq)] pub enum Array { ElementList(Vec), diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/ra_hir_def/src/find_path.rs index 46e70eb48..5099f417d 100644 --- a/crates/ra_hir_def/src/find_path.rs +++ b/crates/ra_hir_def/src/find_path.rs @@ -294,7 +294,7 @@ fn find_local_import_locations( mod tests { use hir_expand::hygiene::Hygiene; use ra_db::fixture::WithFixture; - use ra_syntax::ast::AstNode; + use syntax::ast::AstNode; use test_utils::mark; use crate::test_db::TestDB; @@ -307,12 +307,9 @@ mod tests { fn check_found_path(ra_fixture: &str, path: &str) { let (db, pos) = TestDB::with_position(ra_fixture); let module = db.module_for_file(pos.file_id); - let parsed_path_file = ra_syntax::SourceFile::parse(&format!("use {};", path)); - let ast_path = parsed_path_file - .syntax_node() - .descendants() - .find_map(ra_syntax::ast::Path::cast) - .unwrap(); + let parsed_path_file = syntax::SourceFile::parse(&format!("use {};", path)); + let ast_path = + parsed_path_file.syntax_node().descendants().find_map(syntax::ast::Path::cast).unwrap(); let mod_path = ModPath::from_src(ast_path, &Hygiene::new_unhygienic()).unwrap(); let crate_def_map = db.crate_def_map(module.krate); @@ -441,12 +438,12 @@ mod tests { // already in scope. check_found_path( r#" - //- /main.rs crate:main deps:ra_syntax + //- /main.rs crate:main deps:syntax - use ra_syntax::ast; + use syntax::ast; <|> - //- /lib.rs crate:ra_syntax + //- /lib.rs crate:syntax pub mod ast { pub enum ModuleItem { A, B, C, @@ -458,18 +455,18 @@ mod tests { check_found_path( r#" - //- /main.rs crate:main deps:ra_syntax + //- /main.rs crate:main deps:syntax <|> - //- /lib.rs crate:ra_syntax + //- /lib.rs crate:syntax pub mod ast { pub enum ModuleItem { A, B, C, } } "#, - "ra_syntax::ast::ModuleItem", + "syntax::ast::ModuleItem", ); } diff --git a/crates/ra_hir_def/src/generics.rs b/crates/ra_hir_def/src/generics.rs index 0e06a0b12..4476f0316 100644 --- a/crates/ra_hir_def/src/generics.rs +++ b/crates/ra_hir_def/src/generics.rs @@ -11,7 +11,7 @@ use hir_expand::{ InFile, }; use ra_db::FileId; -use ra_syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; +use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; use crate::{ body::LowerCtx, diff --git a/crates/ra_hir_def/src/import_map.rs b/crates/ra_hir_def/src/import_map.rs index 3a9eec887..431ff30ab 100644 --- a/crates/ra_hir_def/src/import_map.rs +++ b/crates/ra_hir_def/src/import_map.rs @@ -5,9 +5,9 @@ use std::{cmp::Ordering, fmt, hash::BuildHasherDefault, sync::Arc}; use fst::{self, Streamer}; use indexmap::{map::Entry, IndexMap}; use ra_db::CrateId; -use ra_syntax::SmolStr; use rustc_hash::{FxHashMap, FxHasher}; use smallvec::SmallVec; +use syntax::SmolStr; use crate::{ db::DefDatabase, diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 104966c7f..e14722cae 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -22,9 +22,9 @@ use hir_expand::{ name::{name, AsName, Name}, HirFileId, InFile, }; -use ra_syntax::{ast, match_ast}; use rustc_hash::FxHashMap; use smallvec::SmallVec; +use syntax::{ast, match_ast}; use test_utils::mark; use crate::{ diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index 4523d0fbb..391ab5d39 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs @@ -4,11 +4,11 @@ use std::{collections::hash_map::Entry, mem, sync::Arc}; use arena::map::ArenaMap; use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, HirFileId}; -use ra_syntax::{ +use smallvec::SmallVec; +use syntax::{ ast::{self, ModuleItemOwner}, SyntaxNode, }; -use smallvec::SmallVec; use crate::{ attr::Attrs, diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/ra_hir_def/src/item_tree/tests.rs index a81497fa8..6c843e339 100644 --- a/crates/ra_hir_def/src/item_tree/tests.rs +++ b/crates/ra_hir_def/src/item_tree/tests.rs @@ -1,10 +1,10 @@ use expect::{expect, Expect}; use hir_expand::{db::AstDatabase, HirFileId, InFile}; use ra_db::fixture::WithFixture; -use ra_syntax::{ast, AstNode}; use rustc_hash::FxHashSet; use std::sync::Arc; use stdx::format_to; +use syntax::{ast, AstNode}; use crate::{db::DefDatabase, test_db::TestDB}; @@ -228,31 +228,31 @@ fn smoke() { top-level items: #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_on_use"))] }, input: None }]) }] - Import { path: ModPath { kind: Plain, segments: [Name(Text("a"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_glob: false, is_prelude: false, ast_id: FileAstId::(0) } + Import { path: ModPath { kind: Plain, segments: [Name(Text("a"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_glob: false, is_prelude: false, ast_id: FileAstId::(0) } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_on_use"))] }, input: None }]) }] - Import { path: ModPath { kind: Plain, segments: [Name(Text("b"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_glob: true, is_prelude: false, ast_id: FileAstId::(0) } + Import { path: ModPath { kind: Plain, segments: [Name(Text("b"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_glob: true, is_prelude: false, ast_id: FileAstId::(0) } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("ext_crate"))] }, input: None }]) }] - ExternCrate { path: ModPath { kind: Plain, segments: [Name(Text("krate"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_macro_use: false, ast_id: FileAstId::(1) } + ExternCrate { path: ModPath { kind: Plain, segments: [Name(Text("krate"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_macro_use: false, ast_id: FileAstId::(1) } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_trait"))] }, input: None }]) }] - Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [TypeAlias(Idx::(0)), Const(Idx::(0)), Function(Idx::(0)), Function(Idx::(1))], ast_id: FileAstId::(2) } + Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [TypeAlias(Idx::(0)), Const(Idx::(0)), Function(Idx::(0)), Function(Idx::(1))], ast_id: FileAstId::(2) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_ty"))] }, input: None }]) }] - > TypeAlias { name: Name(Text("AssocTy")), visibility: RawVisibilityId("pub(self)"), bounds: [Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Tr"))] }, generic_args: [Some(GenericArgs { args: [Type(Tuple([]))], has_self_type: false, bindings: [] })] })], generic_params: GenericParamsId(4294967295), type_ref: None, ast_id: FileAstId::(8) } + > TypeAlias { name: Name(Text("AssocTy")), visibility: RawVisibilityId("pub(self)"), bounds: [Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Tr"))] }, generic_args: [Some(GenericArgs { args: [Type(Tuple([]))], has_self_type: false, bindings: [] })] })], generic_params: GenericParamsId(4294967295), type_ref: None, ast_id: FileAstId::(8) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_const"))] }, input: None }]) }] - > Const { name: Some(Name(Text("CONST"))), visibility: RawVisibilityId("pub(self)"), type_ref: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("u8"))] }, generic_args: [None] }), ast_id: FileAstId::(9) } + > Const { name: Some(Name(Text("CONST"))), visibility: RawVisibilityId("pub(self)"), type_ref: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("u8"))] }, generic_args: [None] }), ast_id: FileAstId::(9) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_method"))] }, input: None }]) }] - > Function { name: Name(Text("method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Shared)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(10) } + > Function { name: Name(Text("method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Shared)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(10) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_dfl_method"))] }, input: None }]) }] - > Function { name: Name(Text("dfl_method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Mut)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(11) } + > Function { name: Name(Text("dfl_method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Mut)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(11) } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }] - Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::(3), kind: Unit } + Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::(3), kind: Unit } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }] - Struct { name: Name(Text("Struct1")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(2), fields: Tuple(IdRange::(0..1)), ast_id: FileAstId::(4), kind: Tuple } + Struct { name: Name(Text("Struct1")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(2), fields: Tuple(IdRange::(0..1)), ast_id: FileAstId::(4), kind: Tuple } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct2"))] }, input: None }]) }] - Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::(1..2)), ast_id: FileAstId::(5), kind: Record } + Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::(1..2)), ast_id: FileAstId::(5), kind: Record } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("en"))] }, input: None }]) }] - Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::(0..1), ast_id: FileAstId::(6) } + Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::(0..1), ast_id: FileAstId::(6) } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("un"))] }, input: None }]) }] - Union { name: Name(Text("Un")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), fields: Record(IdRange::(3..4)), ast_id: FileAstId::(7) } + Union { name: Name(Text("Un")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), fields: Record(IdRange::(3..4)), ast_id: FileAstId::(7) } "##]], ); } @@ -274,13 +274,13 @@ fn simple_inner_items() { inner attrs: Attrs { entries: None } top-level items: - Impl { generic_params: GenericParamsId(0), target_trait: Some(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("D"))] }, generic_args: [None] })), target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Response"))] }, generic_args: [Some(GenericArgs { args: [Type(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("T"))] }, generic_args: [None] }))], has_self_type: false, bindings: [] })] }), is_negative: false, items: [Function(Idx::(1))], ast_id: FileAstId::(0) } - > Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } + Impl { generic_params: GenericParamsId(0), target_trait: Some(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("D"))] }, generic_args: [None] })), target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Response"))] }, generic_args: [Some(GenericArgs { args: [Type(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("T"))] }, generic_args: [None] }))], has_self_type: false, bindings: [] })] }), is_negative: false, items: [Function(Idx::(1))], ast_id: FileAstId::(0) } + > Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } inner items: - for AST FileAstId::(2): - Function { name: Name(Text("end")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } + for AST FileAstId::(2): + Function { name: Name(Text("end")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } "#]], ); @@ -303,9 +303,9 @@ fn extern_attrs() { top-level items: #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }, Attr { path: ModPath { kind: Plain, segments: [Name(Text("block_attr"))] }, input: None }]) }] - Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } + Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }, Attr { path: ModPath { kind: Plain, segments: [Name(Text("block_attr"))] }, input: None }]) }] - Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } + Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } "##]], ); } @@ -327,11 +327,11 @@ fn trait_attrs() { top-level items: #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("trait_attr"))] }, input: None }]) }] - Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [Function(Idx::(0)), Function(Idx::(1))], ast_id: FileAstId::(0) } + Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [Function(Idx::(0)), Function(Idx::(1))], ast_id: FileAstId::(0) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }] - > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } + > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }] - > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } + > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } "##]], ); } @@ -353,11 +353,11 @@ fn impl_attrs() { top-level items: #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("impl_attr"))] }, input: None }]) }] - Impl { generic_params: GenericParamsId(4294967295), target_trait: None, target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Ty"))] }, generic_args: [None] }), is_negative: false, items: [Function(Idx::(0)), Function(Idx::(1))], ast_id: FileAstId::(0) } + Impl { generic_params: GenericParamsId(4294967295), target_trait: None, target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Ty"))] }, generic_args: [None] }), is_negative: false, items: [Function(Idx::(0)), Function(Idx::(1))], ast_id: FileAstId::(0) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }] - > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } + > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }] - > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } + > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } "##]], ); } @@ -408,13 +408,13 @@ fn inner_item_attrs() { inner attrs: Attrs { entries: None } top-level items: - Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(0) } + Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(0) } inner items: - for AST FileAstId::(1): + for AST FileAstId::(1): #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_inner"))] }, input: None }]) }] - Function { name: Name(Text("inner")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } + Function { name: Name(Text("inner")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } "##]], ); @@ -432,8 +432,8 @@ fn assoc_item_macros() { inner attrs: Attrs { entries: None } top-level items: - Impl { generic_params: GenericParamsId(4294967295), target_trait: None, target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("S"))] }, generic_args: [None] }), is_negative: false, items: [MacroCall(Idx::(0))], ast_id: FileAstId::(0) } - > MacroCall { name: None, path: ModPath { kind: Plain, segments: [Name(Text("items"))] }, is_export: false, is_local_inner: false, is_builtin: false, ast_id: FileAstId::(1) } + Impl { generic_params: GenericParamsId(4294967295), target_trait: None, target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("S"))] }, generic_args: [None] }), is_negative: false, items: [MacroCall(Idx::(0))], ast_id: FileAstId::(0) } + > MacroCall { name: None, path: ModPath { kind: Plain, segments: [Name(Text("items"))] }, is_export: false, is_local_inner: false, is_builtin: false, ast_id: FileAstId::(1) } "#]], ); } diff --git a/crates/ra_hir_def/src/keys.rs b/crates/ra_hir_def/src/keys.rs index 441bdbead..40a5d92b5 100644 --- a/crates/ra_hir_def/src/keys.rs +++ b/crates/ra_hir_def/src/keys.rs @@ -3,8 +3,8 @@ use std::marker::PhantomData; use hir_expand::{InFile, MacroDefId}; -use ra_syntax::{ast, AstNode, AstPtr}; use rustc_hash::FxHashMap; +use syntax::{ast, AstNode, AstPtr}; use crate::{ dyn_map::{DynMap, Policy}, diff --git a/crates/ra_hir_def/src/lang_item.rs b/crates/ra_hir_def/src/lang_item.rs index 3631499bf..063eadccb 100644 --- a/crates/ra_hir_def/src/lang_item.rs +++ b/crates/ra_hir_def/src/lang_item.rs @@ -4,8 +4,8 @@ //! features, such as Fn family of traits. use std::sync::Arc; -use ra_syntax::SmolStr; use rustc_hash::FxHashMap; +use syntax::SmolStr; use crate::{ db::DefDatabase, AdtId, AttrDefId, CrateId, EnumId, FunctionId, ImplId, ModuleDefId, ModuleId, diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index 810393739..806ac731f 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs @@ -58,7 +58,7 @@ use hir_expand::{ MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, }; use ra_db::{impl_intern_key, salsa, CrateId}; -use ra_syntax::ast; +use syntax::ast; use crate::builtin_type::BuiltinType; use item_tree::{ diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs index dc239997f..d26c837cc 100644 --- a/crates/ra_hir_def/src/nameres.rs +++ b/crates/ra_hir_def/src/nameres.rs @@ -59,9 +59,9 @@ use std::sync::Arc; use arena::Arena; use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile}; use ra_db::{CrateId, Edition, FileId}; -use ra_syntax::ast; use rustc_hash::FxHashMap; use stdx::format_to; +use syntax::ast; use crate::{ db::DefDatabase, @@ -288,7 +288,7 @@ pub enum ModuleSource { mod diagnostics { use hir_expand::diagnostics::DiagnosticSink; - use ra_syntax::{ast, AstPtr}; + use syntax::{ast, AstPtr}; use crate::{db::DefDatabase, diagnostics::UnresolvedModule, nameres::LocalModuleId, AstId}; diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 52ee401d9..f7270ec91 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs @@ -13,8 +13,8 @@ use hir_expand::{ }; use ra_cfg::CfgOptions; use ra_db::{CrateId, FileId, ProcMacroId}; -use ra_syntax::ast; use rustc_hash::FxHashMap; +use syntax::ast; use test_utils::mark; use crate::{ diff --git a/crates/ra_hir_def/src/nameres/mod_resolution.rs b/crates/ra_hir_def/src/nameres/mod_resolution.rs index 953961632..316245d6b 100644 --- a/crates/ra_hir_def/src/nameres/mod_resolution.rs +++ b/crates/ra_hir_def/src/nameres/mod_resolution.rs @@ -1,7 +1,7 @@ //! This module resolves `mod foo;` declaration to file. use hir_expand::name::Name; use ra_db::FileId; -use ra_syntax::SmolStr; +use syntax::SmolStr; use crate::{db::DefDatabase, HirFileId}; diff --git a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs b/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs index ae58948c4..1f619787e 100644 --- a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs +++ b/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs @@ -698,7 +698,7 @@ fn unresolved_module_diagnostics() { ), ), ), - value: FileAstId::(1), + value: FileAstId::(1), }, candidate: "bar.rs", }, diff --git a/crates/ra_hir_def/src/path.rs b/crates/ra_hir_def/src/path.rs index cc1726e9e..88be07c8a 100644 --- a/crates/ra_hir_def/src/path.rs +++ b/crates/ra_hir_def/src/path.rs @@ -13,7 +13,7 @@ use hir_expand::{ name::{AsName, Name}, }; use ra_db::CrateId; -use ra_syntax::ast; +use syntax::ast; use crate::{ type_ref::{TypeBound, TypeRef}, diff --git a/crates/ra_hir_def/src/path/lower.rs b/crates/ra_hir_def/src/path/lower.rs index d09fc66e4..07b9723ce 100644 --- a/crates/ra_hir_def/src/path/lower.rs +++ b/crates/ra_hir_def/src/path/lower.rs @@ -9,7 +9,7 @@ use hir_expand::{ hygiene::Hygiene, name::{name, AsName}, }; -use ra_syntax::ast::{self, AstNode, TypeBoundsOwner}; +use syntax::ast::{self, AstNode, TypeBoundsOwner}; use super::AssociatedTypeBinding; use crate::{ diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/ra_hir_def/src/path/lower/lower_use.rs index 794be45e8..53cecb05f 100644 --- a/crates/ra_hir_def/src/path/lower/lower_use.rs +++ b/crates/ra_hir_def/src/path/lower/lower_use.rs @@ -5,7 +5,7 @@ use std::iter; use either::Either; use hir_expand::{hygiene::Hygiene, name::AsName}; -use ra_syntax::ast::{self, NameOwner}; +use syntax::ast::{self, NameOwner}; use test_utils::mark; use crate::path::{ImportAlias, ModPath, PathKind}; diff --git a/crates/ra_hir_def/src/type_ref.rs b/crates/ra_hir_def/src/type_ref.rs index 6f7884ffe..1a78c1444 100644 --- a/crates/ra_hir_def/src/type_ref.rs +++ b/crates/ra_hir_def/src/type_ref.rs @@ -1,6 +1,6 @@ //! HIR for references to types. Paths in these are not yet resolved. They can //! be directly created from an ast::TypeRef, without further queries. -use ra_syntax::ast::{self}; +use syntax::ast::{self}; use crate::{body::LowerCtx, path::Path}; diff --git a/crates/ra_hir_def/src/visibility.rs b/crates/ra_hir_def/src/visibility.rs index 1abffb4c3..e6e0853a3 100644 --- a/crates/ra_hir_def/src/visibility.rs +++ b/crates/ra_hir_def/src/visibility.rs @@ -1,7 +1,7 @@ //! Defines hir-level representation of visibility (e.g. `pub` and `pub(crate)`). use hir_expand::{hygiene::Hygiene, InFile}; -use ra_syntax::ast; +use syntax::ast; use crate::{ db::DefDatabase, -- cgit v1.2.3