This commit is contained in:
Aleksey Kladov 2019-04-11 15:51:02 +03:00
parent 6c2ba945ed
commit b6809b6695
10 changed files with 18 additions and 18 deletions

View file

@ -17,7 +17,7 @@ pub(crate) fn call_info(db: &RootDatabase, position: FilePosition) -> Option<Cal
let calling_node = FnCallNode::with_node(syntax, position.offset)?;
let name_ref = calling_node.name_ref()?;
let analyser = hir::SourceAnalyser::new(db, position.file_id, name_ref.syntax());
let analyser = hir::SourceAnalyzer::new(db, position.file_id, name_ref.syntax());
let function = match calling_node {
FnCallNode::CallExpr(expr) => {
//FIXME: apply subst

View file

@ -14,7 +14,7 @@ use crate::{db, FilePosition};
#[derive(Debug)]
pub(crate) struct CompletionContext<'a> {
pub(super) db: &'a db::RootDatabase,
pub(super) analyzer: hir::SourceAnalyser,
pub(super) analyzer: hir::SourceAnalyzer,
pub(super) offset: TextUnit,
pub(super) token: SyntaxToken<'a>,
pub(super) resolver: Resolver,
@ -50,7 +50,7 @@ impl<'a> CompletionContext<'a> {
let resolver = source_binder::resolver_for_position(db, position);
let module = source_binder::module_from_position(db, position);
let token = find_token_at_offset(original_file.syntax(), position.offset).left_biased()?;
let analyzer = hir::SourceAnalyser::new(db, position.file_id, token.parent());
let analyzer = hir::SourceAnalyzer::new(db, position.file_id, token.parent());
let mut ctx = CompletionContext {
db,
analyzer,

View file

@ -47,7 +47,7 @@ pub(crate) fn reference_definition(
) -> ReferenceResult {
use self::ReferenceResult::*;
let analyzer = hir::SourceAnalyser::new(db, file_id, name_ref.syntax());
let analyzer = hir::SourceAnalyzer::new(db, file_id, name_ref.syntax());
// Special cases:

View file

@ -132,7 +132,7 @@ pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option<String> {
.ancestors()
.take_while(|it| it.range() == leaf_node.range())
.find(|&it| ast::Expr::cast(it).is_some() || ast::Pat::cast(it).is_some())?;
let analyzer = hir::SourceAnalyser::new(db, frange.file_id, node);
let analyzer = hir::SourceAnalyzer::new(db, frange.file_id, node);
let ty = if let Some(ty) = ast::Expr::cast(node).and_then(|e| analyzer.type_of(db, e)) {
ty
} else if let Some(ty) = ast::Pat::cast(node).and_then(|p| analyzer.type_of_pat(db, p)) {