aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/syntax_node.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/syntax_node.rs')
-rw-r--r--crates/ra_syntax/src/syntax_node.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs
index 7c2b18af3..251668996 100644
--- a/crates/ra_syntax/src/syntax_node.rs
+++ b/crates/ra_syntax/src/syntax_node.rs
@@ -6,15 +6,10 @@
6//! The *real* implementation is in the (language-agnostic) `rowan` crate, this 6//! The *real* implementation is in the (language-agnostic) `rowan` crate, this
7//! module just wraps its API. 7//! module just wraps its API.
8 8
9use ra_parser::ParseError; 9pub(crate) use rowan::{GreenNode, GreenToken};
10use rowan::{GreenNodeBuilder, Language}; 10use rowan::{GreenNodeBuilder, Language};
11 11
12use crate::{ 12use crate::{Parse, SmolStr, SyntaxError, SyntaxKind, TextUnit};
13 syntax_error::{SyntaxError, SyntaxErrorKind},
14 Parse, SmolStr, SyntaxKind, TextUnit,
15};
16
17pub(crate) use rowan::{GreenNode, GreenToken};
18 13
19#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] 14#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
20pub enum RustLanguage {} 15pub enum RustLanguage {}
@@ -73,8 +68,7 @@ impl SyntaxTreeBuilder {
73 self.inner.finish_node() 68 self.inner.finish_node()
74 } 69 }
75 70
76 pub fn error(&mut self, error: ParseError, text_pos: TextUnit) { 71 pub fn error(&mut self, error: ra_parser::ParseError, text_pos: TextUnit) {
77 let error = SyntaxError::new(SyntaxErrorKind::ParseError(error), text_pos); 72 self.errors.push(SyntaxError::new_at_offset(error.0, text_pos))
78 self.errors.push(error)
79 } 73 }
80} 74}