mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-23 11:54:25 +00:00
**Merge Imports** assist handles self
This commit is contained in:
parent
d583f2c46d
commit
0635458a6b
3 changed files with 38 additions and 3 deletions
|
@ -24,6 +24,9 @@ pub fn ty(text: &str) -> ast::Type {
|
|||
pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment {
|
||||
ast_from_text(&format!("use {};", name_ref))
|
||||
}
|
||||
pub fn path_segment_self() -> ast::PathSegment {
|
||||
ast_from_text("use self;")
|
||||
}
|
||||
pub fn path_unqualified(segment: ast::PathSegment) -> ast::Path {
|
||||
path_from_text(&format!("use {}", segment))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue