From 1edec77e582b83ba97c3167c7932e8fa43e2cff0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 18 Jul 2019 20:11:05 +0300 Subject: cleanup imports --- crates/ra_ide_api/src/syntax_highlighting.rs | 9 ++++----- crates/ra_syntax/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide_api/src/syntax_highlighting.rs index d84ae2cb2..020c73c32 100644 --- a/crates/ra_ide_api/src/syntax_highlighting.rs +++ b/crates/ra_ide_api/src/syntax_highlighting.rs @@ -4,8 +4,7 @@ use hir::{Mutability, Ty}; use ra_db::SourceDatabase; use ra_prof::profile; use ra_syntax::{ - ast, AstNode, Direction, Pat, PatKind, SmolStr, SyntaxElement, SyntaxKind, SyntaxKind::*, - TextRange, T, + ast, AstNode, Direction, SmolStr, SyntaxElement, SyntaxKind, SyntaxKind::*, TextRange, T, }; use crate::{db::RootDatabase, FileId}; @@ -32,7 +31,7 @@ fn is_control_keyword(kind: SyntaxKind) -> bool { } } -fn is_variable_mutable(db: &RootDatabase, analyzer: &hir::SourceAnalyzer, pat: &Pat) -> bool { +fn is_variable_mutable(db: &RootDatabase, analyzer: &hir::SourceAnalyzer, pat: &ast::Pat) -> bool { let ty = analyzer.type_of_pat(db, pat).unwrap_or(Ty::Unknown); let is_ty_mut = { if let Some((_, mutability)) = ty.as_reference() { @@ -46,7 +45,7 @@ fn is_variable_mutable(db: &RootDatabase, analyzer: &hir::SourceAnalyzer, pat: & }; let is_pat_mut = match pat.kind() { - PatKind::BindPat(bind_pat) => bind_pat.is_mutable(), + ast::PatKind::BindPat(bind_pat) => bind_pat.is_mutable(), _ => false, }; @@ -137,7 +136,7 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec { if let Some(name) = node.as_node().and_then(ast::Name::cast) { let analyzer = hir::SourceAnalyzer::new(db, file_id, name.syntax(), None); - if let Some(pat) = name.syntax().ancestors().find_map(Pat::cast) { + if let Some(pat) = name.syntax().ancestors().find_map(ast::Pat::cast) { binding_hash = Some({ let text = name.syntax().text().to_smol_string(); let shadow_count = diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index ff347a567..0fa2fe382 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs @@ -38,7 +38,7 @@ use ra_text_edit::AtomTextEdit; use crate::syntax_node::GreenNode; pub use crate::{ - ast::{AstNode, Pat, PatKind}, + ast::{AstNode, AstToken}, parsing::{classify_literal, tokenize, Token}, ptr::{AstPtr, SyntaxNodePtr}, syntax_error::{Location, SyntaxError, SyntaxErrorKind}, -- cgit v1.2.3