mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-10-30 11:37:31 +00:00 
			
		
		
		
	Change import prefix default to be by crate
The current default plain, tends to create non-uniform import blocks over time, some being relative, some being absolute. I believe we should encourage a different default here.
This commit is contained in:
		
							parent
							
								
									3866336d41
								
							
						
					
					
						commit
						262fcfbc58
					
				
					 3 changed files with 3 additions and 3 deletions
				
			
		|  | @ -544,7 +544,7 @@ config_data! { | ||||||
|          /// Whether to prefer import paths containing a `prelude` module.
 |          /// Whether to prefer import paths containing a `prelude` module.
 | ||||||
|         imports_preferPrelude: bool                       = false, |         imports_preferPrelude: bool                       = false, | ||||||
|         /// The path structure for newly inserted paths to use.
 |         /// The path structure for newly inserted paths to use.
 | ||||||
|         imports_prefix: ImportPrefixDef               = ImportPrefixDef::Plain, |         imports_prefix: ImportPrefixDef               = ImportPrefixDef::ByCrate, | ||||||
|         /// Whether to prefix external (including std, core) crate imports with `::`. e.g. "use ::std::io::Read;".
 |         /// Whether to prefix external (including std, core) crate imports with `::`. e.g. "use ::std::io::Read;".
 | ||||||
|         imports_prefixExternPrelude: bool = false, |         imports_prefixExternPrelude: bool = false, | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -835,7 +835,7 @@ Whether to prefer import paths containing a `prelude` module. | ||||||
| 
 | 
 | ||||||
| ## rust-analyzer.imports.prefix {#imports.prefix} | ## rust-analyzer.imports.prefix {#imports.prefix} | ||||||
| 
 | 
 | ||||||
| Default: `"plain"` | Default: `"crate"` | ||||||
| 
 | 
 | ||||||
| The path structure for newly inserted paths to use. | The path structure for newly inserted paths to use. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1927,7 +1927,7 @@ | ||||||
|                 "properties": { |                 "properties": { | ||||||
|                     "rust-analyzer.imports.prefix": { |                     "rust-analyzer.imports.prefix": { | ||||||
|                         "markdownDescription": "The path structure for newly inserted paths to use.", |                         "markdownDescription": "The path structure for newly inserted paths to use.", | ||||||
|                         "default": "plain", |                         "default": "crate", | ||||||
|                         "type": "string", |                         "type": "string", | ||||||
|                         "enum": [ |                         "enum": [ | ||||||
|                             "plain", |                             "plain", | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lukas Wirth
						Lukas Wirth