aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-05-28 14:34:23 +0100
committerAleksey Kladov <[email protected]>2019-05-28 14:34:23 +0100
commitafeaea7051a41269043b1443b9db1e8e44aa4a3e (patch)
treec8641dd8c3f792d290f2a979d3743ad3b848c957 /crates/ra_syntax
parent1cece9f219016152b2e8bc6194fb7f44a441c6db (diff)
drop error from SOurceFile constructor
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/lib.rs8
-rw-r--r--crates/ra_syntax/src/syntax_node.rs2
2 files changed, 5 insertions, 5 deletions
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 {
74pub use crate::ast::SourceFile; 74pub use crate::ast::SourceFile;
75 75
76impl SourceFile { 76impl SourceFile {
77 fn new(green: GreenNode, _errors: Vec<SyntaxError>) -> TreeArc<SourceFile> { 77 fn new(green: GreenNode) -> TreeArc<SourceFile> {
78 let root = SyntaxNode::new(green); 78 let root = SyntaxNode::new(green);
79 if cfg!(debug_assertions) { 79 if cfg!(debug_assertions) {
80 validation::validate_block_structure(&root); 80 validation::validate_block_structure(&root);
@@ -84,8 +84,8 @@ impl SourceFile {
84 } 84 }
85 85
86 pub fn parse(text: &str) -> TreeArc<SourceFile> { 86 pub fn parse(text: &str) -> TreeArc<SourceFile> {
87 let (green, errors) = parsing::parse_text(text); 87 let (green, _errors) = parsing::parse_text(text);
88 SourceFile::new(green, errors) 88 SourceFile::new(green)
89 } 89 }
90 90
91 pub fn reparse(&self, edit: &AtomTextEdit) -> TreeArc<SourceFile> { 91 pub fn reparse(&self, edit: &AtomTextEdit) -> TreeArc<SourceFile> {
@@ -94,7 +94,7 @@ impl SourceFile {
94 94
95 pub fn incremental_reparse(&self, edit: &AtomTextEdit) -> Option<TreeArc<SourceFile>> { 95 pub fn incremental_reparse(&self, edit: &AtomTextEdit) -> Option<TreeArc<SourceFile>> {
96 parsing::incremental_reparse(self.syntax(), edit, self.errors()) 96 parsing::incremental_reparse(self.syntax(), edit, self.errors())
97 .map(|(green_node, errors, _reparsed_range)| SourceFile::new(green_node, errors)) 97 .map(|(green_node, _errors, _reparsed_range)| SourceFile::new(green_node))
98 } 98 }
99 99
100 fn full_reparse(&self, edit: &AtomTextEdit) -> TreeArc<SourceFile> { 100 fn full_reparse(&self, edit: &AtomTextEdit) -> TreeArc<SourceFile> {
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 {
383 let len = new_children.iter().map(|it| it.text_len()).sum::<TextUnit>(); 383 let len = new_children.iter().map(|it| it.text_len()).sum::<TextUnit>();
384 let new_node = GreenNode::new(rowan::SyntaxKind(self.kind() as u16), new_children); 384 let new_node = GreenNode::new(rowan::SyntaxKind(self.kind() as u16), new_children);
385 let new_file_node = self.replace_with(new_node); 385 let new_file_node = self.replace_with(new_node);
386 let file = SourceFile::new(new_file_node, Vec::new()); 386 let file = SourceFile::new(new_file_node);
387 387
388 // FIXME: use a more elegant way to re-fetch the node (#1185), make 388 // FIXME: use a more elegant way to re-fetch the node (#1185), make
389 // `range` private afterwards 389 // `range` private afterwards