1010use std:: { ffi:: OsString , path:: PathBuf } ;
1111
1212use flycheck:: FlycheckConfig ;
13+ use hir:: PrefixKind ;
1314use ide:: {
1415 AssistConfig , CompletionConfig , DiagnosticsConfig , HoverConfig , InlayHintsConfig ,
1516 MergeBehaviour ,
@@ -289,6 +290,11 @@ impl Config {
289290 MergeBehaviourDef :: Full => Some ( MergeBehaviour :: Full ) ,
290291 MergeBehaviourDef :: Last => Some ( MergeBehaviour :: Last ) ,
291292 } ;
293+ self . assist . insert_use . prefix_kind = match data. assist_importPrefix {
294+ ImportPrefixDef :: Plain => PrefixKind :: Plain ,
295+ ImportPrefixDef :: ByCrate => PrefixKind :: ByCrate ,
296+ ImportPrefixDef :: BySelf => PrefixKind :: BySelf ,
297+ } ;
292298
293299 self . call_info_full = data. callInfo_full ;
294300
@@ -403,13 +409,21 @@ enum ManifestOrProjectJson {
403409}
404410
405411#[ derive( Deserialize ) ]
406- #[ serde( rename_all = "lowercase " ) ]
412+ #[ serde( rename_all = "snake_case " ) ]
407413enum MergeBehaviourDef {
408414 None ,
409415 Full ,
410416 Last ,
411417}
412418
419+ #[ derive( Deserialize ) ]
420+ #[ serde( rename_all = "snake_case" ) ]
421+ enum ImportPrefixDef {
422+ Plain ,
423+ BySelf ,
424+ ByCrate ,
425+ }
426+
413427macro_rules! config_data {
414428 ( struct $name: ident { $( $field: ident: $ty: ty = $default: expr, ) * } ) => {
415429 #[ allow( non_snake_case) ]
@@ -434,6 +448,7 @@ macro_rules! config_data {
434448config_data ! {
435449 struct ConfigData {
436450 assist_importMergeBehaviour: MergeBehaviourDef = MergeBehaviourDef :: None ,
451+ assist_importPrefix: ImportPrefixDef = ImportPrefixDef :: Plain ,
437452
438453 callInfo_full: bool = true ,
439454
0 commit comments