Compare commits

...

1 Commits

Author SHA1 Message Date
Dhruv Manilawala
2dcda0b140 Show error message if ruff.configuration is invalid 2024-08-09 16:57:30 +05:30
2 changed files with 8 additions and 2 deletions

View File

@@ -62,7 +62,7 @@ impl super::SyncRequestHandler for ExecuteCommand {
for Argument { uri, version } in arguments {
let Some(snapshot) = session.take_snapshot(uri.clone()) else {
tracing::error!("Document at {uri} could not be opened");
show_err_msg!("Ruff does not recognize this file");
show_err_msg!("Ruff does not recognize the file at {uri}");
return Ok(None);
};
match command {

View File

@@ -286,7 +286,13 @@ impl<'a> ConfigurationTransformer for EditorConfigurationTransformer<'a> {
match open_configuration_file(&config_file_path, project_root) {
Ok(config_from_file) => editor_configuration.combine(config_from_file),
Err(err) => {
tracing::error!("Unable to find editor-specified configuration file: {err}");
tracing::error!(
"Error while loading options from `ruff.configuration` file at {}: {err}",
config_file_path.display()
);
show_err_msg!(
"Error while loading options from the file specified in `ruff.configuration`. Check the logs for more details."
);
editor_configuration
}
}