start descriptors -> hir rename
This commit is contained in:
parent
9f08341aa4
commit
d659b7a2f0
14 changed files with 34 additions and 27 deletions
|
@ -11,7 +11,7 @@ use rustc_hash::{FxHashMap};
|
|||
|
||||
use crate::{
|
||||
db::{self, SyntaxDatabase},
|
||||
descriptors::{
|
||||
hir::{
|
||||
module::{ModuleDescriptor}
|
||||
},
|
||||
Cancelable, FilePosition
|
||||
|
|
|
@ -10,7 +10,7 @@ use ra_syntax::{
|
|||
use crate::{
|
||||
db::RootDatabase,
|
||||
completion::CompletionItem,
|
||||
descriptors::{
|
||||
hir::{
|
||||
module::{ModuleDescriptor},
|
||||
function::FnScopes,
|
||||
Def,
|
||||
|
|
|
@ -7,7 +7,7 @@ use salsa::{self, Database};
|
|||
|
||||
use crate::{
|
||||
db,
|
||||
descriptors,
|
||||
hir,
|
||||
symbol_index::SymbolIndex,
|
||||
syntax_ptr::SyntaxPtr,
|
||||
loc2id::{IdMaps, IdDatabase},
|
||||
|
@ -122,15 +122,15 @@ salsa::database_storage! {
|
|||
fn file_symbols() for FileSymbolsQuery;
|
||||
fn resolve_syntax_ptr() for ResolveSyntaxPtrQuery;
|
||||
}
|
||||
impl descriptors::DescriptorDatabase {
|
||||
fn module_tree() for descriptors::ModuleTreeQuery;
|
||||
fn fn_scopes() for descriptors::FnScopesQuery;
|
||||
fn _file_items() for descriptors::FileItemsQuery;
|
||||
fn _file_item() for descriptors::FileItemQuery;
|
||||
fn _input_module_items() for descriptors::InputModuleItemsQuery;
|
||||
fn _item_map() for descriptors::ItemMapQuery;
|
||||
fn _fn_syntax() for descriptors::FnSyntaxQuery;
|
||||
fn _submodules() for descriptors::SubmodulesQuery;
|
||||
impl hir::DescriptorDatabase {
|
||||
fn module_tree() for hir::ModuleTreeQuery;
|
||||
fn fn_scopes() for hir::FnScopesQuery;
|
||||
fn _file_items() for hir::FileItemsQuery;
|
||||
fn _file_item() for hir::FileItemQuery;
|
||||
fn _input_module_items() for hir::InputModuleItemsQuery;
|
||||
fn _item_map() for hir::ItemMapQuery;
|
||||
fn _fn_syntax() for hir::FnSyntaxQuery;
|
||||
fn _submodules() for hir::SubmodulesQuery;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::sync::Arc;
|
|||
|
||||
use ra_syntax::ast::{AstNode, FnDef, FnDefNode};
|
||||
|
||||
use crate::descriptors::{
|
||||
use crate::hir::{
|
||||
function::{FnId, FnScopes},
|
||||
DescriptorDatabase,
|
||||
};
|
|
@ -1,3 +1,10 @@
|
|||
//! HIR (previsouly known as descriptors) provides a high-level OO acess to Rust
|
||||
//! code.
|
||||
//!
|
||||
//! The principal difference between HIR and syntax trees is that HIR is bound
|
||||
//! to a particular crate instance. That is, it has cfg flags and features
|
||||
//! applied. So, there relation between syntax and HIR is many-to-one.
|
||||
|
||||
pub(crate) mod function;
|
||||
pub(crate) mod module;
|
||||
mod path;
|
||||
|
@ -12,8 +19,8 @@ use ra_syntax::{
|
|||
use crate::{
|
||||
FileId,
|
||||
db::SyntaxDatabase,
|
||||
descriptors::function::{resolve_local_name, FnId, FnScopes},
|
||||
descriptors::module::{
|
||||
hir::function::{resolve_local_name, FnId, FnScopes},
|
||||
hir::module::{
|
||||
ModuleId, ModuleTree, ModuleSource, ModuleDescriptor,
|
||||
nameres::{ItemMap, InputModuleItems, FileItems}
|
||||
},
|
|
@ -9,7 +9,7 @@ use rustc_hash::{FxHashMap, FxHashSet};
|
|||
|
||||
use crate::{
|
||||
db,
|
||||
descriptors::DescriptorDatabase,
|
||||
hir::DescriptorDatabase,
|
||||
input::{SourceRoot, SourceRootId},
|
||||
Cancelable, FileId, FileResolverImp,
|
||||
};
|
|
@ -14,7 +14,7 @@ use relative_path::RelativePathBuf;
|
|||
|
||||
use crate::{
|
||||
db::SyntaxDatabase, syntax_ptr::SyntaxPtr, FileId, FilePosition, Cancelable,
|
||||
descriptors::{Path, PathKind, DescriptorDatabase},
|
||||
hir::{Path, PathKind, DescriptorDatabase},
|
||||
input::SourceRootId,
|
||||
arena::{Arena, Id},
|
||||
loc2id::{DefLoc, DefId},
|
|
@ -31,7 +31,7 @@ use ra_syntax::{
|
|||
use crate::{
|
||||
Cancelable, FileId,
|
||||
loc2id::{DefId, DefLoc},
|
||||
descriptors::{
|
||||
hir::{
|
||||
Path, PathKind,
|
||||
DescriptorDatabase,
|
||||
module::{ModuleId, ModuleTree, ModuleSourceNode},
|
||||
|
@ -447,7 +447,7 @@ mod tests {
|
|||
use crate::{
|
||||
AnalysisChange,
|
||||
mock_analysis::{MockAnalysis, analysis_and_position},
|
||||
descriptors::{DescriptorDatabase, module::ModuleDescriptor},
|
||||
hir::{DescriptorDatabase, module::ModuleDescriptor},
|
||||
input::FilesDatabase,
|
||||
};
|
||||
use super::*;
|
|
@ -19,7 +19,7 @@ use salsa::{Database, ParallelDatabase};
|
|||
use crate::{
|
||||
completion::{completions, CompletionItem},
|
||||
db::{self, FileSyntaxQuery, SyntaxDatabase},
|
||||
descriptors::{
|
||||
hir::{
|
||||
function::{FnDescriptor, FnId},
|
||||
module::{ModuleDescriptor, Problem},
|
||||
DeclarationDescriptor, DescriptorDatabase,
|
||||
|
@ -589,7 +589,7 @@ fn resolve_local_name(
|
|||
let fn_def = name_ref.syntax().ancestors().find_map(ast::FnDef::cast)?;
|
||||
let fn_id = FnId::get(db, file_id, fn_def);
|
||||
let scopes = db.fn_scopes(fn_id);
|
||||
let scope_entry = crate::descriptors::function::resolve_local_name(name_ref, &scopes)?;
|
||||
let scope_entry = crate::hir::function::resolve_local_name(name_ref, &scopes)?;
|
||||
let syntax = db.resolve_syntax_ptr(scope_entry.ptr().into_global(file_id));
|
||||
Some((scope_entry.name().clone(), syntax.range()))
|
||||
}
|
||||
|
|
|
@ -19,14 +19,14 @@ macro_rules! ctry {
|
|||
}
|
||||
|
||||
mod arena;
|
||||
mod syntax_ptr;
|
||||
mod input;
|
||||
mod db;
|
||||
mod loc2id;
|
||||
mod input;
|
||||
mod imp;
|
||||
mod completion;
|
||||
mod descriptors;
|
||||
mod hir;
|
||||
mod symbol_index;
|
||||
mod syntax_ptr;
|
||||
pub mod mock_analysis;
|
||||
|
||||
use std::{fmt, sync::Arc};
|
||||
|
@ -42,7 +42,7 @@ use crate::{
|
|||
|
||||
pub use crate::{
|
||||
completion::CompletionItem,
|
||||
descriptors::function::FnDescriptor,
|
||||
hir::function::FnDescriptor,
|
||||
input::{CrateGraph, CrateId, FileId, FileResolver},
|
||||
};
|
||||
pub use ra_editor::{
|
||||
|
|
|
@ -9,8 +9,8 @@ use rustc_hash::FxHashMap;
|
|||
|
||||
use crate::{
|
||||
FileId,
|
||||
descriptors::FileItemId,
|
||||
descriptors::module::ModuleId,
|
||||
hir::FileItemId,
|
||||
hir::module::ModuleId,
|
||||
syntax_ptr::SyntaxPtr,
|
||||
input::SourceRootId,
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue