Make format_selections respect document configuration (#11169)

This commit is contained in:
arcofx 2024-07-15 16:27:42 +03:00 committed by GitHub
parent 079f544260
commit 1bad3b0dd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4523,7 +4523,11 @@ fn format_selections(cx: &mut Context) {
.text_document_range_formatting(
doc.identifier(),
range,
lsp::FormattingOptions::default(),
lsp::FormattingOptions {
tab_size: doc.tab_width() as u32,
insert_spaces: matches!(doc.indent_style, IndentStyle::Spaces(_)),
..Default::default()
},
None,
)
.unwrap();