File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
crates/ide_completion/src Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1220,4 +1220,17 @@ fn function() {
1220
1220
"# ] ] ,
1221
1221
) ;
1222
1222
}
1223
+
1224
+ #[ test]
1225
+ fn flyimport_rename ( ) {
1226
+ check (
1227
+ r#"
1228
+ mod module {
1229
+ pub struct Struct;
1230
+ }
1231
+ use self as Str$0;
1232
+ "# ,
1233
+ expect ! [ [ r#""# ] ] ,
1234
+ ) ;
1235
+ }
1223
1236
}
Original file line number Diff line number Diff line change @@ -383,6 +383,7 @@ impl<'a> CompletionContext<'a> {
383
383
| ImmediateLocation :: ModDeclaration ( _)
384
384
| ImmediateLocation :: RecordPat ( _)
385
385
| ImmediateLocation :: RecordExpr ( _)
386
+ | ImmediateLocation :: Rename
386
387
)
387
388
)
388
389
}
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ pub(crate) enum ImmediatePrevSibling {
32
32
pub ( crate ) enum ImmediateLocation {
33
33
Use ,
34
34
UseTree ,
35
+ Rename ,
35
36
Impl ,
36
37
Trait ,
37
38
RecordField ,
@@ -201,6 +202,7 @@ pub(crate) fn determine_location(
201
202
ast:: Use ( _it) => ImmediateLocation :: Use ,
202
203
ast:: UseTree ( _it) => ImmediateLocation :: UseTree ,
203
204
ast:: UseTreeList ( _it) => ImmediateLocation :: UseTree ,
205
+ ast:: Rename ( _it) => ImmediateLocation :: Rename ,
204
206
ast:: StmtList ( _it) => ImmediateLocation :: StmtList ,
205
207
ast:: SourceFile ( _it) => ImmediateLocation :: ItemList ,
206
208
ast:: ItemList ( _it) => ImmediateLocation :: ItemList ,
You can’t perform that action at this time.
0 commit comments