summaryrefslogtreecommitdiff
path: root/support/texlab/src/features/formatting.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/src/features/formatting.rs')
-rw-r--r--support/texlab/src/features/formatting.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/support/texlab/src/features/formatting.rs b/support/texlab/src/features/formatting.rs
index c7c2dc410a..1107e5fd38 100644
--- a/support/texlab/src/features/formatting.rs
+++ b/support/texlab/src/features/formatting.rs
@@ -1,7 +1,6 @@
mod bibtex_internal;
mod latexindent;
-use cancellation::CancellationToken;
use lsp_types::{DocumentFormattingParams, TextEdit};
use crate::{BibtexFormatter, LatexFormatter};
@@ -12,17 +11,16 @@ use super::FeatureRequest;
pub fn format_source_code(
request: FeatureRequest<DocumentFormattingParams>,
- cancellation_token: &CancellationToken,
) -> Option<Vec<TextEdit>> {
let mut edits = None;
- if request.context.options.read().unwrap().bibtex_formatter == BibtexFormatter::Texlab {
- edits = edits.or_else(|| format_bibtex_internal(&request, cancellation_token));
+ if request.workspace.environment.options.bibtex_formatter == BibtexFormatter::Texlab {
+ edits = edits.or_else(|| format_bibtex_internal(&request));
}
- if request.context.options.read().unwrap().latex_formatter == LatexFormatter::Texlab {
+ if request.workspace.environment.options.latex_formatter == LatexFormatter::Texlab {
edits = edits.or_else(|| Some(vec![]));
}
- edits = edits.or_else(|| format_with_latexindent(&request, cancellation_token));
+ edits = edits.or_else(|| format_with_latexindent(&request));
edits
}