drop error from SOurceFile constructor

This commit is contained in:
Aleksey Kladov 2019-05-28 16:34:23 +03:00
parent 1cece9f219
commit afeaea7051
2 changed files with 5 additions and 5 deletions

View File

@ -74,7 +74,7 @@ impl Parse {
pub use crate::ast::SourceFile;
impl SourceFile {
fn new(green: GreenNode, _errors: Vec<SyntaxError>) -> TreeArc<SourceFile> {
fn new(green: GreenNode) -> TreeArc<SourceFile> {
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<SourceFile> {
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<SourceFile> {
@ -94,7 +94,7 @@ impl SourceFile {
pub fn incremental_reparse(&self, edit: &AtomTextEdit) -> Option<TreeArc<SourceFile>> {
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<SourceFile> {

View File

@ -383,7 +383,7 @@ impl SyntaxNode {
let len = new_children.iter().map(|it| it.text_len()).sum::<TextUnit>();
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