mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-24 13:13:43 +00:00
refactor: order of functions in link expression (#1583)
This commit is contained in:
parent
e4a4fc568f
commit
ee1c0ace46
1 changed files with 18 additions and 18 deletions
|
@ -23,6 +23,24 @@ pub fn get_link_exprs_in(node: &LinkedNode) -> Option<LinkInfo> {
|
|||
Some(worker.info)
|
||||
}
|
||||
|
||||
/// Link information in a source file.
|
||||
#[derive(Debug, Default)]
|
||||
pub struct LinkInfo {
|
||||
/// The link objects in a source file.
|
||||
pub objects: Vec<LinkObject>,
|
||||
}
|
||||
|
||||
/// A link object in a source file.
|
||||
#[derive(Debug)]
|
||||
pub struct LinkObject {
|
||||
/// The range of the link expression.
|
||||
pub range: Range<usize>,
|
||||
/// The span of the link expression.
|
||||
pub span: Span,
|
||||
/// The target of the link.
|
||||
pub target: LinkTarget,
|
||||
}
|
||||
|
||||
/// A valid link target.
|
||||
#[derive(Debug)]
|
||||
pub enum LinkTarget {
|
||||
|
@ -48,24 +66,6 @@ impl LinkTarget {
|
|||
}
|
||||
}
|
||||
|
||||
/// A link object in a source file.
|
||||
#[derive(Debug)]
|
||||
pub struct LinkObject {
|
||||
/// The range of the link expression.
|
||||
pub range: Range<usize>,
|
||||
/// The span of the link expression.
|
||||
pub span: Span,
|
||||
/// The target of the link.
|
||||
pub target: LinkTarget,
|
||||
}
|
||||
|
||||
/// Link information in a source file.
|
||||
#[derive(Debug, Default)]
|
||||
pub struct LinkInfo {
|
||||
/// The link objects in a source file.
|
||||
pub objects: Vec<LinkObject>,
|
||||
}
|
||||
|
||||
struct LinkStrWorker {
|
||||
info: LinkInfo,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue