diff options
author | Aleksander Vognild Burkow <[email protected]> | 2018-12-29 19:09:42 +0000 |
---|---|---|
committer | Aleksander Vognild Burkow <[email protected]> | 2018-12-29 20:57:46 +0000 |
commit | 8b24f158f75e4496cfc7f8edf9aa41b10dbac9b3 (patch) | |
tree | add7a233ed590a2f66d0e702e968a4011c9d859e /crates/ra_analysis/src/lib.rs | |
parent | 2aac6b0e34ad22374c87435cf125ed4833e9f6fc (diff) |
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.
Diffstat (limited to 'crates/ra_analysis/src/lib.rs')
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 67b1c1482..9f5e9f358 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -274,6 +274,9 @@ pub struct Analysis { | |||
274 | } | 274 | } |
275 | 275 | ||
276 | impl Analysis { | 276 | impl Analysis { |
277 | pub fn file_text(&self, file_id: FileId) -> Arc<String> { | ||
278 | self.imp.file_text(file_id) | ||
279 | } | ||
277 | pub fn file_syntax(&self, file_id: FileId) -> SourceFileNode { | 280 | pub fn file_syntax(&self, file_id: FileId) -> SourceFileNode { |
278 | self.imp.file_syntax(file_id).clone() | 281 | self.imp.file_syntax(file_id).clone() |
279 | } | 282 | } |