diff options
Diffstat (limited to 'support/texlab/src/features/formatting.rs')
-rw-r--r-- | support/texlab/src/features/formatting.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/support/texlab/src/features/formatting.rs b/support/texlab/src/features/formatting.rs index 4492a0532d..c7c2dc410a 100644 --- a/support/texlab/src/features/formatting.rs +++ b/support/texlab/src/features/formatting.rs @@ -4,7 +4,7 @@ mod latexindent; use cancellation::CancellationToken; use lsp_types::{DocumentFormattingParams, TextEdit}; -use crate::BibtexFormatter; +use crate::{BibtexFormatter, LatexFormatter}; use self::{bibtex_internal::format_bibtex_internal, latexindent::format_with_latexindent}; @@ -19,6 +19,10 @@ pub fn format_source_code( edits = edits.or_else(|| format_bibtex_internal(&request, cancellation_token)); } + if request.context.options.read().unwrap().latex_formatter == LatexFormatter::Texlab { + edits = edits.or_else(|| Some(vec![])); + } + edits = edits.or_else(|| format_with_latexindent(&request, cancellation_token)); edits } |