From 8b24f158f75e4496cfc7f8edf9aa41b10dbac9b3 Mon Sep 17 00:00:00 2001 From: Aleksander Vognild Burkow Date: Sat, 29 Dec 2018 20:09:42 +0100 Subject: Add support for formatting entire document with rustfmt Attempting to format a document when rustfmt isn't installed will result in an error being returned to the frontend. An alternative implementation would be returning zero replacements. --- crates/ra_lsp_server/src/caps.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_lsp_server/src/caps.rs') diff --git a/crates/ra_lsp_server/src/caps.rs b/crates/ra_lsp_server/src/caps.rs index 5f7038f63..8d508a3ba 100644 --- a/crates/ra_lsp_server/src/caps.rs +++ b/crates/ra_lsp_server/src/caps.rs @@ -33,7 +33,7 @@ pub fn server_capabilities() -> ServerCapabilities { workspace_symbol_provider: Some(true), code_action_provider: Some(CodeActionProviderCapability::Simple(true)), code_lens_provider: None, - document_formatting_provider: None, + document_formatting_provider: Some(true), document_range_formatting_provider: None, document_on_type_formatting_provider: Some(DocumentOnTypeFormattingOptions { first_trigger_character: "=".to_string(), -- cgit v1.2.3