mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Move structure to display/structure
This commit is contained in:
parent
027d4d229d
commit
7821c56be7
4 changed files with 9 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
//! This module contains utilities for rendering turning things into something
|
//! This module contains utilities for turning SyntaxNodes and HIR types
|
||||||
//! that may be used to render in UI.
|
//! into things that may be used to render in a UI.
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::fmt::{self, Display};
|
use std::fmt::{self, Display};
|
||||||
use join_to_string::join;
|
use join_to_string::join;
|
||||||
|
@ -8,8 +8,10 @@ use std::convert::From;
|
||||||
use hir::Docs;
|
use hir::Docs;
|
||||||
|
|
||||||
pub mod navigation_target;
|
pub mod navigation_target;
|
||||||
|
pub mod structure;
|
||||||
|
|
||||||
pub use navigation_target::NavigationTarget;
|
pub use navigation_target::NavigationTarget;
|
||||||
|
pub use structure::StructureNode;
|
||||||
|
|
||||||
pub(crate) fn function_label(node: &ast::FnDef) -> String {
|
pub(crate) fn function_label(node: &ast::FnDef) -> String {
|
||||||
FunctionSignature::from(node).to_string()
|
FunctionSignature::from(node).to_string()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
created: "2019-02-05T22:03:50.763530100Z"
|
created: "2019-04-08T09:44:50.196004400Z"
|
||||||
creator: insta@0.6.1
|
creator: insta@0.7.4
|
||||||
source: crates/ra_ide_api/src/structure.rs
|
source: crates/ra_ide_api/src/display/structure.rs
|
||||||
expression: structure
|
expression: structure
|
||||||
---
|
---
|
||||||
[
|
[
|
|
@ -33,7 +33,6 @@ mod folding_ranges;
|
||||||
mod line_index;
|
mod line_index;
|
||||||
mod line_index_utils;
|
mod line_index_utils;
|
||||||
mod join_lines;
|
mod join_lines;
|
||||||
mod structure;
|
|
||||||
mod typing;
|
mod typing;
|
||||||
mod matching_brace;
|
mod matching_brace;
|
||||||
mod display;
|
mod display;
|
||||||
|
@ -69,9 +68,8 @@ pub use crate::{
|
||||||
line_index_utils::translate_offset_with_edit,
|
line_index_utils::translate_offset_with_edit,
|
||||||
folding_ranges::{Fold, FoldKind},
|
folding_ranges::{Fold, FoldKind},
|
||||||
syntax_highlighting::HighlightedRange,
|
syntax_highlighting::HighlightedRange,
|
||||||
structure::{StructureNode, file_structure},
|
|
||||||
diagnostics::Severity,
|
diagnostics::Severity,
|
||||||
display::{FunctionSignature, NavigationTarget},
|
display::{FunctionSignature, NavigationTarget, structure::{StructureNode, file_structure}},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use ra_db::{
|
pub use ra_db::{
|
||||||
|
@ -385,7 +383,7 @@ impl Analysis {
|
||||||
/// file outline.
|
/// file outline.
|
||||||
pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> {
|
pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> {
|
||||||
let file = self.db.parse(file_id);
|
let file = self.db.parse(file_id);
|
||||||
structure::file_structure(&file)
|
file_structure(&file)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the set of folding ranges.
|
/// Returns the set of folding ranges.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue