From 7784cadc3dc5b669e88ca3743b6c4225a6b6213b Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Mon, 22 Mar 2021 13:39:13 +0800 Subject: Reexport PrefixKind to remove deps to hir --- crates/ide_db/src/helpers/insert_use.rs | 4 +++- crates/rust-analyzer/src/config.rs | 3 +-- crates/rust-analyzer/src/to_proto.rs | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/ide_db/src/helpers/insert_use.rs b/crates/ide_db/src/helpers/insert_use.rs index 9e0cb91c3..37acf95f0 100644 --- a/crates/ide_db/src/helpers/insert_use.rs +++ b/crates/ide_db/src/helpers/insert_use.rs @@ -14,10 +14,12 @@ use syntax::{ AstToken, InsertPosition, NodeOrToken, SyntaxElement, SyntaxNode, SyntaxToken, }; +pub use hir::PrefixKind; + #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct InsertUseConfig { pub merge: Option, - pub prefix_kind: hir::PrefixKind, + pub prefix_kind: PrefixKind, pub group: bool, } diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 8f541976e..5c88c3a9b 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -10,10 +10,9 @@ use std::{ffi::OsString, iter, path::PathBuf}; use flycheck::FlycheckConfig; -use hir::PrefixKind; use ide::{AssistConfig, CompletionConfig, DiagnosticsConfig, HoverConfig, InlayHintsConfig}; use ide_db::helpers::{ - insert_use::{InsertUseConfig, MergeBehavior}, + insert_use::{InsertUseConfig, MergeBehavior, PrefixKind}, SnippetCap, }; use lsp_types::{ClientCapabilities, MarkupKind}; diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 1ddea9278..c1ca7ff9b 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs @@ -1073,9 +1073,11 @@ pub(crate) fn rename_error(err: RenameError) -> crate::LspError { mod tests { use std::sync::Arc; - use hir::PrefixKind; use ide::Analysis; - use ide_db::helpers::{insert_use::InsertUseConfig, SnippetCap}; + use ide_db::helpers::{ + insert_use::{InsertUseConfig, PrefixKind}, + SnippetCap, + }; use super::*; -- cgit v1.2.3