mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Merge #8023
8023: Move code to the appropriate layer r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
b39059e653
@ -1,7 +1,7 @@
|
|||||||
use hir::Semantics;
|
use hir::Semantics;
|
||||||
use ide_db::{
|
use ide_db::{
|
||||||
base_db::{FileId, FilePosition, FileRange, SourceDatabase},
|
base_db::{FileId, FilePosition, FileRange, SourceDatabase},
|
||||||
RootDatabase, StructureNodeKind, SymbolKind,
|
RootDatabase, SymbolKind,
|
||||||
};
|
};
|
||||||
use syntax::TextRange;
|
use syntax::TextRange;
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ use crate::{
|
|||||||
goto_implementation::goto_implementation,
|
goto_implementation::goto_implementation,
|
||||||
references::find_all_refs,
|
references::find_all_refs,
|
||||||
runnables::{runnables, Runnable},
|
runnables::{runnables, Runnable},
|
||||||
NavigationTarget, RunnableKind,
|
NavigationTarget, RunnableKind, StructureNodeKind,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Feature: Annotations
|
// Feature: Annotations
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use ide_db::{StructureNodeKind, SymbolKind};
|
use ide_db::SymbolKind;
|
||||||
use syntax::{
|
use syntax::{
|
||||||
ast::{self, AttrsOwner, GenericParamsOwner, NameOwner},
|
ast::{self, AttrsOwner, GenericParamsOwner, NameOwner},
|
||||||
match_ast, AstNode, AstToken, NodeOrToken, SourceFile, SyntaxNode, SyntaxToken, TextRange,
|
match_ast, AstNode, AstToken, NodeOrToken, SourceFile, SyntaxNode, SyntaxToken, TextRange,
|
||||||
@ -16,6 +16,12 @@ pub struct StructureNode {
|
|||||||
pub deprecated: bool,
|
pub deprecated: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||||
|
pub enum StructureNodeKind {
|
||||||
|
SymbolKind(SymbolKind),
|
||||||
|
Region,
|
||||||
|
}
|
||||||
|
|
||||||
// Feature: File Structure
|
// Feature: File Structure
|
||||||
//
|
//
|
||||||
// Provides a tree of the symbols defined in the file. Can be used to
|
// Provides a tree of the symbols defined in the file. Can be used to
|
||||||
|
@ -71,7 +71,7 @@ pub use crate::{
|
|||||||
diagnostics::{Diagnostic, DiagnosticsConfig, Fix, Severity},
|
diagnostics::{Diagnostic, DiagnosticsConfig, Fix, Severity},
|
||||||
display::navigation_target::NavigationTarget,
|
display::navigation_target::NavigationTarget,
|
||||||
expand_macro::ExpandedMacro,
|
expand_macro::ExpandedMacro,
|
||||||
file_structure::StructureNode,
|
file_structure::{StructureNode, StructureNodeKind},
|
||||||
folding_ranges::{Fold, FoldKind},
|
folding_ranges::{Fold, FoldKind},
|
||||||
hover::{HoverAction, HoverConfig, HoverGotoTypeData, HoverResult},
|
hover::{HoverAction, HoverConfig, HoverGotoTypeData, HoverResult},
|
||||||
inlay_hints::{InlayHint, InlayHintsConfig, InlayKind},
|
inlay_hints::{InlayHint, InlayHintsConfig, InlayKind},
|
||||||
@ -101,7 +101,7 @@ pub use ide_db::{
|
|||||||
search::{ReferenceAccess, SearchScope},
|
search::{ReferenceAccess, SearchScope},
|
||||||
source_change::{FileSystemEdit, SourceChange},
|
source_change::{FileSystemEdit, SourceChange},
|
||||||
symbol_index::Query,
|
symbol_index::Query,
|
||||||
RootDatabase,
|
RootDatabase, SymbolKind,
|
||||||
};
|
};
|
||||||
pub use ide_ssr::SsrError;
|
pub use ide_ssr::SsrError;
|
||||||
pub use syntax::{TextRange, TextSize};
|
pub use syntax::{TextRange, TextSize};
|
||||||
|
@ -135,12 +135,6 @@ fn line_index(db: &dyn LineIndexDatabase, file_id: FileId) -> Arc<LineIndex> {
|
|||||||
Arc::new(LineIndex::new(&*text))
|
Arc::new(LineIndex::new(&*text))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
|
||||||
pub enum StructureNodeKind {
|
|
||||||
SymbolKind(SymbolKind),
|
|
||||||
Region,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||||
pub enum SymbolKind {
|
pub enum SymbolKind {
|
||||||
Const,
|
Const,
|
||||||
|
@ -9,9 +9,8 @@ use ide::{
|
|||||||
CompletionRelevance, Documentation, FileId, FileRange, FileSystemEdit, Fold, FoldKind,
|
CompletionRelevance, Documentation, FileId, FileRange, FileSystemEdit, Fold, FoldKind,
|
||||||
Highlight, HlMod, HlPunct, HlRange, HlTag, Indel, InlayHint, InlayKind, InsertTextFormat,
|
Highlight, HlMod, HlPunct, HlRange, HlTag, Indel, InlayHint, InlayKind, InsertTextFormat,
|
||||||
Markup, NavigationTarget, ReferenceAccess, RenameError, Runnable, Severity, SourceChange,
|
Markup, NavigationTarget, ReferenceAccess, RenameError, Runnable, Severity, SourceChange,
|
||||||
TextEdit, TextRange, TextSize,
|
StructureNodeKind, SymbolKind, TextEdit, TextRange, TextSize,
|
||||||
};
|
};
|
||||||
use ide_db::{StructureNodeKind, SymbolKind};
|
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use serde_json::to_value;
|
use serde_json::to_value;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user