mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-05 08:00:48 +00:00
Add fn signature query
This commit is contained in:
parent
e5a6cf8153
commit
98957f4e6f
8 changed files with 86 additions and 7 deletions
|
@ -67,10 +67,7 @@ impl Path {
|
|||
|
||||
/// Converts an `ast::NameRef` into a single-identifier `Path`.
|
||||
pub fn from_name_ref(name_ref: ast::NameRef) -> Path {
|
||||
Path {
|
||||
kind: PathKind::Plain,
|
||||
segments: vec![name_ref.as_name()],
|
||||
}
|
||||
name_ref.as_name().into()
|
||||
}
|
||||
|
||||
/// `true` is this path is a single identifier, like `foo`
|
||||
|
@ -92,6 +89,15 @@ impl Path {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<Name> for Path {
|
||||
fn from(name: Name) -> Path {
|
||||
Path {
|
||||
kind: PathKind::Plain,
|
||||
segments: vec![name],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn expand_use_tree(
|
||||
prefix: Option<Path>,
|
||||
tree: ast::UseTree,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue