Skip to main content

handle_fix

Function handle_fix 

Source
pub async fn handle_fix(
    path: Option<&Path>,
    client: &mut LspClient,
    file_tracker: &mut FileTracker,
    project_root: &Path,
    diagnostic_store: &DiagnosticStore,
) -> Result<Value>
Expand description

Apply LSP quick-fix code actions for current diagnostics.

If path is given, only fixes diagnostics for that file. Otherwise fixes all files that have diagnostics in the store.

For each diagnostic, sends textDocument/codeAction with only: ["quickfix"] and applies any returned actions that carry an embedded WorkspaceEdit.

ยงErrors

Returns an error if any LSP request or file write fails.