mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Unnest ide::display::navigation_target module
This commit is contained in:
parent
806d7d725d
commit
54b2de45e1
13 changed files with 13 additions and 25 deletions
|
@ -9,7 +9,7 @@ use ide_db::{
|
||||||
};
|
};
|
||||||
use syntax::{ast, AstNode, SyntaxKind::NAME, TextRange};
|
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)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct CallItem {
|
pub struct CallItem {
|
||||||
|
|
|
@ -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};
|
|
|
@ -531,7 +531,7 @@ mod tests {
|
||||||
use ide_db::base_db::FileRange;
|
use ide_db::base_db::FileRange;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
|
|
||||||
use crate::{display::TryToNav, fixture};
|
use crate::{fixture, TryToNav};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
|
|
||||||
use crate::{
|
use crate::{doc_links::token_as_doc_comment, FilePosition, NavigationTarget, RangeInfo, TryToNav};
|
||||||
display::TryToNav, doc_links::token_as_doc_comment, FilePosition, NavigationTarget, RangeInfo,
|
|
||||||
};
|
|
||||||
use hir::{AsAssocItem, Semantics};
|
use hir::{AsAssocItem, Semantics};
|
||||||
use ide_db::{
|
use ide_db::{
|
||||||
base_db::{AnchoredPath, FileId, FileLoader},
|
base_db::{AnchoredPath, FileId, FileLoader},
|
||||||
|
|
|
@ -7,7 +7,7 @@ use ide_db::{
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use syntax::{ast, AstNode, SyntaxKind::*, T};
|
use syntax::{ast, AstNode, SyntaxKind::*, T};
|
||||||
|
|
||||||
use crate::{display::TryToNav, FilePosition, NavigationTarget, RangeInfo};
|
use crate::{FilePosition, NavigationTarget, RangeInfo, TryToNav};
|
||||||
|
|
||||||
// Feature: Go to Implementation
|
// Feature: Go to Implementation
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use ide_db::{base_db::Upcast, defs::Definition, helpers::pick_best_token, RootDatabase};
|
use ide_db::{base_db::Upcast, defs::Definition, helpers::pick_best_token, RootDatabase};
|
||||||
use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxToken, T};
|
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
|
// Feature: Go to Type Definition
|
||||||
//
|
//
|
||||||
|
|
|
@ -14,7 +14,7 @@ use syntax::{
|
||||||
SyntaxNode, SyntaxToken, TextRange, T,
|
SyntaxNode, SyntaxToken, TextRange, T,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{display::TryToNav, references, NavigationTarget};
|
use crate::{references, NavigationTarget, TryToNav};
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Hash)]
|
#[derive(PartialEq, Eq, Hash)]
|
||||||
pub struct HighlightedRange {
|
pub struct HighlightedRange {
|
||||||
|
|
|
@ -17,11 +17,10 @@ use itertools::Itertools;
|
||||||
use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxNode, SyntaxToken, T};
|
use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxNode, SyntaxToken, T};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
display::TryToNav,
|
|
||||||
doc_links::token_as_doc_comment,
|
doc_links::token_as_doc_comment,
|
||||||
markup::Markup,
|
markup::Markup,
|
||||||
runnables::{runnable_fn, runnable_mod},
|
runnables::{runnable_fn, runnable_mod},
|
||||||
FileId, FilePosition, NavigationTarget, RangeInfo, Runnable,
|
FileId, FilePosition, NavigationTarget, RangeInfo, Runnable, TryToNav,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
|
|
|
@ -20,7 +20,7 @@ mod fixture;
|
||||||
|
|
||||||
mod markup;
|
mod markup;
|
||||||
mod prime_caches;
|
mod prime_caches;
|
||||||
mod display;
|
mod navigation_target;
|
||||||
|
|
||||||
mod annotations;
|
mod annotations;
|
||||||
mod call_hierarchy;
|
mod call_hierarchy;
|
||||||
|
@ -68,12 +68,11 @@ use ide_db::{
|
||||||
};
|
};
|
||||||
use syntax::SourceFile;
|
use syntax::SourceFile;
|
||||||
|
|
||||||
use crate::display::ToNav;
|
use crate::navigation_target::{ToNav, TryToNav};
|
||||||
|
|
||||||
pub use crate::{
|
pub use crate::{
|
||||||
annotations::{Annotation, AnnotationConfig, AnnotationKind},
|
annotations::{Annotation, AnnotationConfig, AnnotationKind},
|
||||||
call_hierarchy::CallItem,
|
call_hierarchy::CallItem,
|
||||||
display::navigation_target::NavigationTarget,
|
|
||||||
expand_macro::ExpandedMacro,
|
expand_macro::ExpandedMacro,
|
||||||
file_structure::{StructureNode, StructureNodeKind},
|
file_structure::{StructureNode, StructureNodeKind},
|
||||||
folding_ranges::{Fold, FoldKind},
|
folding_ranges::{Fold, FoldKind},
|
||||||
|
@ -83,6 +82,7 @@ pub use crate::{
|
||||||
join_lines::JoinLinesConfig,
|
join_lines::JoinLinesConfig,
|
||||||
markup::Markup,
|
markup::Markup,
|
||||||
move_item::Direction,
|
move_item::Direction,
|
||||||
|
navigation_target::NavigationTarget,
|
||||||
prime_caches::PrimeCachesProgress,
|
prime_caches::PrimeCachesProgress,
|
||||||
references::ReferenceSearchResult,
|
references::ReferenceSearchResult,
|
||||||
rename::RenameError,
|
rename::RenameError,
|
||||||
|
|
|
@ -23,7 +23,7 @@ use syntax::{
|
||||||
match_ast, AstNode, SyntaxNode, TextRange, TextSize, T,
|
match_ast, AstNode, SyntaxNode, TextRange, TextSize, T,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{display::TryToNav, FilePosition, NavigationTarget};
|
use crate::{FilePosition, NavigationTarget, TryToNav};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct ReferenceSearchResult {
|
pub struct ReferenceSearchResult {
|
||||||
|
|
|
@ -19,10 +19,7 @@ use syntax::{
|
||||||
SmolStr, SyntaxNode,
|
SmolStr, SyntaxNode,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{references, FileId, NavigationTarget, ToNav, TryToNav};
|
||||||
display::{ToNav, TryToNav},
|
|
||||||
references, FileId, NavigationTarget,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
|
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
|
||||||
pub struct Runnable {
|
pub struct Runnable {
|
||||||
|
|
|
@ -12,10 +12,9 @@ use rustc_hash::FxHashSet;
|
||||||
use syntax::{AstNode, SyntaxKind::*, T};
|
use syntax::{AstNode, SyntaxKind::*, T};
|
||||||
use syntax::{SyntaxToken, TextRange};
|
use syntax::{SyntaxToken, TextRange};
|
||||||
|
|
||||||
use crate::display::TryToNav;
|
|
||||||
use crate::hover::hover_for_definition;
|
use crate::hover::hover_for_definition;
|
||||||
use crate::{
|
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.
|
/// A static representation of fully analyzed source code.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue