mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
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.
This commit is contained in:
parent
2aac6b0e34
commit
8b24f158f7
6 changed files with 95 additions and 3 deletions
|
@ -274,6 +274,9 @@ pub struct Analysis {
|
|||
}
|
||||
|
||||
impl Analysis {
|
||||
pub fn file_text(&self, file_id: FileId) -> Arc<String> {
|
||||
self.imp.file_text(file_id)
|
||||
}
|
||||
pub fn file_syntax(&self, file_id: FileId) -> SourceFileNode {
|
||||
self.imp.file_syntax(file_id).clone()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue