@@ -18,7 +18,9 @@ use ruff_workspace::{
18
18
resolver:: { ConfigurationTransformer , Relativity } ,
19
19
} ;
20
20
21
- use crate :: session:: settings:: { ConfigurationPreference , ResolvedEditorSettings } ;
21
+ use crate :: session:: settings:: {
22
+ ConfigurationPreference , ResolvedConfiguration , ResolvedEditorSettings ,
23
+ } ;
22
24
23
25
#[ derive( Debug ) ]
24
26
pub struct RuffSettings {
@@ -363,21 +365,41 @@ impl ConfigurationTransformer for EditorConfigurationTransformer<'_> {
363
365
..Configuration :: default ( )
364
366
} ;
365
367
366
- // Merge in the editor-specified configuration file, if it exists.
367
- let editor_configuration = if let Some ( config_file_path) = configuration {
368
- tracing:: debug!(
369
- "Combining settings from editor-specified configuration file at: {}" ,
370
- config_file_path. display( )
371
- ) ;
372
- match open_configuration_file ( & config_file_path) {
373
- Ok ( config_from_file) => editor_configuration. combine ( config_from_file) ,
374
- err => {
375
- tracing:: error!(
376
- "{:?}" ,
377
- err. context( "Unable to load editor-specified configuration file" )
378
- . unwrap_err( )
368
+ // Merge in the editor-specified configuration.
369
+ let editor_configuration = if let Some ( configuration) = configuration {
370
+ match configuration {
371
+ ResolvedConfiguration :: FilePath ( path) => {
372
+ tracing:: debug!(
373
+ "Combining settings from editor-specified configuration file at: {}" ,
374
+ path. display( )
375
+ ) ;
376
+ match open_configuration_file ( & path) {
377
+ Ok ( config_from_file) => editor_configuration. combine ( config_from_file) ,
378
+ err => {
379
+ tracing:: error!(
380
+ "{:?}" ,
381
+ err. context( "Unable to load editor-specified configuration file" )
382
+ . unwrap_err( )
383
+ ) ;
384
+ editor_configuration
385
+ }
386
+ }
387
+ }
388
+ ResolvedConfiguration :: Inline ( options) => {
389
+ tracing:: debug!(
390
+ "Combining settings from editor-specified inline configuration"
379
391
) ;
380
- editor_configuration
392
+ match Configuration :: from_options ( options, None , project_root) {
393
+ Ok ( configuration) => editor_configuration. combine ( configuration) ,
394
+ err => {
395
+ tracing:: error!(
396
+ "{:?}" ,
397
+ err. context( "Unable to load editor-specified configuration" )
398
+ . unwrap_err( )
399
+ ) ;
400
+ editor_configuration
401
+ }
402
+ }
381
403
}
382
404
}
383
405
} else {
0 commit comments