Skip to content

Commit

Permalink
Update diagnostics_to_code_actions to take path not config
Browse files Browse the repository at this point in the history
Reviewed By: gordyf

Differential Revision: D64115055

fbshipit-source-id: 6fd8108621567422229be3d0c205ccebba3268ec
  • Loading branch information
mjmahone authored and facebook-github-bot committed Oct 9, 2024
1 parent bddf8a4 commit 2fbce1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/crates/relay-codemod/src/codemod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub async fn run_codemod(
}
}
};
let actions = relay_lsp::diagnostics_to_code_actions(config, &diagnostics);
let actions = relay_lsp::diagnostics_to_code_actions(&config.root_dir, &diagnostics);

info!(
"Codemod {:?} ran and found {} changes to make.",
Expand Down
5 changes: 2 additions & 3 deletions compiler/crates/relay-lsp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ mod status_reporter;
pub mod status_updater;
pub mod text_documents;
pub mod utils;
use std::path::Path;
use std::sync::Arc;

use code_action::get_code_actions_from_diagnostic;
Expand Down Expand Up @@ -112,11 +113,9 @@ where
}

pub fn diagnostics_to_code_actions(
config: Arc<Config>,
root_dir: &Path,
diagnostics: &[common::Diagnostic],
) -> std::vec::Vec<lsp_types::CodeActionOrCommand> {
let root_dir = &config.root_dir.clone();

// We send the diagnostics through the LSP's DiagnosticReporter to transform
// them into code actions.
// This transformation should probably be split off from the DiagnosticReporter.
Expand Down

0 comments on commit 2fbce1b

Please sign in to comment.