From afeaea7051a41269043b1443b9db1e8e44aa4a3e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 May 2019 16:34:23 +0300 Subject: drop error from SOurceFile constructor --- crates/ra_syntax/src/lib.rs | 8 ++++---- crates/ra_syntax/src/syntax_node.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 6a4f3ff13..f765f621b 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs @@ -74,7 +74,7 @@ impl Parse { pub use crate::ast::SourceFile; impl SourceFile { - fn new(green: GreenNode, _errors: Vec) -> TreeArc { + fn new(green: GreenNode) -> TreeArc { let root = SyntaxNode::new(green); if cfg!(debug_assertions) { validation::validate_block_structure(&root); @@ -84,8 +84,8 @@ impl SourceFile { } pub fn parse(text: &str) -> TreeArc { - let (green, errors) = parsing::parse_text(text); - SourceFile::new(green, errors) + let (green, _errors) = parsing::parse_text(text); + SourceFile::new(green) } pub fn reparse(&self, edit: &AtomTextEdit) -> TreeArc { @@ -94,7 +94,7 @@ impl SourceFile { pub fn incremental_reparse(&self, edit: &AtomTextEdit) -> Option> { parsing::incremental_reparse(self.syntax(), edit, self.errors()) - .map(|(green_node, errors, _reparsed_range)| SourceFile::new(green_node, errors)) + .map(|(green_node, _errors, _reparsed_range)| SourceFile::new(green_node)) } fn full_reparse(&self, edit: &AtomTextEdit) -> TreeArc { diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs index 3a9b3ec2f..ef7a51686 100644 --- a/crates/ra_syntax/src/syntax_node.rs +++ b/crates/ra_syntax/src/syntax_node.rs @@ -383,7 +383,7 @@ impl SyntaxNode { let len = new_children.iter().map(|it| it.text_len()).sum::(); let new_node = GreenNode::new(rowan::SyntaxKind(self.kind() as u16), new_children); let new_file_node = self.replace_with(new_node); - let file = SourceFile::new(new_file_node, Vec::new()); + let file = SourceFile::new(new_file_node); // FIXME: use a more elegant way to re-fetch the node (#1185), make // `range` private afterwards -- cgit v1.2.3