10831: minor: Unnest `ide::display::navigation_target` module r=Veykril a=Veykril

This module contained multiple submodules before, but those were removed some time ago so there is no point in having this one module two layers deep anymore.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot] 2021-11-22 12:05:57 +00:00 committed by GitHub
commit c189555d98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 13 additions and 25 deletions

View File

@ -9,7 +9,7 @@ use ide_db::{
};
use syntax::{ast, AstNode, SyntaxKind::NAME, TextRange};
use crate::{display::TryToNav, goto_definition, FilePosition, NavigationTarget, RangeInfo};
use crate::{goto_definition, FilePosition, NavigationTarget, RangeInfo, TryToNav};
#[derive(Debug, Clone)]
pub struct CallItem {

View File

@ -1,5 +0,0 @@
//! This module contains utilities for turning SyntaxNodes and HIR types
//! into types that may be used to render in a UI.
pub(crate) mod navigation_target;
pub(crate) use navigation_target::{ToNav, TryToNav};

View File

@ -531,7 +531,7 @@ mod tests {
use ide_db::base_db::FileRange;
use itertools::Itertools;
use crate::{display::TryToNav, fixture};
use crate::{fixture, TryToNav};
use super::*;

View File

@ -1,8 +1,6 @@
use std::convert::TryInto;
use crate::{
display::TryToNav, doc_links::token_as_doc_comment, FilePosition, NavigationTarget, RangeInfo,
};
use crate::{doc_links::token_as_doc_comment, FilePosition, NavigationTarget, RangeInfo, TryToNav};
use hir::{AsAssocItem, Semantics};
use ide_db::{
base_db::{AnchoredPath, FileId, FileLoader},

View File

@ -7,7 +7,7 @@ use ide_db::{
use itertools::Itertools;
use syntax::{ast, AstNode, SyntaxKind::*, T};
use crate::{display::TryToNav, FilePosition, NavigationTarget, RangeInfo};
use crate::{FilePosition, NavigationTarget, RangeInfo, TryToNav};
// Feature: Go to Implementation
//

View File

@ -1,7 +1,7 @@
use ide_db::{base_db::Upcast, defs::Definition, helpers::pick_best_token, RootDatabase};
use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxToken, T};
use crate::{display::TryToNav, FilePosition, NavigationTarget, RangeInfo};
use crate::{FilePosition, NavigationTarget, RangeInfo, TryToNav};
// Feature: Go to Type Definition
//

View File

@ -14,7 +14,7 @@ use syntax::{
SyntaxNode, SyntaxToken, TextRange, T,
};
use crate::{display::TryToNav, references, NavigationTarget};
use crate::{references, NavigationTarget, TryToNav};
#[derive(PartialEq, Eq, Hash)]
pub struct HighlightedRange {

View File

@ -17,11 +17,10 @@ use itertools::Itertools;
use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxNode, SyntaxToken, T};
use crate::{
display::TryToNav,
doc_links::token_as_doc_comment,
markup::Markup,
runnables::{runnable_fn, runnable_mod},
FileId, FilePosition, NavigationTarget, RangeInfo, Runnable,
FileId, FilePosition, NavigationTarget, RangeInfo, Runnable, TryToNav,
};
#[derive(Clone, Debug, PartialEq, Eq)]

View File

@ -20,7 +20,7 @@ mod fixture;
mod markup;
mod prime_caches;
mod display;
mod navigation_target;
mod annotations;
mod call_hierarchy;
@ -68,12 +68,11 @@ use ide_db::{
};
use syntax::SourceFile;
use crate::display::ToNav;
use crate::navigation_target::{ToNav, TryToNav};
pub use crate::{
annotations::{Annotation, AnnotationConfig, AnnotationKind},
call_hierarchy::CallItem,
display::navigation_target::NavigationTarget,
expand_macro::ExpandedMacro,
file_structure::{StructureNode, StructureNodeKind},
folding_ranges::{Fold, FoldKind},
@ -83,6 +82,7 @@ pub use crate::{
join_lines::JoinLinesConfig,
markup::Markup,
move_item::Direction,
navigation_target::NavigationTarget,
prime_caches::PrimeCachesProgress,
references::ReferenceSearchResult,
rename::RenameError,

View File

@ -23,7 +23,7 @@ use syntax::{
match_ast, AstNode, SyntaxNode, TextRange, TextSize, T,
};
use crate::{display::TryToNav, FilePosition, NavigationTarget};
use crate::{FilePosition, NavigationTarget, TryToNav};
#[derive(Debug, Clone)]
pub struct ReferenceSearchResult {

View File

@ -19,10 +19,7 @@ use syntax::{
SmolStr, SyntaxNode,
};
use crate::{
display::{ToNav, TryToNav},
references, FileId, NavigationTarget,
};
use crate::{references, FileId, NavigationTarget, ToNav, TryToNav};
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub struct Runnable {

View File

@ -12,10 +12,9 @@ use rustc_hash::FxHashSet;
use syntax::{AstNode, SyntaxKind::*, T};
use syntax::{SyntaxToken, TextRange};
use crate::display::TryToNav;
use crate::hover::hover_for_definition;
use crate::{
Analysis, Fold, HoverConfig, HoverDocFormat, HoverResult, InlayHint, InlayHintsConfig,
Analysis, Fold, HoverConfig, HoverDocFormat, HoverResult, InlayHint, InlayHintsConfig, TryToNav,
};
/// A static representation of fully analyzed source code.