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:
@@ -140,6 +140,9 @@ impl fmt::Debug for AnalysisImpl {
|
||||
}
|
||||
|
||||
impl AnalysisImpl {
|
||||
pub fn file_text(&self, file_id: FileId) -> Arc<String> {
|
||||
self.db.file_text(file_id)
|
||||
}
|
||||
pub fn file_syntax(&self, file_id: FileId) -> SourceFileNode {
|
||||
self.db.source_file(file_id)
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user